Package net.sf.ehcache.constructs.web
Class ShutdownListener
- java.lang.Object
-
- net.sf.ehcache.constructs.web.ShutdownListener
-
- All Implemented Interfaces:
java.util.EventListener,javax.servlet.ServletContextListener
public class ShutdownListener extends java.lang.Object implements javax.servlet.ServletContextListenerA ServletContextListener that shutsdown CacheManager. Use this when you want to shutdown ehcache automatically when the web application is shutdown.To receive notification events, this class must be configured in the deployment descriptor for the web application. To do so, add the following to web.xml in your web application:
<listener> <listener-class>net.sf.ehcache.constructs.web.ShutdownListener</listener-class> </listener>- Version:
- $Id: ShutdownListener.java 744 2008-08-16 20:10:49Z gregluck $
- Author:
- Daniel Wiell, Greg Luck
-
-
Constructor Summary
Constructors Constructor Description ShutdownListener()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcontextDestroyed(javax.servlet.ServletContextEvent servletContextEvent)Notification that the servlet context is about to be shut down.voidcontextInitialized(javax.servlet.ServletContextEvent servletContextEvent)Notification that the web application is ready to process requests.
-
-
-
Method Detail
-
contextInitialized
public void contextInitialized(javax.servlet.ServletContextEvent servletContextEvent)
Notification that the web application is ready to process requests.- Specified by:
contextInitializedin interfacejavax.servlet.ServletContextListener- Parameters:
servletContextEvent-
-
contextDestroyed
public void contextDestroyed(javax.servlet.ServletContextEvent servletContextEvent)
Notification that the servlet context is about to be shut down.Shuts down all cache managers known to
CacheManager.ALL_CACHE_MANAGERS- Specified by:
contextDestroyedin interfacejavax.servlet.ServletContextListener- Parameters:
servletContextEvent-
-
-