Shutdown Hook in Tomcat using ServletContextListener
By admin on Jul 29, 2008 in Java, Programming
Normally in my standalone Java program I can add a shutdown hook to the JVM runtime easily. To achieve the same thing in Tomcat, I use ServletContextListener.contextDestroyed method.
If you implemented ServletContextListener, implementations of this interface receive notifications about changes to the servlet context of the web application they are part of. To receive notification events, the implementation class must be configured in the deployment descriptor for the web application.
Sorry, comments for this entry are closed at this time.