|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.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 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
|
Fields inherited from interface org.openqa.jetty.jetty.servlet.SessionManager |
---|
__MaxAge, __SessionCookie, __SessionDomain, __SessionPath, __SessionURL, __SessionUrlPrefix |
Constructor Summary | |
---|---|
AbstractSessionManager()
|
|
AbstractSessionManager(java.util.Random random)
|
Method Summary | |
---|---|
void |
addEventListener(java.util.EventListener listener)
Add an event listener. |
boolean |
getCrossContextSessionIDs()
|
boolean |
getHttpOnly()
|
javax.servlet.http.HttpSession |
getHttpSession(java.lang.String id)
|
int |
getMaxInactiveInterval()
|
int |
getMaxSessions()
|
int |
getMinSessions()
|
java.util.Random |
getRandom()
|
int |
getScavengePeriod()
|
boolean |
getSecureCookies()
|
javax.servlet.http.Cookie |
getSessionCookie(javax.servlet.http.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()
|
javax.servlet.http.HttpSession |
newHttpSession(javax.servlet.http.HttpServletRequest request)
|
protected abstract AbstractSessionManager.Session |
newSession(javax.servlet.http.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. |
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 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
Constructor Detail |
---|
public AbstractSessionManager()
public AbstractSessionManager(java.util.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 java.util.Map getSessionMap()
public int getSessions()
public int getMinSessions()
public int getMaxSessions()
public void resetStats()
public javax.servlet.http.HttpSession getHttpSession(java.lang.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 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,
HttpSessionListener
java.lang.IllegalArgumentException
- If an unsupported listener
is passed.public void removeEventListener(java.util.EventListener listener)
removeEventListener
in interface SessionManager
public boolean isStarted()
isStarted
in interface LifeCycle
public void start() throws java.lang.Exception
LifeCycle
start
in interface LifeCycle
java.lang.Exception
- An arbitrary exception may be thrown.public void stop()
LifeCycle
stop
in interface LifeCycle
public java.util.Random getRandom()
public void setRandom(java.util.Random random)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |