tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Konstantin Kolinko" <>
Subject Re: Tomcat shutdown event
Date Sat, 13 Sep 2008 02:32:18 GMT
2008/9/13 Tom Cat <>:
> I have a servlet spawn a thread that should run until tomcat is
> shutdown. The problem is, when Tomcat is shut down, the thread keeps
> running.
> Does Tomcat have a shutdown event that I could use to trigger the
> thread destruction? If not, is there any graceful way of handling
> this?

You may implement a

Also, the Servlet spec provides the ServletContextListener interface.

Also, Java has support for JVM shutdown hooks.

Also, if you start your own thread you may want to call
Thread.setDaemon(true), because non-demon (default) threads
prevent JVM from shutdown.

Best regards,
Konstantin Kolinko

To start a new topic, e-mail:
To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message