Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [aspectj-users] Capturing shutdown

On 11:13:33 am 06/02/05 Eric Bodden <eric@xxxxxxxxx> wrote:
>
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Valentin Crettaz wrote:
> >  Have you tried investigating
> >  java.lang.Runtime.addShutdownHook(java.lang.Thread)
> >  http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Runtime.html#addS
> > h
> >  utdownHook(java.lang.Thread)
>
> Yes, I have. Thanks for the hint. However I would really prefer a
> pure AspectJ solution, since shutdown hooks are not 100% reliable
> AFAIK.


Can you give an example when they are not reliable?  

addShutdownHook is the right way to do this.  A vm could exit for a number
of reasons: e.g. calling System.exit, vm error, out of memory, user
break... I don't think AspectJ can capture any or at least not all of these


Jeff
--
Jeffrey Palm --> http://www.ccs.neu.edu/home/jpalm



Back to the top