Thanks for pointing me in the right direction André. A
ServletContextListener fixed my problem.
André Warnier wrote:
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-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org