tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig R. McClanahan" <>
Subject Re: Servlet Destroy Method....
Date Wed, 03 Apr 2002 18:37:58 GMT

On Wed, 3 Apr 2002, Mark Diggory wrote:

> Date: Wed, 03 Apr 2002 12:24:31 -0500
> From: Mark Diggory <>
> Reply-To: Tomcat Users List <>,
> To: Tomcat Users List <>
> Subject: Re: Servlet Destroy Method....
> Yes I was looking to "not do something" in the destroy() method if its
> just the case that the servlet is being reloaded by the server.
> Otherwise, if the server was actually going through a shutdown process
> then I want my destroy() method to do something.

Java doesn't have any means to replace an existing class.  So, when Tomcat
does a reload to reflect your updated servlet or bean class, it has to:
- Shut down the entire webapp
- Throw away the webapp class loader and all the classes
  that were previously loaded from /WEB-INF/classes and /WEB-INF/lib
- Restart the entire webapp

Given this, there is basically no difference between what Tomcat does on a
reload versus a normal shutdown (except, of course, for the fact that the
app is not restarted again).  There also isn't anything you could really
do differently even if you knew which kind of shutdown it was, because the
rest of the webapp is getting thrown away as well as the class you just

> -Mark


To unsubscribe:   <>
For additional commands: <>
Troubles with the list: <>

View raw message