listeners
Class SessionListener

java.lang.Object
  extended by listeners.SessionListener
All Implemented Interfaces:
EventListener, HttpSessionAttributeListener, HttpSessionListener, ServletContextListener

public final class SessionListener
extends Object
implements ServletContextListener, HttpSessionAttributeListener, HttpSessionListener

Example listener for context-related application events, which were introduced in the 2.3 version of the Servlet API. This listener merely documents the occurrence of such events in the application log associated with our servlet context.

Author:
Craig R. McClanahan

Constructor Summary
SessionListener()
           
 
Method Summary
 void attributeAdded(HttpSessionBindingEvent event)
          Record the fact that a servlet context attribute was added.
 void attributeRemoved(HttpSessionBindingEvent event)
          Record the fact that a servlet context attribute was removed.
 void attributeReplaced(HttpSessionBindingEvent event)
          Record the fact that a servlet context attribute was replaced.
 void contextDestroyed(ServletContextEvent event)
          Record the fact that this web application has been destroyed.
 void contextInitialized(ServletContextEvent event)
          Record the fact that this web application has been initialized.
 void sessionCreated(HttpSessionEvent event)
          Record the fact that a session has been created.
 void sessionDestroyed(HttpSessionEvent event)
          Record the fact that a session has been destroyed.
 
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

attributeAdded

public void attributeAdded(HttpSessionBindingEvent event)
Record the fact that a servlet context attribute was added.

Specified by:
attributeAdded in interface HttpSessionAttributeListener
Parameters:
event - The session attribute event

attributeRemoved

public void attributeRemoved(HttpSessionBindingEvent event)
Record the fact that a servlet context attribute was removed.

Specified by:
attributeRemoved in interface HttpSessionAttributeListener
Parameters:
event - The session attribute event

attributeReplaced

public void attributeReplaced(HttpSessionBindingEvent event)
Record the fact that a servlet context attribute was replaced.

Specified by:
attributeReplaced in interface HttpSessionAttributeListener
Parameters:
event - The session attribute event

contextDestroyed

public void contextDestroyed(ServletContextEvent event)
Record the fact that this web application has been destroyed.

Specified by:
contextDestroyed in interface ServletContextListener
Parameters:
event - The servlet context event

contextInitialized

public void contextInitialized(ServletContextEvent event)
Record the fact that this web application has been initialized.

Specified by:
contextInitialized in interface ServletContextListener
Parameters:
event - The servlet context event

sessionCreated

public void sessionCreated(HttpSessionEvent event)
Record the fact that a session has been created.

Specified by:
sessionCreated in interface HttpSessionListener
Parameters:
event - The session event

sessionDestroyed

public void sessionDestroyed(HttpSessionEvent event)
Record the fact that a session has been destroyed.

Specified by:
sessionDestroyed in interface HttpSessionListener
Parameters:
event - The session event


Copyright © 2003-2007 Apache Software Foundation. All Rights Reserved.