use PhantomReferences to determine exactly when an object was removed from memory
http://weblogs.java.net/blog/enicholas/archive/2006/05/understanding_w.html -- Dehua (Andy) Zhang Sable Research Group, McGill University Montréal, Québec, Canada http://www.cs.mcgill.ca/~dzhang25 -----Original Message----- From: [EMAIL PROTECTED] on behalf of Eric Bodden Sent: Sun 11/11/2007 10:55 To: [email protected] Subject: Re: [aspectj-users] looking for a "magic" pointcut for ... You could probably build one on your own via testing a weak reference in an if-pointcut. However, you would need to poll this reference over and over again. I don't think there's any way to have the garbage collector call you when an object is GC'ed. Having said that, you *could* probably attach an advice to the finalize() method, but as the documentation says, finalizers are not guaranteed to be run, or if they are run you get no guarantee about when or in which order. They may even run in parallel, if I remember correctly. Eric On 11/11/2007, Jean-Louis.Pasturel <[EMAIL PROTECTED]> wrote: > Hi, > Is there a "magic" pointcut for detecting when an object : > - is finalized or this object is no more referenced ( object=null ;) ? > - is garbagged ? > > > Is-it only possible with AspectJ ? > > Best Regards > Jean-Louis > > _______________________________________________ > aspectj-users mailing list > [email protected] > https://dev.eclipse.org/mailman/listinfo/aspectj-users > -- Eric Bodden Sable Research Group McGill University, Montréal, Canada _______________________________________________ aspectj-users mailing list [email protected] https://dev.eclipse.org/mailman/listinfo/aspectj-users _______________________________________________ aspectj-users mailing list [email protected] https://dev.eclipse.org/mailman/listinfo/aspectj-users
