[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] aspectJ and System.exit().

Jean-Louis PASTUREL wrote:
> Aspect regarding, is there a means to know when a JVM is exiting on
> System signal (like Control-C or kill -9 )?

There are the regular shutdown hooks, which are sadly much less useful
than they first appear to be:
http://java.sun.com/j2se/1.4.2/docs/guide/lang/hook-design.html

> If yes is-it possible to apply an advice âbeforeâ ?

You can always advise your own code to run before System.exit at either
call or execution. "around" might even work as well because of the way
"finally" works, though I would not bet on "after" :-)

Holger