public abstract class AbstractSessionManager extends java.lang.Object implements SessionManager
If the property org.mortbay.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 java.util.Random |
_random |
protected boolean |
_secureCookies |
protected java.util.ArrayList |
_sessionAttributeListeners |
protected java.util.ArrayList |
_sessionListeners |
protected java.util.Map |
_sessions |
protected boolean |
_weakRandom |
__MaxAge, __SessionCookie, __SessionDomain, __SessionPath, __SessionURL, __SessionUrlPrefix
Constructor and Description |
---|
AbstractSessionManager() |
AbstractSessionManager(java.util.Random random) |
Modifier and Type | Method and Description |
---|---|
void |
addEventListener(java.util.EventListener listener)
Add an event listener.
|
boolean |
getCrossContextSessionIDs() |
boolean |
getHttpOnly() |
HttpSession |
getHttpSession(java.lang.String id) |
int |
getMaxInactiveInterval() |
int |
getMaxSessions() |
int |
getMinSessions() |
java.util.Random |
getRandom() |
int |
getScavengePeriod() |
boolean |
getSecureCookies() |
Cookie |
getSessionCookie(HttpSession session,
boolean requestIsSecure)
Get a Cookie for a session.
|
java.util.Map |
getSessionMap() |
int |
getSessions() |
boolean |
getUseRequestedId()
Deprecated.
use getCrossContextSessionIDs
session IDs
|
java.lang.String |
getWorkerName()
Get the workname.
|
void |
initialize(ServletHandler handler) |
boolean |
isInvalidateGlobal() |
boolean |
isStarted() |
HttpSession |
newHttpSession(HttpServletRequest request) |
protected abstract AbstractSessionManager.Session |
newSession(HttpServletRequest request) |
void |
removeEventListener(java.util.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(java.util.Random random) |
void |
setScavengePeriod(int seconds) |
void |
setSecureCookies(boolean secureCookies) |
void |
setUseRequestedId(boolean useRequestedId)
Deprecated.
use setCrossContextSessionIDs
session IDs
|
void |
setWorkerName(java.lang.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 java.util.ArrayList _sessionListeners
protected transient java.util.ArrayList _sessionAttributeListeners
protected transient java.util.Map _sessions
protected transient java.util.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(java.util.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 java.util.Map getSessionMap()
public int getSessions()
public int getMinSessions()
public int getMaxSessions()
public void resetStats()
public HttpSession getHttpSession(java.lang.String id)
getHttpSession
in interface SessionManager
public HttpSession newHttpSession(HttpServletRequest request)
newHttpSession
in interface SessionManager
public Cookie getSessionCookie(HttpSession session, boolean requestIsSecure)
SessionManager
getSessionCookie
in interface SessionManager
protected abstract AbstractSessionManager.Session newSession(HttpServletRequest request)
public java.lang.String getWorkerName()
public void setWorkerName(java.lang.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(java.util.EventListener listener) throws java.lang.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,
HttpSessionListenerjava.lang.IllegalArgumentException
- If an unsupported listener
is passed.public void removeEventListener(java.util.EventListener listener)
removeEventListener
in interface SessionManager
public boolean isStarted()
public void start() throws java.lang.Exception
LifeCycle
public void stop()
LifeCycle
public java.util.Random getRandom()
public void setRandom(java.util.Random random)
Copyright © 2004 Mortbay Consulting Pty. Ltd. All Rights Reserved.