msi.web.application
Class SessionTracker

java.lang.Object
  extended bymsi.web.application.SessionTracker
All Implemented Interfaces:
java.util.EventListener, javax.servlet.http.HttpSessionAttributeListener, javax.servlet.http.HttpSessionListener

public class SessionTracker
extends java.lang.Object
implements javax.servlet.http.HttpSessionListener, javax.servlet.http.HttpSessionAttributeListener

Simple class to track sessions as they are created and destroyed.

Author:
Joseph Acosta

Constructor Summary
SessionTracker()
           
 
Method Summary
 void attributeAdded(javax.servlet.http.HttpSessionBindingEvent event)
           
 void attributeRemoved(javax.servlet.http.HttpSessionBindingEvent event)
           
 void attributeReplaced(javax.servlet.http.HttpSessionBindingEvent event)
           
static int getActiveSessions()
          This gets the list of active sessions.
 void sessionCreated(javax.servlet.http.HttpSessionEvent se)
          What to do when a session is created.
 void sessionDestroyed(javax.servlet.http.HttpSessionEvent se)
          What to do when a session is destroyed.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SessionTracker

public SessionTracker()
Method Detail

attributeAdded

public void attributeAdded(javax.servlet.http.HttpSessionBindingEvent event)
Specified by:
attributeAdded in interface javax.servlet.http.HttpSessionAttributeListener

attributeRemoved

public void attributeRemoved(javax.servlet.http.HttpSessionBindingEvent event)
Specified by:
attributeRemoved in interface javax.servlet.http.HttpSessionAttributeListener

attributeReplaced

public void attributeReplaced(javax.servlet.http.HttpSessionBindingEvent event)
Specified by:
attributeReplaced in interface javax.servlet.http.HttpSessionAttributeListener

sessionCreated

public void sessionCreated(javax.servlet.http.HttpSessionEvent se)
What to do when a session is created.

Specified by:
sessionCreated in interface javax.servlet.http.HttpSessionListener
Parameters:
se - - session event.
Returns:
void.

sessionDestroyed

public void sessionDestroyed(javax.servlet.http.HttpSessionEvent se)
What to do when a session is destroyed.

Specified by:
sessionDestroyed in interface javax.servlet.http.HttpSessionListener
Parameters:
se - - session event.
Returns:
void.

getActiveSessions

public static int getActiveSessions()
This gets the list of active sessions.

Returns:
int number of active sessions.