Class DefaultServletContextListener

java.lang.Object
com.tangosol.coherence.rest.servlet.DefaultServletContextListener
All Implemented Interfaces:
EventListener, javax.servlet.ServletContextListener

public class DefaultServletContextListener extends Object implements javax.servlet.ServletContextListener
A simple implementation of the ServletContextListener interface that calls CacheFactory.shutdown() during servlet context shutdown.

This class should be registered in the web application deployment descriptor of a Coherence REST J2EE web application like so:

 <web-app>
   ...
   <listener>
     <listener-class>com.tangosol.coherence.rest.servlet.DefaultServletContextListener</listener-class>
   </listener>
   <servlet>
     <servlet-name>Coherence REST</servlet-name>
     <servlet-class>org.glassfish.jersey.servlet.ServletContainer</servlet-class>
     <init-param>
       <param-name>jakarta.ws.rs.Application</param-name>
       <param-value>com.tangosol.coherence.rest.server.DefaultResourceConfig</param-value>
     </init-param>
     <load-on-startup>1</load-on-startup>
   </servlet>
   ...
 </web-app>
 
Author:
jh 2011.12.21
  • Constructor Details

    • DefaultServletContextListener

      public DefaultServletContextListener()
  • Method Details

    • contextDestroyed

      public void contextDestroyed(javax.servlet.ServletContextEvent evt)
      Notification that the servlet context is about to be shut down. All servlets have been had their destroy() method called before any ServletContextListeners are notified of context destruction.
      Specified by:
      contextDestroyed in interface javax.servlet.ServletContextListener
      Parameters:
      evt - the ServletContextEvent
    • contextInitialized

      public void contextInitialized(javax.servlet.ServletContextEvent evt)
      Notification that the web application initialization process is starting. All ServletContextListeners are notified of context initialisation before any filter or servlet in the web application is initialized.
      Specified by:
      contextInitialized in interface javax.servlet.ServletContextListener
      Parameters:
      evt - the ServletContextEvent