tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Diggory <mdigg...@latte.harvard.edu>
Subject Re: Servlet Destroy Method....
Date Wed, 03 Apr 2002 18:44:34 GMT
Wow, mine eye's have been opened! I had always thought it was just 
individual servlets that were reloaded. In this case I guess I can live 
with destroying everything on reload, because the stuff I wanted to keep 
up is stored in the ServletContext.

Thanks for the clarification,
Mark


Craig R. McClanahan wrote:

> 
> On Wed, 3 Apr 2002, Mark Diggory wrote:
> 
> 
>>Date: Wed, 03 Apr 2002 12:24:31 -0500
>>From: Mark Diggory <mdiggory@latte.harvard.edu>
>>Reply-To: Tomcat Users List <tomcat-user@jakarta.apache.org>,
>>     mdiggory@latte.harvard.edu
>>To: Tomcat Users List <tomcat-user@jakarta.apache.org>
>>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
> recompiled.
> 
> 
>>-Mark
>>
>>
> 
> Craig
> 
> 
> --
> To unsubscribe:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
> For additional commands: <mailto:tomcat-user-help@jakarta.apache.org>
> Troubles with the list: <mailto:tomcat-user-owner@jakarta.apache.org>
> 



--
To unsubscribe:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands: <mailto:tomcat-user-help@jakarta.apache.org>
Troubles with the list: <mailto:tomcat-user-owner@jakarta.apache.org>


Mime
View raw message