|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.openqa.jetty.jetty.servlet.AbstractSessionManager
public abstract class AbstractSessionManager
An Abstract implementation of SessionManager. The partial implementation of SessionManager interface provides the majority of the handling required to implement a SessionManager. Concrete implementations of SessionManager based on AbstractSessionManager need only implement the newSession method to return a specialized version of the Session inner class that provides an attribute Map.
If the property org.openqa.jetty.jetty.servlet.AbstractSessionManager.23Notifications is set to true, the 2.3 servlet spec notification style will be used.
Nested Class Summary | |
---|---|
class |
AbstractSessionManager.Session
|
Field Summary | |
---|---|
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
|
Fields inherited from interface org.openqa.jetty.jetty.servlet.SessionManager |
---|
__MaxAge, __SessionCookie, __SessionDomain, __SessionPath, __SessionURL, __SessionUrlPrefix |
Constructor Summary | |
---|---|
AbstractSessionManager()
|
|
AbstractSessionManager(Random random)
|
Method Summary | |
---|---|
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
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
Constructor Detail |
---|
public AbstractSessionManager()
public AbstractSessionManager(Random random)
Method Detail |
---|
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,
HttpSessionListener
IllegalArgumentException
- If an unsupported listener
is passed.public void removeEventListener(EventListener listener)
removeEventListener
in interface SessionManager
public boolean isStarted()
isStarted
in interface LifeCycle
public void start() throws Exception
LifeCycle
start
in interface LifeCycle
Exception
- An arbitrary exception may be thrown.public void stop()
LifeCycle
stop
in interface LifeCycle
public Random getRandom()
public void setRandom(Random random)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |