org.mortbay.terracotta.servlet
Class TerracottaSessionIdManager
java.lang.Object
org.mortbay.component.AbstractLifeCycle
org.mortbay.terracotta.servlet.TerracottaSessionIdManager
- All Implemented Interfaces:
- LifeCycle, SessionIdManager
public class TerracottaSessionIdManager
- extends AbstractLifeCycle
- implements SessionIdManager
A specialized SessionIdManager to be used with Terracotta.
See the TerracottaSessionManager
javadocs for implementation notes.
- See Also:
TerracottaSessionManager
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TerracottaSessionIdManager
public TerracottaSessionIdManager(Server server)
doStart
public void doStart()
- Overrides:
doStart
in class AbstractLifeCycle
doStop
public void doStop()
- Overrides:
doStop
in class AbstractLifeCycle
addSession
public void addSession(HttpSession session)
- Description copied from interface:
SessionIdManager
- Add a session to the list of known sessions for a given ID.
- Specified by:
addSession
in interface SessionIdManager
- Parameters:
session
- The session
getWorkerName
public String getWorkerName()
- Specified by:
getWorkerName
in interface SessionIdManager
setWorkerName
public void setWorkerName(String workerName)
idInUse
public boolean idInUse(String clusterId)
- Specified by:
idInUse
in interface SessionIdManager
- Parameters:
clusterId
- The session ID without any cluster node extension
- Returns:
- True if the session ID is in use by at least one context.
invalidateAll
public void invalidateAll(String clusterId)
- When told to invalidate all session instances that share the same id, we must
tell all contexts on the server for which it is defined to delete any session
object they might have matching the id.
- Specified by:
invalidateAll
in interface SessionIdManager
- Parameters:
clusterId
- The session ID without any cluster node extension
newSessionId
public String newSessionId(HttpServletRequest request,
long created)
- Specified by:
newSessionId
in interface SessionIdManager
- Returns:
removeSession
public void removeSession(HttpSession session)
- Description copied from interface:
SessionIdManager
- Remove session from the list of known sessions for a given ID.
- Specified by:
removeSession
in interface SessionIdManager
getClusterId
public String getClusterId(String nodeId)
- Description copied from interface:
SessionIdManager
- Get a cluster ID from a node ID.
Strip node identifier from a located session ID.
- Specified by:
getClusterId
in interface SessionIdManager
- Returns:
getNodeId
public String getNodeId(String clusterId,
HttpServletRequest request)
- Description copied from interface:
SessionIdManager
- Get a node ID from a cluster ID and a request
- Specified by:
getNodeId
in interface SessionIdManager
- Parameters:
clusterId
- The ID of the sessionrequest
- The request that for the session (or null)
- Returns:
- The session ID qualified with the node ID.
Copyright © 1995-2009 Mort Bay Consulting. All Rights Reserved.