public class CachingSessionDataStore extends ContainerLifeCycle implements SessionDataStore
AbstractLifeCycle.AbstractLifeCycleListenerLifeCycle.ListenerContainer.InheritedListener, Container.Listener| Modifier and Type | Field and Description |
|---|---|
protected SessionDataMap |
_cache
The fronting cache
|
protected SessionDataStore |
_store
The actual store for the session data
|
FAILED, RUNNING, STARTED, STARTING, STOP_ON_FAILURE, STOPPED, STOPPING| Constructor and Description |
|---|
CachingSessionDataStore(SessionDataMap cache,
SessionDataStore store) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
delete(String id)
Delete session data
|
protected void |
doStart() |
protected void |
doStop() |
boolean |
exists(String id)
Test if data exists for a given session id.
|
Set<String> |
getExpired(Set<String> candidates)
Called periodically, this method should search the data store
for sessions that have been expired for a 'reasonable' amount
of time.
|
SessionDataMap |
getSessionDataMap() |
SessionDataStore |
getSessionStore() |
void |
initialize(SessionContext context)
Initialize this data map for the
given context.
|
boolean |
isPassivating()
True if this type of datastore will passivate session objects
|
SessionData |
load(String id)
Read in session data.
|
SessionData |
newSessionData(String id,
long created,
long accessed,
long lastAccessed,
long maxInactiveMs)
Create a new SessionData
|
void |
store(String id,
SessionData data)
Store the session data.
|
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, updateBeansaddLifeCycleListener, getState, getState, getStopTimeout, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stopclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddLifeCycleListener, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stopprotected SessionDataStore _store
protected SessionDataMap _cache
public CachingSessionDataStore(SessionDataMap cache, SessionDataStore store)
cache - store - public SessionDataStore getSessionStore()
public SessionDataMap getSessionDataMap()
public SessionData load(String id) throws Exception
SessionDataMapload in interface SessionDataMapid - identity of session to loadException - if unable to load session dataSessionDataMap.load(java.lang.String)public boolean delete(String id) throws Exception
SessionDataMapdelete in interface SessionDataMapid - identity of session to deleteException - if unable to delete session dataSessionDataMap.delete(java.lang.String)public Set<String> getExpired(Set<String> candidates)
SessionDataStoregetExpired in interface SessionDataStorecandidates - if provided, these are keys of sessions that
the SessionDataStore thinks has expired and should be verified by the
SessionDataStoreSessionDataStore.getExpired(Set)public void store(String id, SessionData data) throws Exception
SessionDataMapstore in interface SessionDataMapid - identity of session to storedata - info of session to storeException - if unable to write session dataSessionDataMap.store(java.lang.String, org.eclipse.jetty.server.session.SessionData)protected void doStart()
throws Exception
doStart in class ContainerLifeCycleExceptionprotected void doStop()
throws Exception
doStop in class ContainerLifeCycleExceptionpublic boolean isPassivating()
SessionDataStoreisPassivating in interface SessionDataStoreSessionDataStore.isPassivating()public boolean exists(String id) throws Exception
SessionDataStoreexists in interface SessionDataStoreid - Identity of session whose existance should be checkedException - if problem checking existance with persistence layerSessionDataStore.exists(java.lang.String)public void initialize(SessionContext context) throws Exception
SessionDataMapinitialize in interface SessionDataMapcontext - context associatedExceptionSessionDataMap.initialize(org.eclipse.jetty.server.session.SessionContext)public SessionData newSessionData(String id, long created, long accessed, long lastAccessed, long maxInactiveMs)
SessionDataStorenewSessionData in interface SessionDataStoreid - the idcreated - the timestamp when createdaccessed - the timestamp when accessedlastAccessed - the timestamp when last accessedmaxInactiveMs - the max inactive time in millisecondsSessionDataStore.newSessionData(java.lang.String, long, long, long, long)Copyright © 1995–2017 Webtide. All rights reserved.