public abstract class AbstractSessionManager extends Object implements SessionManager
If the property org.openqa.jetty.jetty.servlet.AbstractSessionManager.23Notifications is set to true, the 2.3 servlet spec notification style will be used.
Modifier and Type | Class and Description |
---|---|
class |
AbstractSessionManager.Session |
Modifier and Type | Field and Description |
---|---|
protected static MultiMap |
__allSessions |
static int |
__distantFuture |
protected boolean |
_crossContextSessionIDs |
protected ServletHandler |
_handler |
protected boolean |
_httpOnly |
protected boolean |
_invalidateGlobal |
protected int |
_maxSessions |
protected int |
_minSessions |
protected Random |
_random |
protected boolean |
_secureCookies |
protected ArrayList |
_sessionAttributeListeners |
protected ArrayList |
_sessionListeners |
protected Map |
_sessions |
protected boolean |
_weakRandom |
__MaxAge, __SessionCookie, __SessionDomain, __SessionPath, __SessionURL, __SessionUrlPrefix
Constructor and Description |
---|
AbstractSessionManager() |
AbstractSessionManager(Random random) |
Modifier and Type | Method and Description |
---|---|
void |
addEventListener(EventListener listener)
Add an event listener.
|
boolean |
getCrossContextSessionIDs() |
boolean |
getHttpOnly() |
javax.servlet.http.HttpSession |
getHttpSession(String id) |
int |
getMaxInactiveInterval() |
int |
getMaxSessions() |
int |
getMinSessions() |
Random |
getRandom() |
int |
getScavengePeriod() |
boolean |
getSecureCookies() |
javax.servlet.http.Cookie |
getSessionCookie(javax.servlet.http.HttpSession session,
boolean requestIsSecure)
Get a Cookie for a session.
|
Map |
getSessionMap() |
int |
getSessions() |
boolean |
getUseRequestedId()
Deprecated.
use getCrossContextSessionIDs
session IDs
|
String |
getWorkerName()
Get the workname.
|
void |
initialize(ServletHandler handler) |
boolean |
isInvalidateGlobal() |
boolean |
isStarted() |
javax.servlet.http.HttpSession |
newHttpSession(javax.servlet.http.HttpServletRequest request) |
protected abstract AbstractSessionManager.Session |
newSession(javax.servlet.http.HttpServletRequest request) |
void |
removeEventListener(EventListener listener) |
void |
resetStats() |
void |
setCrossContextSessionIDs(boolean useRequestedId)
Set Cross Context sessions IDs
This option activates a mode where a requested session ID can be used to create a
new session.
|
void |
setHttpOnly(boolean httpOnly) |
void |
setInvalidateGlobal(boolean global) |
void |
setMaxInactiveInterval(int seconds) |
void |
setRandom(Random random) |
void |
setScavengePeriod(int seconds) |
void |
setSecureCookies(boolean secureCookies) |
void |
setUseRequestedId(boolean useRequestedId)
Deprecated.
use setCrossContextSessionIDs
session IDs
|
void |
setWorkerName(String workerName)
Set the workname.
|
void |
start()
Start the LifeCycle.
|
void |
stop()
Stop the LifeCycle.
|
public static final int __distantFuture
protected static MultiMap __allSessions
protected transient ArrayList _sessionListeners
protected transient ArrayList _sessionAttributeListeners
protected transient Map _sessions
protected transient Random _random
protected transient boolean _weakRandom
protected transient ServletHandler _handler
protected int _minSessions
protected int _maxSessions
protected boolean _crossContextSessionIDs
protected boolean _secureCookies
protected boolean _httpOnly
protected boolean _invalidateGlobal
public AbstractSessionManager()
public AbstractSessionManager(Random random)
public boolean getUseRequestedId()
public void setUseRequestedId(boolean useRequestedId)
useRequestedId
- True if requested session ID are first considered for newpublic boolean getCrossContextSessionIDs()
public void setCrossContextSessionIDs(boolean useRequestedId)
useRequestedId
- True if cross context session ID are first considered for new
session IDspublic void initialize(ServletHandler handler)
initialize
in interface SessionManager
public Map getSessionMap()
public int getSessions()
public int getMinSessions()
public int getMaxSessions()
public void resetStats()
public javax.servlet.http.HttpSession getHttpSession(String id)
getHttpSession
in interface SessionManager
public javax.servlet.http.HttpSession newHttpSession(javax.servlet.http.HttpServletRequest request)
newHttpSession
in interface SessionManager
public javax.servlet.http.Cookie getSessionCookie(javax.servlet.http.HttpSession session, boolean requestIsSecure)
SessionManager
getSessionCookie
in interface SessionManager
protected abstract AbstractSessionManager.Session newSession(javax.servlet.http.HttpServletRequest request)
public String getWorkerName()
public void setWorkerName(String workerName)
workerName
- public int getMaxInactiveInterval()
getMaxInactiveInterval
in interface SessionManager
public void setMaxInactiveInterval(int seconds)
setMaxInactiveInterval
in interface SessionManager
seconds
- public int getScavengePeriod()
public void setScavengePeriod(int seconds)
seconds
- public boolean getHttpOnly()
getHttpOnly
in interface SessionManager
public void setHttpOnly(boolean httpOnly)
httpOnly
- The httpOnly to set.public boolean getSecureCookies()
getSecureCookies
in interface SessionManager
public void setSecureCookies(boolean secureCookies)
secureCookies
- The secureCookies to set.public boolean isInvalidateGlobal()
public void setInvalidateGlobal(boolean global)
global
- True if session invalidation should be global.
ie Sessions in other contexts with the same ID (linked by cross context dispatch
or shared session cookie) are invalidated as a group.public void addEventListener(EventListener listener) throws IllegalArgumentException
SessionManager
addEventListener
in interface SessionManager
listener
- An Event Listener. Individual SessionManagers
implemetations may accept arbitrary listener types, but they
are expected to at least handle
HttpSessionActivationListener,
HttpSessionAttributeListener,
HttpSessionBindingListener,
HttpSessionListenerIllegalArgumentException
- If an unsupported listener
is passed.public void removeEventListener(EventListener listener)
removeEventListener
in interface SessionManager
public boolean isStarted()
public void start() throws Exception
LifeCycle
public void stop()
LifeCycle
public Random getRandom()
public void setRandom(Random random)
Copyright © 2013. All Rights Reserved.