public abstract class NoSqlSessionManager extends AbstractSessionManager implements SessionManager
AbstractSessionManager.CookieConfig, AbstractSessionManager.SessionIf
AbstractLifeCycle.AbstractLifeCycleListener
LifeCycle.Listener
Container.InheritedListener, Container.Listener
Modifier and Type | Field and Description |
---|---|
protected ConcurrentMap<String,NoSqlSession> |
_sessions |
__defaultSessionTrackingModes, __distantFuture, _checkingRemoteSessionIdEncoding, _context, _dftMaxIdleSecs, _httpOnly, _loader, _maxCookieAge, _nodeIdInSessionId, _refreshCookieAge, _secureCookies, _secureRequestOnly, _sessionAttributeListeners, _sessionComment, _sessionCookie, _sessionDomain, _sessionHandler, _sessionIdListeners, _sessionIdManager, _sessionIdPathParameterName, _sessionIdPathParameterNamePrefix, _sessionListeners, _sessionPath, _sessionsStats, _sessionTimeStats, _sessionTrackingModes
FAILED, RUNNING, STARTED, STARTING, STOPPED, STOPPING
__CheckRemoteSessionEncoding, __DefaultSessionCookie, __DefaultSessionDomain, __DefaultSessionIdPathParameterName, __MaxAgeProperty, __SessionCookieProperty, __SessionDomainProperty, __SessionIdPathParameterNameProperty, __SessionPathProperty
Constructor and Description |
---|
NoSqlSessionManager() |
Modifier and Type | Method and Description |
---|---|
protected void |
addSession(AbstractSession session) |
void |
doStart()
Starts the managed lifecycle beans in the order they were added.
|
protected void |
expire(String idInCluster) |
int |
getIdlePeriod()
The Idle Period is the time in seconds before an in memory session is passivated.
|
int |
getSavePeriod()
The Save Period is the time in seconds between saves of a dirty session to the DB.
|
AbstractSession |
getSession(String idInCluster)
Get a known existing session
|
int |
getStalePeriod()
The State Period is the maximum time in seconds that an in memory session is allows to be stale:
If this period is exceeded, the DB will be checked to see if a more recent version is available.
If the state period is set to a value < 0, then no staleness check will be made.
If the state period is set to 0, then a staleness check is made whenever the active request count goes from 0 to 1.
|
void |
invalidateSession(String idInCluster) |
boolean |
isInvalidateOnStop()
Invalidate sessions when the session manager is stopped otherwise save them to the DB.
|
boolean |
isPreserveOnStop()
Preserve sessions when the session manager is stopped otherwise remove them from the DB.
|
boolean |
isSaveAllAttributes()
Save all attributes of a session or only update the dirty attributes.
|
protected abstract NoSqlSession |
loadSession(String clusterId) |
protected AbstractSession |
newSession(HttpServletRequest request)
Create a new session instance
|
protected abstract Object |
refresh(NoSqlSession session,
Object version) |
protected abstract boolean |
remove(NoSqlSession session) |
protected boolean |
removeSession(String idInCluster)
Remove the session from the in-memory list for this context.
|
void |
renewSessionId(String oldClusterId,
String oldNodeId,
String newClusterId,
String newNodeId)
Tell the HttpSessionIdListeners the id changed.
|
protected abstract Object |
save(NoSqlSession session,
Object version,
boolean activateAfterSave) |
void |
setIdlePeriod(int idlePeriod)
The Idle Period is the time in seconds before an in memory session is passivated.
|
void |
setInvalidateOnStop(boolean invalidateOnStop)
Invalidate sessions when the session manager is stopped otherwise save them to the DB.
|
void |
setPreserveOnStop(boolean preserveOnStop)
Preserve sessions when the session manager is stopped otherwise remove them from the DB.
|
void |
setSaveAllAttributes(boolean saveAllAttributes)
Save all attributes of a session or only update the dirty attributes.
|
void |
setSavePeriod(int savePeriod)
The Save Period is the time in seconds between saves of a dirty session to the DB.
|
void |
setStalePeriod(int stalePeriod)
The State Period is the maximum time in seconds that an in memory session is allows to be stale:
If this period is exceeded, the DB will be checked to see if a more recent version is available.
If the state period is set to a value < 0, then no staleness check will be made.
If the state period is set to 0, then a staleness check is made whenever the active request count goes from 0 to 1.
|
protected void |
shutdownSessions()
Prepare sessions for session manager shutdown
|
protected abstract void |
update(NoSqlSession session,
String newClusterId,
String newNodeId) |
access, addEventListener, addSession, clearEventListeners, complete, doSessionAttributeListeners, doStop, getClusterId, getContext, getContextHandler, getDefaultSessionTrackingModes, getEffectiveSessionTrackingModes, getHttpOnly, getHttpSession, getMaxCookieAge, getMaxInactiveInterval, getMetaManager, getNodeId, getRefreshCookieAge, getSecureCookies, getSessionCookie, getSessionCookie, getSessionCookieConfig, getSessionDomain, getSessionHandler, getSessionIdManager, getSessionIdPathParameterName, getSessionIdPathParameterNamePrefix, getSessionPath, getSessions, getSessionsMax, getSessionsTotal, getSessionTimeMax, getSessionTimeMean, getSessionTimeStdDev, getSessionTimeTotal, isCheckingRemoteSessionIdEncoding, isNodeIdInSessionId, isSecureRequestOnly, isUsingCookies, isUsingURLs, isValid, newHttpSession, removeEventListener, removeSession, removeSession, setCheckingRemoteSessionIdEncoding, setHttpOnly, setMaxInactiveInterval, setNodeIdInSessionId, setRefreshCookieAge, setSecureRequestOnly, setSessionCookie, setSessionHandler, setSessionIdManager, setSessionIdPathParameterName, setSessionTrackingModes, setUsingCookies, statsReset
addBean, addBean, addBean, addEventListener, addManaged, contains, destroy, dump, dump, dump, dump, dump, dumpBeans, dumpObject, dumpStdErr, dumpThis, getBean, getBeans, getBeans, isManaged, manage, removeBean, removeBeans, removeEventListener, setBeans, setStopTimeout, start, stop, unmanage, updateBean, updateBeans
addLifeCycleListener, getState, getState, getStopTimeout, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
access, addEventListener, clearEventListeners, complete, getClusterId, getDefaultSessionTrackingModes, getEffectiveSessionTrackingModes, getHttpOnly, getHttpSession, getMaxInactiveInterval, getMetaManager, getNodeId, getSessionCookie, getSessionCookieConfig, getSessionIdManager, getSessionIdPathParameterName, getSessionIdPathParameterNamePrefix, isCheckingRemoteSessionIdEncoding, isUsingCookies, isUsingURLs, isValid, newHttpSession, removeEventListener, setCheckingRemoteSessionIdEncoding, setMaxInactiveInterval, setSessionHandler, setSessionIdManager, setSessionIdPathParameterName, setSessionTrackingModes
addLifeCycleListener, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop
protected final ConcurrentMap<String,NoSqlSession> _sessions
public void doStart() throws Exception
ContainerLifeCycle
doStart
in class AbstractSessionManager
Exception
AbstractSessionManager.doStart()
protected void addSession(AbstractSession session)
addSession
in class AbstractSessionManager
public AbstractSession getSession(String idInCluster)
AbstractSessionManager
getSession
in class AbstractSessionManager
idInCluster
- The session ID in the cluster, stripped of any worker name.protected void shutdownSessions() throws Exception
AbstractSessionManager
shutdownSessions
in class AbstractSessionManager
Exception
protected AbstractSession newSession(HttpServletRequest request)
AbstractSessionManager
newSession
in class AbstractSessionManager
protected boolean removeSession(String idInCluster)
removeSession
in class AbstractSessionManager
AbstractSessionManager.removeSession(java.lang.String)
protected void expire(String idInCluster)
public void invalidateSession(String idInCluster)
public int getStalePeriod()
public void setStalePeriod(int stalePeriod)
stalePeriod
- the stalePeriod in secondspublic int getSavePeriod()
public void setSavePeriod(int savePeriod)
savePeriod
- the savePeriod -2,-1,0,1 or the period in seconds >=2public int getIdlePeriod()
public void setIdlePeriod(int idlePeriod)
idlePeriod
- the idlePeriod in secondspublic boolean isInvalidateOnStop()
public boolean isPreserveOnStop()
public void setInvalidateOnStop(boolean invalidateOnStop)
invalidateOnStop
- the invalidateOnStop to setpublic void setPreserveOnStop(boolean preserveOnStop)
removeOnStop
- the removeOnStop to setpublic boolean isSaveAllAttributes()
public void setSaveAllAttributes(boolean saveAllAttributes)
saveAllAttributes
- the saveAllAttributes to setpublic void renewSessionId(String oldClusterId, String oldNodeId, String newClusterId, String newNodeId)
AbstractSessionManager
renewSessionId
in interface SessionManager
renewSessionId
in class AbstractSessionManager
SessionManager.renewSessionId(java.lang.String, java.lang.String, java.lang.String, java.lang.String)
protected abstract NoSqlSession loadSession(String clusterId)
protected abstract Object save(NoSqlSession session, Object version, boolean activateAfterSave)
protected abstract Object refresh(NoSqlSession session, Object version)
protected abstract boolean remove(NoSqlSession session)
protected abstract void update(NoSqlSession session, String newClusterId, String newNodeId) throws Exception
Exception
Copyright © 1995-2015 Webtide. All Rights Reserved.