public class GCloudSessionManager extends AbstractSessionManager
Modifier and Type | Class and Description |
---|---|
protected class |
GCloudSessionManager.Scavenger
Scavenger
|
class |
GCloudSessionManager.SerializableSessionData |
class |
GCloudSessionManager.Session
Session
Representation of a session in local memory.
|
class |
GCloudSessionManager.SessionEntityConverter
SessionEntityConverter
|
AbstractSessionManager.CookieConfig, AbstractSessionManager.SessionIf
AbstractLifeCycle.AbstractLifeCycleListener
LifeCycle.Listener
Container.InheritedListener, Container.Listener
Modifier and Type | Field and Description |
---|---|
protected boolean |
_ownScheduler |
protected long |
_scavengeIntervalMs |
protected GCloudSessionManager.Scavenger |
_scavenger |
protected Scheduler |
_scheduler |
protected Scheduler.Task |
_task |
static int |
DEFAULT_MAX_QUERY_RESULTS |
static long |
DEFAULT_SCAVENGE_SEC |
static String |
KIND |
__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
FAILED, RUNNING, STARTED, STARTING, STOPPED, STOPPING
__CheckRemoteSessionEncoding, __DefaultSessionCookie, __DefaultSessionDomain, __DefaultSessionIdPathParameterName, __MaxAgeProperty, __SessionCookieProperty, __SessionDomainProperty, __SessionIdPathParameterNameProperty, __SessionPathProperty
Constructor and Description |
---|
GCloudSessionManager() |
Modifier and Type | Method and Description |
---|---|
protected void |
addSession(AbstractSession session)
Add a new session for the context related to this session manager
|
protected void |
delete(GCloudSessionManager.Session session)
Remove the session from the cluster cache.
|
void |
doStart()
Start the session manager.
|
void |
doStop()
Stop the session manager.
|
int |
getMaxResults() |
long |
getScavengeIntervalSec() |
AbstractSession |
getSession(String idInCluster)
Ask the cluster for the session.
|
long |
getStaleIntervalSec() |
void |
invalidateSession(String idInCluster)
Invalidate a session for this context with the given id
|
protected GCloudSessionManager.Session |
load(com.google.gcloud.datastore.Key key)
Load a session from the clustered cache.
|
protected AbstractSession |
newSession(HttpServletRequest request)
Create a new session instance
|
protected boolean |
removeSession(String idInCluster)
Remove a session from local memory, and delete it from
the cluster cache.
|
void |
renewSessionId(String oldClusterId,
String oldNodeId,
String newClusterId,
String newNodeId)
Tell the HttpSessionIdListeners the id changed.
|
protected void |
save(GCloudSessionManager.Session session)
Save or update the session to the cluster cache
|
void |
scavenge()
Look for sessions in local memory that have expired.
|
protected void |
scavengeGCloudDataStore() |
protected void |
scavengeSession(com.google.gcloud.datastore.Entity e)
Scavenge a session that has expired
|
void |
setMaxResults(int maxResults) |
void |
setScavengeIntervalSec(long sec)
Set the interval between runs of the scavenger.
|
void |
setStaleIntervalSec(long staleIntervalSec) |
protected void |
shutdownSessions()
The session manager is stopping.
|
access, addEventListener, addSession, clearEventListeners, complete, doSessionAttributeListeners, 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, getState, getState, getStopTimeout, 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
public static final String KIND
public static final int DEFAULT_MAX_QUERY_RESULTS
public static final long DEFAULT_SCAVENGE_SEC
protected Scheduler.Task _task
protected Scheduler _scheduler
protected GCloudSessionManager.Scavenger _scavenger
protected long _scavengeIntervalMs
protected boolean _ownScheduler
public void doStart() throws Exception
doStart
in class AbstractSessionManager
Exception
AbstractSessionManager.doStart()
public void doStop() throws Exception
doStop
in class AbstractSessionManager
Exception
AbstractSessionManager.doStop()
public void scavenge()
protected void scavengeSession(com.google.gcloud.datastore.Entity e) throws Exception
e
- Exception
public long getScavengeIntervalSec()
public void setScavengeIntervalSec(long sec)
sec
- public long getStaleIntervalSec()
public void setStaleIntervalSec(long staleIntervalSec)
public int getMaxResults()
public void setMaxResults(int maxResults)
protected void addSession(AbstractSession session)
addSession
in class AbstractSessionManager
AbstractSessionManager.addSession(org.eclipse.jetty.server.session.AbstractSession)
public AbstractSession getSession(String idInCluster)
getSession
in class AbstractSessionManager
idInCluster
- The session ID in the cluster, stripped of any worker name.AbstractSessionManager.getSession(java.lang.String)
protected void shutdownSessions() throws Exception
shutdownSessions
in class AbstractSessionManager
Exception
- if unable to shutdown sesssionsAbstractSessionManager.shutdownSessions()
protected AbstractSession newSession(HttpServletRequest request)
AbstractSessionManager
newSession
in class AbstractSessionManager
request
- the request to build the session fromprotected boolean removeSession(String idInCluster)
removeSession
in class AbstractSessionManager
AbstractSessionManager.removeSession(java.lang.String)
public void renewSessionId(String oldClusterId, String oldNodeId, String newClusterId, String newNodeId)
AbstractSessionManager
renewSessionId
in interface SessionManager
renewSessionId
in class AbstractSessionManager
oldClusterId
- the old cluster idoldNodeId
- the old node idnewClusterId
- the new cluster idnewNodeId
- the new node idSessionManager.renewSessionId(java.lang.String, java.lang.String, java.lang.String, java.lang.String)
protected GCloudSessionManager.Session load(com.google.gcloud.datastore.Key key) throws Exception
key
- Exception
protected void save(GCloudSessionManager.Session session) throws Exception
session
- Exception
protected void delete(GCloudSessionManager.Session session)
session
- public void invalidateSession(String idInCluster)
idInCluster
- Copyright © 1995-2016 Webtide. All Rights Reserved.