Class SessionListener
- java.lang.Object
-
- org.apache.turbine.services.session.SessionListener
-
- All Implemented Interfaces:
Serializable
,EventListener
,HttpSessionActivationListener
,HttpSessionListener
public class SessionListener extends Object implements HttpSessionListener, HttpSessionActivationListener, Serializable
This class is a listener for both session creation and destruction, and for session activation and passivation. It must be configured via your web application'sweb.xml
deployment descriptor as follows for the container to call it:<listener> <listener-class> org.apache.turbine.session.SessionListener </listener-class> </listener>
<listener>
elements can occur between<context-param>
and<servlet>
elements in your deployment descriptor. ThesessionCreated(HttpSessionEvent)
callback will automatically add an instance of this listener to any newly createdHttpSession
for detection of session passivation and re-activation.- Since:
- 2.3
- Version:
- $Id$
- Author:
- Quinton McCombs, Daniel Rall
- See Also:
HttpSessionListener
, Serialized Form
-
-
Constructor Summary
Constructors Constructor Description SessionListener()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
sessionCreated(HttpSessionEvent event)
Called by the servlet container when a new session is createdvoid
sessionDestroyed(HttpSessionEvent event)
Called by the servlet container when a session is destroyedvoid
sessionDidActivate(HttpSessionEvent event)
Called by the servlet container when an existing session is (re-)activated.void
sessionWillPassivate(HttpSessionEvent event)
Called by the servlet container when a an existing session is passivated.
-
-
-
Constructor Detail
-
SessionListener
public SessionListener()
-
-
Method Detail
-
sessionCreated
public void sessionCreated(HttpSessionEvent event)
Called by the servlet container when a new session is created- Specified by:
sessionCreated
in interfaceHttpSessionListener
- Parameters:
event
- Session creation event.
-
sessionDestroyed
public void sessionDestroyed(HttpSessionEvent event)
Called by the servlet container when a session is destroyed- Specified by:
sessionDestroyed
in interfaceHttpSessionListener
- Parameters:
event
- Session destruction event.
-
sessionDidActivate
public void sessionDidActivate(HttpSessionEvent event)
Called by the servlet container when an existing session is (re-)activated.- Specified by:
sessionDidActivate
in interfaceHttpSessionActivationListener
- Parameters:
event
- Session activation event.
-
sessionWillPassivate
public void sessionWillPassivate(HttpSessionEvent event)
Called by the servlet container when a an existing session is passivated.- Specified by:
sessionWillPassivate
in interfaceHttpSessionActivationListener
- Parameters:
event
- Session passivation event.
-
-