org.mortbay.terracotta.servlet
Class TerracottaSessionManager

java.lang.Object
  extended by org.mortbay.component.AbstractLifeCycle
      extended by org.mortbay.jetty.servlet.AbstractSessionManager
          extended by org.mortbay.terracotta.servlet.TerracottaSessionManager
All Implemented Interfaces:
Runnable, LifeCycle, SessionManager

public class TerracottaSessionManager
extends AbstractSessionManager
implements Runnable

TODO: handle sessions that do not expire A specialized SessionManager to be used with Terracotta.

See Also:
TerracottaSessionIdManager

Nested Class Summary
static class TerracottaSessionManager.SessionData
          The session data that is distributed to cluster nodes via Terracotta.
 
Nested classes/interfaces inherited from class org.mortbay.jetty.servlet.AbstractSessionManager
AbstractSessionManager.NullSessionContext, AbstractSessionManager.SessionIf
 
Nested classes/interfaces inherited from interface org.mortbay.component.LifeCycle
LifeCycle.Listener
 
Field Summary
 
Fields inherited from class org.mortbay.jetty.servlet.AbstractSessionManager
__distantFuture, _context, _dftMaxIdleSecs, _httpOnly, _loader, _maxCookieAge, _maxSessions, _minSessions, _nodeIdInSessionId, _refreshCookieAge, _secureCookies, _sessionAttributeListeners, _sessionCookie, _sessionDomain, _sessionHandler, _sessionIdManager, _sessionListeners, _sessionPath, _sessionURL, _sessionURLPrefix
 
Fields inherited from class org.mortbay.component.AbstractLifeCycle
_listeners
 
Fields inherited from interface org.mortbay.jetty.SessionManager
__DefaultSessionCookie, __DefaultSessionDomain, __DefaultSessionURL, __MaxAgeProperty, __SessionCookieProperty, __SessionDomainProperty, __SessionPathProperty, __SessionURLProperty
 
Constructor Summary
TerracottaSessionManager()
           
 
Method Summary
protected  void addSession(AbstractSessionManager.Session session)
           
 void doStart()
           
 void doStop()
           
 long getScavengePeriodMs()
           
 AbstractSessionManager.Session getSession(String clusterId)
          Get a known existingsession
 Map getSessionMap()
           
 int getSessions()
           
protected  void invalidateSessions()
           
protected  org.mortbay.terracotta.servlet.TerracottaSessionManager.Session newSession(HttpServletRequest request)
          Create a new session instance
protected  void removeSession(String clusterId)
           
 void run()
           
 void setScavengePeriodMs(long ms)
           
 
Methods inherited from class org.mortbay.jetty.servlet.AbstractSessionManager
access, addEventListener, addSession, clearEventListeners, complete, getClusterId, getHttpOnly, getHttpSession, getIdManager, getMaxCookieAge, getMaxInactiveInterval, getMaxSessions, getMetaManager, getMinSessions, getNodeId, getRefreshCookieAge, getSecureCookies, getSessionCookie, getSessionCookie, getSessionDomain, getSessionHandler, getSessionPath, getSessionURL, getSessionURLPrefix, isNodeIdInSessionId, isUsingCookies, isValid, newHttpSession, removeEventListener, removeSession, removeSession, resetStats, setHttpOnly, setIdManager, setMaxCookieAge, setMaxInactiveInterval, setMetaManager, setNodeIdInSessionId, setRefreshCookieAge, setSecureCookies, setSessionCookie, setSessionDomain, setSessionHandler, setSessionPath, setSessionURL, setUsingCookies
 
Methods inherited from class org.mortbay.component.AbstractLifeCycle
addLifeCycleListener, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.mortbay.component.LifeCycle
addLifeCycleListener, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop
 

Constructor Detail

TerracottaSessionManager

public TerracottaSessionManager()
Method Detail

doStart

public void doStart()
             throws Exception
Overrides:
doStart in class AbstractSessionManager
Throws:
Exception

doStop

public void doStop()
            throws Exception
Overrides:
doStop in class AbstractSessionManager
Throws:
Exception

run

public void run()
Specified by:
run in interface Runnable

addSession

protected void addSession(AbstractSessionManager.Session session)
Specified by:
addSession in class AbstractSessionManager

removeSession

protected void removeSession(String clusterId)
Specified by:
removeSession in class AbstractSessionManager

setScavengePeriodMs

public void setScavengePeriodMs(long ms)

getScavengePeriodMs

public long getScavengePeriodMs()

getSession

public AbstractSessionManager.Session getSession(String clusterId)
Description copied from class: AbstractSessionManager
Get a known existingsession

Specified by:
getSession in class AbstractSessionManager
Parameters:
clusterId - The session ID in the cluster, stripped of any worker name.
Returns:
A Session or null if none exists.

getSessionMap

public Map getSessionMap()
Specified by:
getSessionMap in class AbstractSessionManager

getSessions

public int getSessions()
Specified by:
getSessions in class AbstractSessionManager

newSession

protected org.mortbay.terracotta.servlet.TerracottaSessionManager.Session newSession(HttpServletRequest request)
Description copied from class: AbstractSessionManager
Create a new session instance

Specified by:
newSession in class AbstractSessionManager
Returns:

invalidateSessions

protected void invalidateSessions()
Specified by:
invalidateSessions in class AbstractSessionManager


Copyright © 1995-2008 Mort Bay Consulting. All Rights Reserved.