SessionManager
, Container
, Destroyable
, Dumpable
, LifeCycle
MongoSessionManager
public abstract class NoSqlSessionManager extends AbstractSessionManager implements SessionManager
AbstractLifeCycle.AbstractLifeCycleListener
AbstractSessionManager.CookieConfig, AbstractSessionManager.SessionIf
Container.InheritedListener, Container.Listener
LifeCycle.Listener
Modifier and Type | Field | Description |
---|---|---|
protected java.util.concurrent.ConcurrentMap<java.lang.String,NoSqlSession> |
_sessions |
FAILED, RUNNING, STARTED, STARTING, STOP_ON_FAILURE, STOPPED, STOPPING
__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, MAX_INACTIVE_MINUTES
__CheckRemoteSessionEncoding, __DefaultSessionCookie, __DefaultSessionDomain, __DefaultSessionIdPathParameterName, __MaxAgeProperty, __SessionCookieProperty, __SessionDomainProperty, __SessionIdPathParameterNameProperty, __SessionPathProperty
Constructor | Description |
---|---|
NoSqlSessionManager() |
Modifier and Type | Method | Description |
---|---|---|
protected void |
addSession(AbstractSession session) |
|
void |
doStart() |
|
protected void |
expire(java.lang.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(java.lang.String idInCluster) |
|
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(java.lang.String idInCluster) |
|
boolean |
isDeidleBeforeExpiry() |
|
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(java.lang.String clusterId) |
|
protected AbstractSession |
newSession(javax.servlet.http.HttpServletRequest request) |
|
protected abstract java.lang.Object |
refresh(NoSqlSession session,
java.lang.Object version) |
|
protected abstract boolean |
remove(NoSqlSession session) |
|
protected boolean |
removeSession(java.lang.String idInCluster) |
Remove the session from the in-memory list for this context.
|
void |
renewSessionId(java.lang.String oldClusterId,
java.lang.String oldNodeId,
java.lang.String newClusterId,
java.lang.String newNodeId) |
|
protected abstract java.lang.Object |
save(NoSqlSession session,
java.lang.Object version,
boolean activateAfterSave) |
|
void |
setDeidleBeforeExpiry(boolean deidleBeforeExpiry) |
|
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() |
|
protected abstract void |
update(NoSqlSession session,
java.lang.String newClusterId,
java.lang.String newNodeId) |
addLifeCycleListener, getState, getState, getStopTimeout, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop
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, updateBean, updateBeans
addLifeCycleListener, 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
protected final java.util.concurrent.ConcurrentMap<java.lang.String,NoSqlSession> _sessions
public void doStart() throws java.lang.Exception
doStart
in class AbstractSessionManager
java.lang.Exception
AbstractSessionManager.doStart()
protected void addSession(AbstractSession session)
addSession
in class AbstractSessionManager
public AbstractSession getSession(java.lang.String idInCluster)
getSession
in class AbstractSessionManager
protected void shutdownSessions() throws java.lang.Exception
shutdownSessions
in class AbstractSessionManager
java.lang.Exception
protected AbstractSession newSession(javax.servlet.http.HttpServletRequest request)
newSession
in class AbstractSessionManager
protected boolean removeSession(java.lang.String idInCluster)
removeSession
in class AbstractSessionManager
AbstractSessionManager.removeSession(java.lang.String)
protected void expire(java.lang.String idInCluster)
public void invalidateSession(java.lang.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)
preserveOnStop
- the preserveOnStop to setpublic boolean isSaveAllAttributes()
public void setSaveAllAttributes(boolean saveAllAttributes)
saveAllAttributes
- the saveAllAttributes to setpublic boolean isDeidleBeforeExpiry()
public void setDeidleBeforeExpiry(boolean deidleBeforeExpiry)
public void renewSessionId(java.lang.String oldClusterId, java.lang.String oldNodeId, java.lang.String newClusterId, java.lang.String newNodeId)
renewSessionId
in interface SessionManager
renewSessionId
in class AbstractSessionManager
protected abstract NoSqlSession loadSession(java.lang.String clusterId)
protected abstract java.lang.Object save(NoSqlSession session, java.lang.Object version, boolean activateAfterSave)
protected abstract java.lang.Object refresh(NoSqlSession session, java.lang.Object version)
protected abstract boolean remove(NoSqlSession session)
protected abstract void update(NoSqlSession session, java.lang.String newClusterId, java.lang.String newNodeId) throws java.lang.Exception
java.lang.Exception
Copyright © 1995–2017 Webtide. All rights reserved.