org.eclipse.jetty.server.session
Class AbstractSessionIdManager
java.lang.Object
org.eclipse.jetty.util.component.AbstractLifeCycle
org.eclipse.jetty.server.session.AbstractSessionIdManager
- All Implemented Interfaces:
- SessionIdManager, LifeCycle
- Direct Known Subclasses:
- HashSessionIdManager, JDBCSessionIdManager
public abstract class AbstractSessionIdManager
- extends AbstractLifeCycle
- implements SessionIdManager
Methods inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle |
addLifeCycleListener, getState, getState, 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 |
_random
protected Random _random
_weakRandom
protected boolean _weakRandom
_workerName
protected String _workerName
AbstractSessionIdManager
public AbstractSessionIdManager()
AbstractSessionIdManager
public AbstractSessionIdManager(Random random)
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.
- Specified by:
getWorkerName
in interface SessionIdManager
- 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
-
getRandom
public Random getRandom()
setRandom
public void setRandom(Random random)
newSessionId
public String newSessionId(HttpServletRequest request,
long created)
- Create a new session id if necessary.
- Specified by:
newSessionId
in interface SessionIdManager
- Returns:
- the new session id
- See Also:
SessionIdManager.newSessionId(javax.servlet.http.HttpServletRequest, long)
doStart
protected void doStart()
throws Exception
- Overrides:
doStart
in class AbstractLifeCycle
- Throws:
Exception
doStop
protected void doStop()
throws Exception
- Overrides:
doStop
in class AbstractLifeCycle
- Throws:
Exception
initRandom
public void initRandom()
- Set up a random number generator for the sessionids.
By preference, use a SecureRandom but allow to be injected.
Copyright © 1995-2011 Mort Bay Consulting. All Rights Reserved.