org.mortbay.jetty.servlet.wadi
Class WadiSessionManager
java.lang.Object
org.mortbay.component.AbstractLifeCycle
org.mortbay.jetty.servlet.AbstractSessionManager
org.mortbay.jetty.servlet.wadi.WadiSessionManager
- All Implemented Interfaces:
- LifeCycle, SessionManager
public class WadiSessionManager
- extends AbstractSessionManager
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 |
Constructor Summary |
WadiSessionManager(WadiCluster wadiCluster,
int numPartitions,
int sweepInterval)
|
WadiSessionManager(WadiCluster wadiCluster,
int nbReplica,
int numPartitions,
int sweepInterval)
|
WadiSessionManager(WadiCluster wadiCluster,
int nbReplica,
int numPartitions,
int sweepInterval,
boolean enableReplication,
boolean deltaReplication)
Constructs a session manager attached to the provided cluster. |
Methods inherited from class org.mortbay.jetty.servlet.AbstractSessionManager |
access, addEventListener, addSession, clearEventListeners, 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 java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
WadiSessionManager
public WadiSessionManager(WadiCluster wadiCluster,
int numPartitions,
int sweepInterval)
WadiSessionManager
public WadiSessionManager(WadiCluster wadiCluster,
int nbReplica,
int numPartitions,
int sweepInterval)
WadiSessionManager
public WadiSessionManager(WadiCluster wadiCluster,
int nbReplica,
int numPartitions,
int sweepInterval,
boolean enableReplication,
boolean deltaReplication)
- Constructs a session manager attached to the provided cluster.
- Parameters:
wadiCluster
- cluster this session manager is attached to.nbReplica
- number of replicas to be maintained for each sessions managed by this session manager. When a
session is created or updated, it is replicated to a configurable number of other nodes.numPartitions
- WADI maintains a distributed and indexed look-up map tracking HttpSession locations.
numPartitions is the number of indexes of this look-up map. A standard number of partitions is 24.sweepInterval
- number of seconds between the execution of HttpSession eviction policies. In other words,
it is how often HttpSessions are scanned to identify and invalidate timed out sessionsenableReplication
- if true, then sessions are replicated to other nodes. The number of replicas is
configured by nbReplica.
getSharedStore
public org.codehaus.wadi.core.store.Store getSharedStore()
setSharedStore
public void setSharedStore(org.codehaus.wadi.core.store.Store store)
doStart
public void doStart()
throws java.lang.Exception
- Overrides:
doStart
in class AbstractSessionManager
- Throws:
java.lang.Exception
doStop
public void doStop()
throws java.lang.Exception
- Overrides:
doStop
in class AbstractSessionManager
- Throws:
java.lang.Exception
getClusteredManager
public org.codehaus.wadi.core.manager.Manager getClusteredManager()
createSession
public WadiSession createSession(java.lang.String sessionId)
throws SessionAlreadyExistsException
- Throws:
SessionAlreadyExistsException
registerListener
public void registerListener(SessionListener listener)
unregisterListener
public void unregisterListener(SessionListener listener)
newSession
protected AbstractSessionManager.Session newSession(HttpServletRequest request)
- Description copied from class:
AbstractSessionManager
- Create a new session instance
- Specified by:
newSession
in class AbstractSessionManager
- Returns:
complete
public void complete(HttpSession session)
- Description copied from interface:
SessionManager
- Called by the
SessionHandler
when a reqeuest is not longer
handling a session. Not this includes new sessions, so there may not
be a matching call to #access(HttpSession)
.
- Specified by:
complete
in interface SessionManager
- Overrides:
complete
in class AbstractSessionManager
addSession
protected void addSession(AbstractSessionManager.Session session)
- Specified by:
addSession
in class AbstractSessionManager
removeSession
protected void removeSession(java.lang.String idInCluster)
- Specified by:
removeSession
in class AbstractSessionManager
getSession
public AbstractSessionManager.Session getSession(java.lang.String idInCluster)
- Description copied from class:
AbstractSessionManager
- Get a known existingsession
- Specified by:
getSession
in class AbstractSessionManager
- Parameters:
idInCluster
- The session ID in the cluster, stripped of any worker name.
- Returns:
- A Session or null if none exists.
getSessions
public int getSessions()
- Specified by:
getSessions
in class AbstractSessionManager
getSessionMap
public java.util.Map getSessionMap()
- Specified by:
getSessionMap
in class AbstractSessionManager
invalidateSessions
protected void invalidateSessions()
- Specified by:
invalidateSessions
in class AbstractSessionManager
Copyright © 1995-2009 Mort Bay Consulting. All Rights Reserved.