public class JDBCSessionManager extends AbstractSessionManager
Modifier and Type | Class and Description |
---|---|
protected class |
JDBCSessionManager.ClassLoadingObjectInputStream
ClassLoadingObjectInputStream
|
class |
JDBCSessionManager.Session
Session
Session instance in memory of this node.
|
class |
JDBCSessionManager.SessionData
SessionData
Persistable data about a session.
|
AbstractSessionManager.SessionIf
AbstractLifeCycle.AbstractLifeCycleListener
LifeCycle.Listener
Modifier and Type | Field and Description |
---|---|
protected JDBCSessionIdManager |
_jdbcSessionIdMgr |
protected long |
_saveIntervalSec |
__defaultSessionTrackingModes, __distantFuture, _checkingRemoteSessionIdEncoding, _context, _dftMaxIdleSecs, _httpOnly, _loader, _maxCookieAge, _nodeIdInSessionId, _refreshCookieAge, _secureCookies, _secureRequestOnly, _sessionAttributeListeners, _sessionComment, _sessionCookie, _sessionDomain, _sessionHandler, _sessionIdManager, _sessionIdPathParameterName, _sessionIdPathParameterNamePrefix, _sessionListeners, _sessionPath, _sessionsStats, _sessionTimeStats, _sessionTrackingModes, SESSION_KNOWN_ONLY_TO_AUTHENTICATED
_listeners, FAILED, RUNNING, STARTED, STARTING, STOPPED, STOPPING
__CheckRemoteSessionEncoding, __DefaultSessionCookie, __DefaultSessionDomain, __DefaultSessionIdPathParameterName, __MaxAgeProperty, __SessionCookieProperty, __SessionDomainProperty, __SessionIdPathParameterNameProperty, __SessionPathProperty
Constructor and Description |
---|
JDBCSessionManager() |
Modifier and Type | Method and Description |
---|---|
protected void |
addSession(AbstractSession session)
Add a newly created session to our in-memory list for this node and persist it.
|
void |
cacheInvalidate(JDBCSessionManager.Session session)
A method that can be implemented in subclasses to support
distributed caching of sessions.
|
protected void |
deleteSession(JDBCSessionManager.SessionData data)
Delete a session from the database.
|
void |
doStart()
Start the session manager.
|
void |
doStop()
Stop the session manager.
|
protected void |
expire(List<?> sessionIds)
Expire any Sessions we have in memory matching the list of
expired Session ids.
|
long |
getSaveInterval() |
JDBCSessionManager.Session |
getSession(String idInCluster)
A session has been requested by it's id on this node.
|
int |
getSessions()
Get the number of sessions.
|
protected void |
invalidateSession(String idInCluster)
Invalidate a session.
|
protected void |
invalidateSessions() |
protected JDBCSessionManager.SessionData |
loadSession(String id,
String canonicalContextPath,
String vhost)
Load a session from the database
|
protected AbstractSession |
newSession(javax.servlet.http.HttpServletRequest request)
Make a new Session.
|
void |
removeSession(AbstractSession session,
boolean invalidate)
Remove session from manager
|
protected boolean |
removeSession(String idInCluster)
Delete an existing session, both from the in-memory map and
the database.
|
void |
setSaveInterval(long sec)
Set the time in seconds which is the interval between
saving the session access time to the database.
|
protected void |
storeSession(JDBCSessionManager.SessionData data)
Insert a session into the database.
|
protected void |
updateSession(JDBCSessionManager.SessionData data)
Update data on an existing persisted session.
|
protected void |
updateSessionNode(JDBCSessionManager.SessionData data)
Update the node on which the session was last seen to be my node.
|
access, addEventListener, addSession, clearEventListeners, complete, doSessionAttributeListeners, getClusterId, getContext, getContextHandler, getDefaultSessionTrackingModes, getEffectiveSessionTrackingModes, getHttpOnly, getHttpSession, getIdManager, getMaxCookieAge, getMaxInactiveInterval, getMaxSessions, getMetaManager, getMinSessions, getNodeId, getRefreshCookieAge, getSecureCookies, getSessionCookie, getSessionCookie, getSessionCookieConfig, getSessionDomain, getSessionHandler, getSessionIdManager, getSessionIdPathParameterName, getSessionIdPathParameterNamePrefix, getSessionMap, getSessionPath, getSessionsMax, getSessionsTotal, getSessionTimeMax, getSessionTimeMean, getSessionTimeStdDev, getSessionTimeTotal, isCheckingRemoteSessionIdEncoding, isNodeIdInSessionId, isSecureRequestOnly, isUsingCookies, isUsingURLs, isValid, newHttpSession, removeEventListener, removeSession, renewSession, resetStats, setCheckingRemoteSessionIdEncoding, setHttpOnly, setIdManager, setMaxInactiveInterval, setNodeIdInSessionId, setRefreshCookieAge, setSecureRequestOnly, setSessionCookie, setSessionHandler, setSessionIdManager, setSessionIdPathParameterName, setSessionTrackingModes, setUsingCookies, statsReset
addLifeCycleListener, getState, getState, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addLifeCycleListener, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop
protected JDBCSessionIdManager _jdbcSessionIdMgr
protected long _saveIntervalSec
public void setSaveInterval(long sec)
sec
- public long getSaveInterval()
public void cacheInvalidate(JDBCSessionManager.Session session)
session
- public JDBCSessionManager.Session getSession(String idInCluster)
getSession
in class AbstractSessionManager
idInCluster
- The session ID in the cluster, stripped of any worker name.AbstractSessionManager.getSession(java.lang.String)
public int getSessions()
getSessions
in class AbstractSessionManager
AbstractSessionManager.getSessions()
public void doStart() throws Exception
doStart
in class AbstractSessionManager
Exception
AbstractSessionManager.doStart()
public void doStop() throws Exception
doStop
in class AbstractSessionManager
Exception
AbstractSessionManager.doStop()
protected void invalidateSessions()
invalidateSessions
in class AbstractSessionManager
protected void invalidateSession(String idInCluster)
idInCluster
- protected boolean removeSession(String idInCluster)
removeSession
in class AbstractSessionManager
AbstractSessionManager.removeSession(java.lang.String)
protected void addSession(AbstractSession session)
addSession
in class AbstractSessionManager
AbstractSessionManager.addSession(org.eclipse.jetty.server.session.AbstractSession)
protected AbstractSession newSession(javax.servlet.http.HttpServletRequest request)
newSession
in class AbstractSessionManager
AbstractSessionManager.newSession(javax.servlet.http.HttpServletRequest)
public void removeSession(AbstractSession session, boolean invalidate)
removeSession
in class AbstractSessionManager
session
- The session to removeinvalidate
- True if HttpSessionListener.sessionDestroyed(HttpSessionEvent)
and
SessionIdManager.invalidateAll(String)
should be called.protected void expire(List<?> sessionIds)
sessionIds
- protected JDBCSessionManager.SessionData loadSession(String id, String canonicalContextPath, String vhost) throws Exception
id
- Exception
protected void storeSession(JDBCSessionManager.SessionData data) throws Exception
data
- Exception
protected void updateSession(JDBCSessionManager.SessionData data) throws Exception
data
- Exception
protected void updateSessionNode(JDBCSessionManager.SessionData data) throws Exception
data
- Exception
protected void deleteSession(JDBCSessionManager.SessionData data) throws Exception
data
- Exception
Copyright © 1995-2013 Mort Bay Consulting. All Rights Reserved.