org.apache.jcs.utils.servlet
Class JCSServletContextListener

java.lang.Object
  extended by org.apache.jcs.utils.servlet.JCSServletContextListener
All Implemented Interfaces:
java.util.EventListener, javax.servlet.ServletContextListener

public class JCSServletContextListener
extends java.lang.Object
implements javax.servlet.ServletContextListener

If you add this to the context listeners section of your web.xml file, this will shutdown JCS gracefully.

Add the following to the top of your web.xml file.

  <listener>
  <listener-class>
  org.apache.jcs.utils.servlet.JCSServletContextListener
  </listener-class>
  </listener>
 

Author:
Aaron Smuts

Constructor Summary
JCSServletContextListener()
           
 
Method Summary
 void contextDestroyed(javax.servlet.ServletContextEvent arg0)
          This gets the singleton instance of the CompositeCacheManager and calls shutdown.
 void contextInitialized(javax.servlet.ServletContextEvent arg0)
          This does nothing.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JCSServletContextListener

public JCSServletContextListener()
Method Detail

contextInitialized

public void contextInitialized(javax.servlet.ServletContextEvent arg0)
This does nothing. We don't want to initialize the cache here.

(non-Javadoc)

Specified by:
contextInitialized in interface javax.servlet.ServletContextListener
See Also:
ServletContextListener.contextInitialized(javax.servlet.ServletContextEvent)

contextDestroyed

public void contextDestroyed(javax.servlet.ServletContextEvent arg0)
This gets the singleton instance of the CompositeCacheManager and calls shutdown.

(non-Javadoc)

Specified by:
contextDestroyed in interface javax.servlet.ServletContextListener
See Also:
ServletContextListener.contextDestroyed(javax.servlet.ServletContextEvent)


Copyright © 2002-2010 Apache Software Foundation. All Rights Reserved.