Skip navigation links

Oracle® Coherence Java API Reference
Release 12.1.2.0.3

E26043-02


com.tangosol.coherence.rest.servlet
Class DefaultServletContextListener

java.lang.Object
  extended by com.tangosol.coherence.rest.servlet.DefaultServletContextListener

All Implemented Interfaces:
java.util.EventListener, javax.servlet.ServletContextListener

public class DefaultServletContextListener
extends java.lang.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>com.sun.jersey.spi.container.servlet.ServletContainer</servlet-class>
     <init-param>
       <param-name>com.sun.jersey.config.property.resourceConfigClass</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 Summary
DefaultServletContextListener()
           

 

Method Summary
 void contextDestroyed(javax.servlet.ServletContextEvent evt)
          Notification that the servlet context is about to be shut down.
 void contextInitialized(javax.servlet.ServletContextEvent evt)
          Notification that the web application initialization process is starting.

 

Constructor Detail

DefaultServletContextListener

public DefaultServletContextListener()

Method Detail

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

Skip navigation links

Oracle® Coherence Java API Reference
Release 12.1.2.0.3

E26043-02


Copyright © 2000, 2014, Oracle and/or its affiliates. All rights reserved.