On Wed, 14 Mar 2001, David Wall wrote:

> Is there something like the web.xml's "load on startup" that can be
> triggered when the Tomcat has been requested to shutdown?  I'd like to be
> able to do "global" cleanup in such a situation.
> 

In the servlet 2.3 spec (supported by Tomcat 4.0), there are new
Application Event Listeners, and the events you can register listeners for
include "application startup" and "application shutdown".  There is no
such portable mechanism in servlet 2.2 (supported by Tomcat 3.2).


> I know that an unloaded servlet will be called, but it's not true that being
> unloaded means that Tomcat is stopping.
> 

For Tomcat 3.2, the only two circumstances where Tomcat actually calls the
destroy() method of a servlet are:
* Your context is being reloaded because of a changed class
* Tomcat is being shut down

But, as you noted, you cannot rely on this behavior portably.

> Thanks,
> David
> 
> 

Craig McClanahan


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]

Reply via email to