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 callsCacheFactory.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>javax.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 Summary
Constructors Constructor Description DefaultServletContextListener()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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.
-
-
-
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 interfacejavax.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 interfacejavax.servlet.ServletContextListener
- Parameters:
evt
- the ServletContextEvent
-
-