You don't want to use finalize() it isn't guaranteed to be called and even if does get
called, it wrecks gc performance.

A real solution would be to do caller side analysis/weaving:
i.e.

POJOResource pr = new POJOResource;
pr.doSomething();

becomes (pseudo code)

POJOResource pr = POJOResourceManager.get();
try
{
pr.doSomething();
}
finally
{
POJOResourceManager.release(pr);
}

But this requires a fair bit of analysis of the bytecode.

A simpler solution would be to assume the resource has a close() method
and that it is called by the client. You would just identify the close operation
in the metadata.

The handles are just "proxies".

Regards,
Adrian

View the original post : 
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3831056#3831056

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3831056


-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
JBoss-Development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to