Another option might be the Runtime.getRuntime().addShutdownHook() method. >From JDK 1.3: "A shutdown hook is simply an initialized but unstarted thread. When the virtual machine begins its shutdown sequence it will start all registered shutdown hooks in some unspecified order and let them run concurrently." Larry
>>> [EMAIL PROTECTED] 05/24/02 01:03AM >>> does using a servlet's "destroy" method not guarantee enough finality? a hack might be to have a servlet's destroy method "wait" for a time period and then do your cleanup (if you want to ensure your other servlets have been destroyed). It's a hack, but it might work. If there's a better answer, I haven't found it. On 5/23/02 11:54 PM, "Michael Reutter" <[EMAIL PROTECTED]> wrote: > How can I tell tomcat, to run some code (delete temporary files in some > directories) when shuting down (is there something like a "ContextListener" - > like a "SessionListener")?
