On 7 Feb 2002, Gary Lawrence Murphy wrote:

> Date: 07 Feb 2002 01:55:42 -0500
> From: Gary Lawrence Murphy <[EMAIL PROTECTED]>
> Reply-To: Tomcat Users List <[EMAIL PROTECTED]>,
>      Gary Lawrence Murphy <[EMAIL PROTECTED]>
> To: Tomcat Users <[EMAIL PROTECTED]>
> Subject: Can a servlet exit?
>
>
> can a servlet remove itself?

No.  Java provides no means to remove an existing class from a class
loader, once it has been loaded.

>  I have a situation where a servlet's
> configuration file may require on-the-fly edits, but the site runs
> dozens of servlets and we don't want to restart tomcat just to
> restart one webapp.
>
> Long term, we plan to re-write the servlet to include a "reload"
> function (the proper way to do this), but for now the easiest path
> would seem to be to have the servlet purge itself from the servlet
> container such that it will be completely reloaded on the next
> request.  Is this possible?
>

The only choice (and the one that Tomcat implements when you reload a
webapp) is to shut down the application, throw away its class loader, and
load things up again.

Craig

> --
> Gary Lawrence Murphy <[EMAIL PROTECTED]> TeleDynamics Communications Inc
> Business Innovations Through Open Source Systems: http://www.teledyn.com
> "Computers are useless.  They can only give you answers."(Pablo Picasso)
>
>
> --
> To unsubscribe:   <mailto:[EMAIL PROTECTED]>
> For additional commands: <mailto:[EMAIL PROTECTED]>
> Troubles with the list: <mailto:[EMAIL PROTECTED]>
>
>


--
To unsubscribe:   <mailto:[EMAIL PROTECTED]>
For additional commands: <mailto:[EMAIL PROTECTED]>
Troubles with the list: <mailto:[EMAIL PROTECTED]>

Reply via email to