tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From André Warnier ...@ice-sa.com>
Subject Re: Tomcat shutdown problem due to running threads.
Date Wed, 17 Jun 2009 08:38:52 GMT
CBy wrote:
> O'Reilly's Tomcat The Definitive Guide advises me to invoke the 
> setDaemon(true) method on any Thread object a web application creates to 
> keep them from hanging the JVM when Tomcat shuts down. My web service, 
> however, uses a thread pool that is created via 
> java.util.concurrent.Executors.newFixedThreadPool(NTHREADS) and I don't 
> know how to make them daemon threads in this case.
> 
> My new plan was to register a shutdown hook with the JVM in my web 
> service and to invoke shutdown() or shutdownNow() on the ExecutorService 
> in it (the method above returns an ExecutorService). Unfortunately, this 
> does not seem to work.
> 
> Is there another way to be notified when Tomcat shuts down, so I can 
> shutdown the thread pool accordingly?
> 
 From a non-expert (but the expterts are mostly asleep right now) :
maybe this ?
http://tomcat.apache.org/tomcat-6.0-doc/config/listeners.html

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message