oracle.clex.util
Class ServletEventListener
java.lang.Object
|
+--oracle.clex.util.ServletEventListener
- All Implemented Interfaces:
- javax.servlet.http.HttpSessionListener, javax.servlet.ServletContextListener
- public class ServletEventListener
- extends java.lang.Object
- implements javax.servlet.http.HttpSessionListener, javax.servlet.ServletContextListener
ServletEventListener class implements the J2EE Session Lifecyle Listener interface.
It is responsible to take action in case of creation and destruction of a session.
The action taken can be delegated.
At this point the class closes connections for a particular session in case
a session is destroyed. If the container shuts down it will close all open connections belonging
to the web-app.
to register this class as an event listener for a web app you will have to insert
the following statements into the web.xml file:
<listener>
<listener-class>oracle.clex.util.ServletEventListener</listener-class>
</listener>
Method Summary |
void |
contextDestroyed(javax.servlet.ServletContextEvent p0)
Dummy Implementation. |
void |
contextInitialized(javax.servlet.ServletContextEvent p0)
Dummy Implementation |
void |
sessionCreated(javax.servlet.http.HttpSessionEvent anHttpSessionEvent)
|
void |
sessionDestroyed(javax.servlet.http.HttpSessionEvent anHttpSessionEvent)
This method is called from the container upon destruction of a session. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ServletEventListener
public ServletEventListener()
sessionDestroyed
public void sessionDestroyed(javax.servlet.http.HttpSessionEvent anHttpSessionEvent)
- This method is called from the container upon destruction of a session.
Prerequisites are that this class is registered as a listener class in the
appropriate J2EE deployment file which is web.xml.
At this point it only closes connections associated with the session to
be destroyed.
- Specified by:
sessionDestroyed
in interface javax.servlet.http.HttpSessionListener
sessionCreated
public void sessionCreated(javax.servlet.http.HttpSessionEvent anHttpSessionEvent)
- Specified by:
sessionCreated
in interface javax.servlet.http.HttpSessionListener
contextInitialized
public void contextInitialized(javax.servlet.ServletContextEvent p0)
- Dummy Implementation
- Specified by:
contextInitialized
in interface javax.servlet.ServletContextListener
contextDestroyed
public void contextDestroyed(javax.servlet.ServletContextEvent p0)
- Dummy Implementation.
Could be the place where we release all the connections in case the app server goes down
- Specified by:
contextDestroyed
in interface javax.servlet.ServletContextListener
Copyright © 2003 ORACLE Corp. All Rights Reserved.