Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

listeners
Class SessionListener  view SessionListener download SessionListener.java

java.lang.Object
  extended bylisteners.SessionListener
All Implemented Interfaces:
java.util.EventListener, javax.servlet.http.HttpSessionAttributeListener, javax.servlet.http.HttpSessionListener, javax.servlet.ServletContextListener

public final class SessionListener
extends java.lang.Object
implements javax.servlet.ServletContextListener, javax.servlet.http.HttpSessionAttributeListener, javax.servlet.http.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.

Version:
$Revision: 267129 $ $Date: 2004-03-18 11:40:35 -0500 (Thu, 18 Mar 2004) $

Field Summary
private  javax.servlet.ServletContext context
          The servlet context with which we are associated.
 
Constructor Summary
SessionListener()
           
 
Method Summary
 void attributeAdded(javax.servlet.http.HttpSessionBindingEvent event)
          Record the fact that a servlet context attribute was added.
 void attributeRemoved(javax.servlet.http.HttpSessionBindingEvent event)
          Record the fact that a servlet context attribute was removed.
 void attributeReplaced(javax.servlet.http.HttpSessionBindingEvent event)
          Record the fact that a servlet context attribute was replaced.
 void contextDestroyed(javax.servlet.ServletContextEvent event)
          Record the fact that this web application has been destroyed.
 void contextInitialized(javax.servlet.ServletContextEvent event)
          Record the fact that this web application has been initialized.
private  void log(java.lang.String message)
          Log a message to the servlet context application log.
private  void log(java.lang.String message, java.lang.Throwable throwable)
          Log a message and associated exception to the servlet context application log.
 void sessionCreated(javax.servlet.http.HttpSessionEvent event)
          Record the fact that a session has been created.
 void sessionDestroyed(javax.servlet.http.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
 

Field Detail

context

private javax.servlet.ServletContext context
The servlet context with which we are associated.

Constructor Detail

SessionListener

public SessionListener()
Method Detail

attributeAdded

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

Specified by:
attributeAdded in interface javax.servlet.http.HttpSessionAttributeListener

attributeRemoved

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

Specified by:
attributeRemoved in interface javax.servlet.http.HttpSessionAttributeListener

attributeReplaced

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

Specified by:
attributeReplaced in interface javax.servlet.http.HttpSessionAttributeListener

contextDestroyed

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

Specified by:
contextDestroyed in interface javax.servlet.ServletContextListener

contextInitialized

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

Specified by:
contextInitialized in interface javax.servlet.ServletContextListener

sessionCreated

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

Specified by:
sessionCreated in interface javax.servlet.http.HttpSessionListener

sessionDestroyed

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

Specified by:
sessionDestroyed in interface javax.servlet.http.HttpSessionListener

log

private void log(java.lang.String message)
Log a message to the servlet context application log.


log

private void log(java.lang.String message,
                 java.lang.Throwable throwable)
Log a message and associated exception to the servlet context application log.