|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.mortbay.component.AbstractLifeCycle
org.mortbay.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.mortbay.jetty.servlet.AbstractSessionManager.23Notifications is set to true, the 2.3 servlet spec notification style will be used.
| Nested Class Summary | |
|---|---|
static class |
AbstractSessionManager.NullSessionContext
Null returning implementation of HttpSessionContext |
class |
AbstractSessionManager.Session
Implements HttpSession from the javax.servlet package. |
| Field Summary | |
|---|---|
static int |
__distantFuture
|
protected ContextHandler.SContext |
_context
|
protected int |
_dftMaxIdleSecs
|
protected boolean |
_httpOnly
|
protected ClassLoader |
_loader
|
protected int |
_maxCookieAge
|
protected int |
_maxSessions
|
protected int |
_minSessions
|
protected int |
_refreshCookieAge
|
protected boolean |
_secureCookies
|
protected Object |
_sessionAttributeListeners
|
protected String |
_sessionCookie
|
protected String |
_sessionDomain
|
protected SessionHandler |
_sessionHandler
|
protected SessionIdManager |
_sessionIdManager
|
protected Object |
_sessionListeners
|
protected String |
_sessionPath
|
protected String |
_sessionURL
|
protected String |
_sessionURLPrefix
|
| Fields inherited from interface org.mortbay.jetty.SessionManager |
|---|
__DefaultSessionCookie, __DefaultSessionDomain, __DefaultSessionURL, __MaxAgeProperty, __SessionCookieProperty, __SessionDomainProperty, __SessionPathProperty, __SessionURLProperty |
| Constructor Summary | |
|---|---|
AbstractSessionManager()
|
|
| Method Summary | |
|---|---|
Cookie |
access(HttpSession session)
Called by the SessionHandler when a session is access by a request |
void |
addEventListener(EventListener listener)
Add an event listener. |
protected abstract void |
addSession(AbstractSessionManager.Session session)
|
protected void |
addSession(AbstractSessionManager.Session session,
boolean created)
Add the session Registers the session with this manager and registers the session ID with the sessionIDManager; |
void |
clearEventListeners()
|
void |
complete(HttpSession session)
Called by the SessionHandler when a reqeuest is not longer
handling a session. |
void |
doStart()
|
void |
doStop()
|
boolean |
getHttpOnly()
|
HttpSession |
getHttpSession(String id)
|
SessionIdManager |
getIdManager()
|
int |
getMaxCookieAge()
|
int |
getMaxInactiveInterval()
|
int |
getMaxSessions()
|
SessionIdManager |
getMetaManager()
Deprecated. use getIdManager() |
int |
getMinSessions()
|
int |
getRefreshCookieAge()
|
boolean |
getSecureCookies()
|
protected abstract AbstractSessionManager.Session |
getSession(String idInCluster)
Get a known existingsession |
String |
getSessionCookie()
|
Cookie |
getSessionCookie(HttpSession session,
String contextPath,
boolean requestIsSecure)
Get a Cookie for a session. |
String |
getSessionDomain()
|
SessionHandler |
getSessionHandler()
|
abstract Map |
getSessionMap()
|
String |
getSessionPath()
|
abstract int |
getSessions()
|
String |
getSessionURL()
|
String |
getSessionURLPrefix()
|
protected abstract void |
invalidateSessions()
|
boolean |
isUsingCookies()
|
boolean |
isValid(HttpSession session)
|
HttpSession |
newHttpSession(HttpServletRequest request)
Create a new HttpSession for a request |
protected abstract AbstractSessionManager.Session |
newSession(HttpServletRequest request)
Create a new session instance |
protected void |
newSessionMap()
|
void |
removeEventListener(EventListener listener)
|
protected void |
removeSession(AbstractSessionManager.Session session,
boolean invalidate)
Remove session from manager |
protected abstract void |
removeSession(String idInCluster)
|
void |
resetStats()
|
void |
setHttpOnly(boolean httpOnly)
|
void |
setIdManager(SessionIdManager metaManager)
|
void |
setMaxCookieAge(int maxCookieAgeInSeconds)
|
void |
setMaxInactiveInterval(int seconds)
|
void |
setMetaManager(SessionIdManager metaManager)
Deprecated. use setIdManager(SessionIdManager) |
void |
setRefreshCookieAge(int ageInSeconds)
|
void |
setSecureCookies(boolean secureCookies)
|
void |
setSessionCookie(String cookieName)
|
void |
setSessionDomain(String domain)
|
void |
setSessionHandler(SessionHandler sessionHandler)
|
void |
setSessionPath(String path)
|
void |
setSessionURL(String url)
|
void |
setUsingCookies(boolean usingCookies)
|
| Methods inherited from class org.mortbay.component.AbstractLifeCycle |
|---|
isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, start, stop |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.mortbay.component.LifeCycle |
|---|
isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, start, stop |
| Field Detail |
|---|
public static final int __distantFuture
protected int _dftMaxIdleSecs
protected SessionHandler _sessionHandler
protected boolean _httpOnly
protected int _maxSessions
protected int _minSessions
protected SessionIdManager _sessionIdManager
protected boolean _secureCookies
protected Object _sessionAttributeListeners
protected Object _sessionListeners
protected ClassLoader _loader
protected ContextHandler.SContext _context
protected String _sessionCookie
protected String _sessionURL
protected String _sessionURLPrefix
protected String _sessionDomain
protected String _sessionPath
protected int _maxCookieAge
protected int _refreshCookieAge
| Constructor Detail |
|---|
public AbstractSessionManager()
| Method Detail |
|---|
public Cookie access(HttpSession session)
SessionManagerSessionHandler when a session is access by a request
access in interface SessionManagerpublic void addEventListener(EventListener listener)
SessionManager
addEventListener in interface SessionManagerlistener - An Event Listener. Individual SessionManagers
implemetations may accept arbitrary listener types, but they
are expected to at least handle
HttpSessionActivationListener,
HttpSessionAttributeListener,
HttpSessionBindingListener,
HttpSessionListenerpublic void clearEventListeners()
clearEventListeners in interface SessionManagerpublic void complete(HttpSession session)
SessionManagerSessionHandler when a reqeuest is not longer
handling a session. Not this includes new sessions, so there may not
be a matching call to SessionManager.access(HttpSession).
complete in interface SessionManager
public void doStart()
throws Exception
doStart in class AbstractLifeCycleException
public void doStop()
throws Exception
doStop in class AbstractLifeCycleExceptionpublic boolean getHttpOnly()
getHttpOnly in interface SessionManagerpublic HttpSession getHttpSession(String id)
getHttpSession in interface SessionManagerpublic SessionIdManager getIdManager()
public int getMaxCookieAge()
getMaxCookieAge in interface SessionManagerpublic int getMaxInactiveInterval()
getMaxInactiveInterval in interface SessionManagerpublic int getMaxSessions()
public SessionIdManager getMetaManager()
getIdManager()
getMetaManager in interface SessionManagerpublic int getMinSessions()
public int getRefreshCookieAge()
public boolean getSecureCookies()
getSecureCookies in interface SessionManagerpublic String getSessionCookie()
getSessionCookie in interface SessionManager
public Cookie getSessionCookie(HttpSession session,
String contextPath,
boolean requestIsSecure)
SessionManager
getSessionCookie in interface SessionManagersession - The session to which the cookie should refer.contextPath - The context to which the cookie should be linked. The client will only send the cookie value
when requesting resources under this path.requestIsSecure - Whether the client is accessing the server over a secure protocol (i.e. HTTPS).
SessionManager uses cookies, then this method will return a new
cookie object that should be set on the client in order to link future HTTP requests
with the session. If cookies are not in use, this method returns null.public String getSessionDomain()
getSessionDomain in interface SessionManagerpublic SessionHandler getSessionHandler()
public abstract Map getSessionMap()
public String getSessionPath()
getSessionPath in interface SessionManagerpublic abstract int getSessions()
public String getSessionURL()
getSessionURL in interface SessionManagerpublic String getSessionURLPrefix()
getSessionURLPrefix in interface SessionManagerpublic boolean isUsingCookies()
public boolean isValid(HttpSession session)
isValid in interface SessionManagerpublic HttpSession newHttpSession(HttpServletRequest request)
newHttpSession in interface SessionManagerpublic void removeEventListener(EventListener listener)
removeEventListener in interface SessionManagerpublic void resetStats()
public void setHttpOnly(boolean httpOnly)
httpOnly - The httpOnly to set.public void setIdManager(SessionIdManager metaManager)
setIdManager in interface SessionManagermetaManager - The metaManager used for cross context session management.public void setMaxCookieAge(int maxCookieAgeInSeconds)
setMaxCookieAge in interface SessionManagerpublic void setMaxInactiveInterval(int seconds)
setMaxInactiveInterval in interface SessionManagerseconds - public void setMetaManager(SessionIdManager metaManager)
setIdManager(SessionIdManager)
public void setRefreshCookieAge(int ageInSeconds)
public void setSecureCookies(boolean secureCookies)
secureCookies - The secureCookies to set.public void setSessionCookie(String cookieName)
setSessionCookie in interface SessionManagerpublic void setSessionDomain(String domain)
setSessionDomain in interface SessionManagerpublic void setSessionHandler(SessionHandler sessionHandler)
setSessionHandler in interface SessionManagersessionHandler - The sessionHandler to set.public void setSessionPath(String path)
setSessionPath in interface SessionManagerpublic void setSessionURL(String url)
setSessionURL in interface SessionManagerpublic void setUsingCookies(boolean usingCookies)
usingCookies - The usingCookies to set.protected abstract void addSession(AbstractSessionManager.Session session)
protected void addSession(AbstractSessionManager.Session session,
boolean created)
protected abstract AbstractSessionManager.Session getSession(String idInCluster)
idInCluster - The session ID in the cluster, stripped of any worker name.
protected abstract void invalidateSessions()
protected abstract AbstractSessionManager.Session newSession(HttpServletRequest request)
request -
protected final void newSessionMap()
protected void removeSession(AbstractSessionManager.Session session,
boolean invalidate)
session - The session to removeinvalidate - True if HttpSessionListener#sessionDestroyed(HttpSessionEvent) and
SessionIdManager.invalidateAll(String) should be called.protected abstract void removeSession(String idInCluster)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||