org.apache.jcs.utils.servlet.session
Class DistSessionTracker

java.lang.Object
  extended byorg.apache.jcs.utils.servlet.session.DistSessionTracker
All Implemented Interfaces:
ISessionConstants

public class DistSessionTracker
extends java.lang.Object
implements ISessionConstants

Manages sessions for the HttpRequestSessionWrapper

Version:
$Revision: 1.3 $ $Date: 2003/08/22 11:57:18 $
Author:
Aaron Smuts

Field Summary
(package private) static int clients
           
private static DistSessionPoolManager dsMgr
           
private static DistSessionGC gc
          Used to asynchronously remove expired DistSession objects.
static DistSessionTracker instance
          Description of the Field
private static org.apache.commons.logging.Log log
           
private static java.util.Set sessIdSet
          Used to check and remove expired DistSession objects.
static java.lang.String SESSION_COOKIE_NAME
          Description of the Field
 
Fields inherited from interface org.apache.jcs.utils.servlet.session.ISessionConstants
DFLT_INACTIVE_INTERVAL, SESS_CACHE_NAME, SESS_CACHE_SIZE, SESS_INFO_CACHE_NAME, SESS_INFO_CACHE_SIZE
 
Constructor Summary
private DistSessionTracker()
          Constructor for the DistSessionTracker object
 
Method Summary
private  MetaHttpSession createDistSession(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res)
          Description of the Method
private  MetaHttpSession getDistSession(javax.servlet.http.HttpServletRequest req)
          Gets the distSession attribute of the DistSessionTracker object
static DistSessionTracker getInstance()
          Gets the instance attribute of the DistSessionTracker class
 java.lang.String getRequestedSessionId(javax.servlet.http.HttpServletRequest req)
          Gets the requested session id from the cookie.
 MetaHttpSession getSession(boolean create, javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res)
          Gets the session attribute of the DistSessionTracker object
 MetaHttpSession getSession(javax.servlet.http.HttpServletRequest req)
          Gets the session attribute of the DistSessionTracker object
 java.lang.String getStats()
          Gets the stats attribute of the DistSessionTracker object
 boolean isRequestedSessionIdValid(javax.servlet.http.HttpServletRequest req)
          Gets the requestedSessionIdValid attribute of the DistSessionTracker object
 void release()
          Description of the Method
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

private static final org.apache.commons.logging.Log log

SESSION_COOKIE_NAME

public static final java.lang.String SESSION_COOKIE_NAME
Description of the Field

See Also:
Constant Field Values

dsMgr

private static DistSessionPoolManager dsMgr

instance

public static DistSessionTracker instance
Description of the Field


clients

static int clients

sessIdSet

private static transient java.util.Set sessIdSet
Used to check and remove expired DistSession objects.


gc

private static transient DistSessionGC gc
Used to asynchronously remove expired DistSession objects.

Constructor Detail

DistSessionTracker

private DistSessionTracker()
Constructor for the DistSessionTracker object

Method Detail

getInstance

public static DistSessionTracker getInstance()
Gets the instance attribute of the DistSessionTracker class

Returns:
The instance value

getSession

public MetaHttpSession getSession(javax.servlet.http.HttpServletRequest req)
Gets the session attribute of the DistSessionTracker object

Returns:
The session value

getSession

public MetaHttpSession getSession(boolean create,
                                  javax.servlet.http.HttpServletRequest req,
                                  javax.servlet.http.HttpServletResponse res)
Gets the session attribute of the DistSessionTracker object

Returns:
The session value

createDistSession

private MetaHttpSession createDistSession(javax.servlet.http.HttpServletRequest req,
                                          javax.servlet.http.HttpServletResponse res)
Description of the Method


getDistSession

private MetaHttpSession getDistSession(javax.servlet.http.HttpServletRequest req)
Gets the distSession attribute of the DistSessionTracker object

Returns:
The distSession value

getRequestedSessionId

public java.lang.String getRequestedSessionId(javax.servlet.http.HttpServletRequest req)
Gets the requested session id from the cookie. Todo, implement URL session tracking.


isRequestedSessionIdValid

public boolean isRequestedSessionIdValid(javax.servlet.http.HttpServletRequest req)
Gets the requestedSessionIdValid attribute of the DistSessionTracker object


release

public void release()
Description of the Method


getStats

public java.lang.String getStats()
Gets the stats attribute of the DistSessionTracker object

Returns:
The stats value