org.apache.turbine.services.session
Class SessionListener

java.lang.Object
  extended byorg.apache.turbine.services.session.SessionListener
All Implemented Interfaces:
java.util.EventListener, javax.servlet.http.HttpSessionActivationListener, javax.servlet.http.HttpSessionListener, java.io.Serializable

public class SessionListener
extends java.lang.Object
implements javax.servlet.http.HttpSessionListener, javax.servlet.http.HttpSessionActivationListener, java.io.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's web.xml deployment descriptor as follows for the container to call it:

 <listener>
   <listener-class>
     org.apache.turbine.session.SessionListener
   </listener-class>
 </listener>
 
<listener> elemements can occur between <context-param> and <servlet> elements in your deployment descriptor. The sessionCreated(HttpSessionEvent) callback will automatically add an instance of this listener to any newly created HttpSession for detection of session passivation and re-activation.

Since:
2.3
Version:
$Id: SessionListener.java 534527 2007-05-02 16:10:59Z tv $
Author:
Quinton McCombs, Daniel Rall
See Also:
HttpSessionListener, Serialized Form

Constructor Summary
SessionListener()
           
 
Method Summary
 void sessionCreated(javax.servlet.http.HttpSessionEvent event)
          Called by the servlet container when a new session is created
 void sessionDestroyed(javax.servlet.http.HttpSessionEvent event)
          Called by the servlet container when a session is destroyed
 void sessionDidActivate(javax.servlet.http.HttpSessionEvent event)
          Called by the servlet container when an existing session is (re-)activated.
 void sessionWillPassivate(javax.servlet.http.HttpSessionEvent event)
          Called by the servlet container when a an existing session is passivated.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SessionListener

public SessionListener()
Method Detail

sessionCreated

public void sessionCreated(javax.servlet.http.HttpSessionEvent event)
Called by the servlet container when a new session is created

Specified by:
sessionCreated in interface javax.servlet.http.HttpSessionListener
Parameters:
event - Session creation event.

sessionDestroyed

public void sessionDestroyed(javax.servlet.http.HttpSessionEvent event)
Called by the servlet container when a session is destroyed

Specified by:
sessionDestroyed in interface javax.servlet.http.HttpSessionListener
Parameters:
event - Session destruction event.

sessionDidActivate

public void sessionDidActivate(javax.servlet.http.HttpSessionEvent event)
Called by the servlet container when an existing session is (re-)activated.

Specified by:
sessionDidActivate in interface javax.servlet.http.HttpSessionActivationListener
Parameters:
event - Session activation event.

sessionWillPassivate

public void sessionWillPassivate(javax.servlet.http.HttpSessionEvent event)
Called by the servlet container when a an existing session is passivated.

Specified by:
sessionWillPassivate in interface javax.servlet.http.HttpSessionActivationListener
Parameters:
event - Session passivation event.


Copyright © 2000-2008 Apache Software Foundation. All Rights Reserved.