org.mortbay.jetty.servlet
Class HashSessionIdManager

java.lang.Object
  extended byorg.mortbay.component.AbstractLifeCycle
      extended byorg.mortbay.jetty.servlet.HashSessionIdManager
All Implemented Interfaces:
LifeCycle, SessionIdManager

public class HashSessionIdManager
extends AbstractLifeCycle
implements SessionIdManager

HashSessionIdManager. An in-memory implementation of the session ID manager.


Field Summary
protected  Random _random
           
 
Constructor Summary
HashSessionIdManager()
           
HashSessionIdManager(Random random)
           
 
Method Summary
 void addSession(HttpSession session)
           
protected  void doStart()
           
protected  void doStop()
           
 String getWorkerName()
          Get the workname.
 boolean idInUse(String id)
           
 void invalidateAll(String id)
           
 String newSessionId(HttpServletRequest request, long created)
           
 void setWorkerName(String workerName)
          Set the workname.
 
Methods inherited from class org.mortbay.component.AbstractLifeCycle
isFailed, isRunning, isStarted, isStarting, isStopping, 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
isFailed, isRunning, isStarted, isStarting, isStopping, start, stop
 

Field Detail

_random

protected Random _random
Constructor Detail

HashSessionIdManager

public HashSessionIdManager()

HashSessionIdManager

public HashSessionIdManager(Random random)
Method Detail

getWorkerName

public String getWorkerName()
Get the workname. If set, the workername is dot appended to the session ID and can be used to assist session affinity in a load balancer.

Returns:
String or null

setWorkerName

public void setWorkerName(String workerName)
Set the workname. If set, the workername is dot appended to the session ID and can be used to assist session affinity in a load balancer.

Parameters:
workerName -

doStart

protected void doStart()
Overrides:
doStart in class AbstractLifeCycle

doStop

protected void doStop()
Overrides:
doStop in class AbstractLifeCycle

idInUse

public boolean idInUse(String id)
Specified by:
idInUse in interface SessionIdManager

addSession

public void addSession(HttpSession session)
Specified by:
addSession in interface SessionIdManager

invalidateAll

public void invalidateAll(String id)
Specified by:
invalidateAll in interface SessionIdManager

newSessionId

public String newSessionId(HttpServletRequest request,
                           long created)
Specified by:
newSessionId in interface SessionIdManager