SessionDataMap, SessionDataStore, Container, Destroyable, Dumpable, LifeCyclepublic class CachingSessionDataStore extends ContainerLifeCycle implements SessionDataStore
AbstractLifeCycle.AbstractLifeCycleListenerContainer.InheritedListener, Container.ListenerLifeCycle.Listener| Modifier and Type | Field | 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 | Description |
|---|---|
CachingSessionDataStore(SessionDataMap cache,
SessionDataStore store) |
| Modifier and Type | Method | Description |
|---|---|---|
boolean |
delete(java.lang.String id) |
Delete session data
|
protected void |
doStart() |
|
protected void |
doStop() |
|
boolean |
exists(java.lang.String id) |
Test if data exists for a given session id.
|
java.util.Set<java.lang.String> |
getExpired(java.util.Set<java.lang.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(java.lang.String id) |
Read in session data.
|
SessionData |
newSessionData(java.lang.String id,
long created,
long accessed,
long lastAccessed,
long maxInactiveMs) |
Create a new SessionData
|
void |
store(java.lang.String id,
SessionData data) |
Store the session data.
|
addLifeCycleListener, getState, getState, getStopTimeout, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stopaddBean, addBean, addBean, addEventListener, addManaged, contains, destroy, dump, dump, dump, dump, dump, dumpBeans, dumpObject, dumpStdErr, dumpThis, getBean, getBeans, getBeans, getContainedBeans, getContainedBeans, isManaged, manage, removeBean, removeBeans, removeEventListener, setBeans, setStopTimeout, start, stop, unmanage, updateBean, updateBean, updateBeansaddLifeCycleListener, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, start, stop, stopprotected SessionDataStore _store
protected SessionDataMap _cache
public CachingSessionDataStore(SessionDataMap cache, SessionDataStore store)
cache - the front cache to usestore - the actual store for the the session datapublic SessionDataStore getSessionStore()
public SessionDataMap getSessionDataMap()
public SessionData load(java.lang.String id) throws java.lang.Exception
SessionDataMapload in interface SessionDataMapid - identity of session to loadjava.lang.Exception - if unable to load session dataSessionDataMap.load(java.lang.String)public boolean delete(java.lang.String id)
throws java.lang.Exception
SessionDataMapdelete in interface SessionDataMapid - identity of session to deletejava.lang.Exception - if unable to delete session dataSessionDataMap.delete(java.lang.String)public java.util.Set<java.lang.String> getExpired(java.util.Set<java.lang.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(java.lang.String id,
SessionData data)
throws java.lang.Exception
SessionDataMapstore in interface SessionDataMapid - identity of session to storedata - info of session to storejava.lang.Exception - if unable to write session dataSessionDataMap.store(java.lang.String, org.eclipse.jetty.server.session.SessionData)protected void doStart()
throws java.lang.Exception
doStart in class ContainerLifeCyclejava.lang.Exceptionprotected void doStop()
throws java.lang.Exception
doStop in class ContainerLifeCyclejava.lang.Exceptionpublic boolean isPassivating()
SessionDataStoreisPassivating in interface SessionDataStoreSessionDataStore.isPassivating()public boolean exists(java.lang.String id)
throws java.lang.Exception
SessionDataStoreexists in interface SessionDataStoreid - Identity of session whose existence should be checkedjava.lang.Exception - if problem checking existence with persistence layerSessionDataStore.exists(java.lang.String)public void initialize(SessionContext context) throws java.lang.Exception
SessionDataMapinitialize in interface SessionDataMapcontext - context associatedjava.lang.Exception - if unable to initialize theSessionDataMap.initialize(org.eclipse.jetty.server.session.SessionContext)public SessionData newSessionData(java.lang.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–2018 Webtide. All rights reserved.