|
From: Bas C. <ba...@ci...> - 2003-02-04 15:37:54
|
Bill Horsman wrote: > We have not found any robust way of determining when the application has > ended. Any suggestions are welcome. Runtime.addShutdownHook() is the key (JRE 1.3+). Shutdown hooks are always executed by the VM, no matter how it exits. The only drawback is an extra permission when the app is forked: permission java.lang.RuntimePermission "shutdownHooks"; According to the discussions at the JDC it is never guaranteed that the VM executes finalize(), whereas it is for shutdown hooks - I confirm this by my own practice. Kind regards, Bas -- Bas Cancrinus -> ba...@ci... Software Architect Cipherware Ltd. -> http://www.cipherware.com |