You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Tim Funk <fu...@joedog.org> on 2003/02/11 15:43:54 UTC

[PATCH] Allow System.exit to be called on shutdown [was Re: Shutdown.sh does not work when long lasting operations, such as SQL Queries, are still active!

Here is the patch to StandardServer.java and LocalStrings.properties.

Synopsis:
  New property: shutdownWait if greater than zero. Then to the end of 
shutdown, a new daemon thread is created which sleeps for {shutdownWait} 
seconds. When (and if) the Thread wakes back up, it prints to 
System.out() then new message in LocalStrings.properties and then calls 
System.exit.

shutdownWait defaults to zero. If zero or neagtive, then it is ignored 
and the old behavior occurs. (Which is to do nothing extra)

This patch was from tomcat5.

If this is good enough to accept, I can later submit the patches for the 
admin app and mbeans-descriptors.xml.

Also attached is the JSP I used to ensure the server stayed running. 
Ignore the quality of the jsp - its just a test.


-Tim


Craig R. McClanahan wrote:
> 
> On Mon, 10 Feb 2003, Tim Funk wrote:
> 
> 
>>Why is a kill done instead of a System.exit()?
> 
> 
> System.exit() is absolutely the wrong answer if Tomcat is embedded into a
> larger server-side application, rather than run separately in the usual
> way.  At best, you would need to make this configurable somehow (with the
> default to *not* run System.exit()).
> 
> Craig
> 

Re: [PATCH] Allow System.exit to be called on shutdown [was Re: Shutdown.sh does not work when long lasting operations, such as SQL Queries, are still active!

Posted by Tim Funk <fu...@joedog.org>.
Here is my jsp test case (again .. sigh) - I had to rename it to txt 
file so mozilla would attach it.


-Tim