public class GCloudMemcachedSessionManager extends GCloudSessionManager
Modifier and Type | Class and Description |
---|---|
class |
GCloudMemcachedSessionManager.ContextClassloaderSerializingTranscoder
ContextClassloaderSerializingTranscoder
A xmemcached transcoder that will use the thread context classloader to
resolve classes during object deserialization: necessary for Servlet Spec
classloading order of context classloader first.
|
class |
GCloudMemcachedSessionManager.MemcacheSession
MemcacheSession
Needed to make a constructor public.
|
class |
GCloudMemcachedSessionManager.SerializableSessionData
Every time a Session is put into the cache one of these objects
is created to copy the data out of the in-memory session, and
every time an object is read from the cache one of these objects
a fresh Session object is created based on the data held by this
object.
|
GCloudSessionManager.Scavenger, GCloudSessionManager.Session, GCloudSessionManager.SessionEntityConverter
AbstractSessionManager.CookieConfig, AbstractSessionManager.SessionIf
AbstractLifeCycle.AbstractLifeCycleListener
LifeCycle.Listener
Container.InheritedListener, Container.Listener
Modifier and Type | Field and Description |
---|---|
protected net.rubyeye.xmemcached.MemcachedClient |
_client |
protected int |
_expirySec |
protected String |
_host |
protected String |
_port |
_ownScheduler, _scavengeIntervalMs, _scavenger, _scheduler, _task, DEFAULT_BACKOFF_MS, DEFAULT_MAX_QUERY_RESULTS, DEFAULT_MAX_RETRIES, DEFAULT_SCAVENGE_SEC, 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 |
---|
GCloudMemcachedSessionManager() |
Modifier and Type | Method and Description |
---|---|
protected void |
delete(GCloudSessionManager.Session session)
Remove the session from the cluster cache.
|
protected void |
deleteFromMemcached(GCloudSessionManager.Session session) |
void |
doStart()
Start the session manager.
|
void |
doStop()
Stop the session manager.
|
int |
getExpirySec() |
String |
getHost() |
String |
getPort() |
protected GCloudSessionManager.Session |
load(com.google.cloud.datastore.Key key)
Load a session from the clustered cache.
|
protected GCloudSessionManager.Session |
loadFromMemcached(String key) |
protected void |
save(GCloudSessionManager.Session session)
Save or update the session to the cluster cache
|
protected void |
saveToMemcached(GCloudSessionManager.Session session)
Store the session into memcached
|
void |
setExpirySec(int expirySec) |
void |
setHeartbeats(boolean heartbeats) |
void |
setHost(String host) |
void |
setPort(String port) |
addSession, canonicalizeKey, getBackoffMs, getMaxResults, getMaxRetries, getScavengeIntervalSec, getSession, getStaleIntervalSec, invalidateSession, makeKey, makeKey, newSession, removeSession, renewSessionId, scavenge, scavengeGCloudDataStore, scavengeSession, setBackoffMs, setDatastore, setMaxResults, setMaxRetries, setScavengeIntervalSec, setStaleIntervalSec, shutdownSessions
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
protected String _host
protected String _port
protected net.rubyeye.xmemcached.MemcachedClient _client
protected int _expirySec
public int getExpirySec()
public void setExpirySec(int expirySec)
expirySec
- the time in seconds for an item to remain in memcachedpublic void setHeartbeats(boolean heartbeats)
heartbeats
- if true memcached heartbeats are enabled. Default is true.public void doStart() throws Exception
GCloudSessionManager
doStart
in class GCloudSessionManager
Exception
AbstractSessionManager.doStart()
public void doStop() throws Exception
GCloudSessionManager
doStop
in class GCloudSessionManager
Exception
AbstractSessionManager.doStop()
protected GCloudSessionManager.Session load(com.google.cloud.datastore.Key key) throws Exception
GCloudSessionManager
load
in class GCloudSessionManager
key
- the unique datastore key for the sessionException
protected GCloudSessionManager.Session loadFromMemcached(String key) throws Exception
key
- the key for the memcache itemException
protected void save(GCloudSessionManager.Session session) throws Exception
GCloudSessionManager
save
in class GCloudSessionManager
session
- the session to save to datastoreException
protected void delete(GCloudSessionManager.Session session)
GCloudSessionManager
delete
in class GCloudSessionManager
session
- the session to delete from datastoreprotected void deleteFromMemcached(GCloudSessionManager.Session session) throws Exception
Exception
protected void saveToMemcached(GCloudSessionManager.Session session) throws Exception
session
- the Session to be serializedException
public String getHost()
public void setHost(String host)
host
- the host address of the memcached serverpublic String getPort()
public void setPort(String port)
port
- the port of the memcached serverCopyright © 1995-2016 Webtide. All Rights Reserved.