tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alec Bau <Alec....@msdw.com>
Subject Re: Is there a signal I can listen to for Tomcat shutdown?
Date Thu, 20 Jul 2000 18:08:52 GMT
JDK 1.3 also added "Runtime.addShutdownHook(Thread hook)" method. Hook
threads are run when JVM terminates (normally or abnormally) but before any
finalizes. There can be any number of different shutdown hooks registered
though the order of execution isn't guaranteed.

Thanks,
    Alec

"Craig R. McClanahan" wrote:

> "Bragg, Casey" wrote:
>
> > How can I determine when Tomcat is shutting down?  I'd like to run some
> > cleanup methods first.
> >
>
> The typical approach today is to have a load-on-startup servlet that is
> never actually called to serve requests.  The init() method of this
> servlet
> can be used to set up your resources in the first place, and the
> destroy()
> method can be used to clean up.  This relies on the fact that Tomcat
> won't
> unload the servlet in the mean time, which is true for Tomcat today but
> is
> not guaranteed behavior.
>
> The next version of the servlet spec will have more formal support for
> application startup and shutdown events.
>
> >
> > Thanks...
> >
> > ...Casey
>
> Craig McClanahan

Mime
View raw message