public class DefaultSessionCache extends AbstractSessionCache
AbstractSessionCache.PlaceHolderSession
AbstractLifeCycle.AbstractLifeCycleListener
LifeCycle.Listener
Container.InheritedListener, Container.Listener
Modifier and Type | Field and Description |
---|---|
protected ConcurrentHashMap<String,Session> |
_sessions
The cache of sessions in a hashmap
|
_context, _evictionPolicy, _handler, _removeUnloadableSessions, _saveOnCreate, _saveOnInactiveEviction, _sessionDataStore
FAILED, RUNNING, STARTED, STARTING, STOP_ON_FAILURE, STOPPED, STOPPING
EVICT_ON_INACTIVITY, EVICT_ON_SESSION_EXIT, NEVER_EVICT
Constructor and Description |
---|
DefaultSessionCache(SessionHandler manager) |
Modifier and Type | Method and Description |
---|---|
Session |
doDelete(String id)
Remove the session with this identity from the store
|
Session |
doGet(String id)
Get the session matching the key
|
Session |
doPutIfAbsent(String id,
Session session)
Put the session into the map if it wasn't already there
|
boolean |
doReplace(String id,
Session oldValue,
Session newValue)
Replace the mapping from id to oldValue with newValue
|
long |
getSessionsCurrent() |
long |
getSessionsMax() |
long |
getSessionsTotal() |
Session |
newSession(HttpServletRequest request,
SessionData data)
Create a new Session for a request.
|
Session |
newSession(SessionData data)
Create a new Session object from pre-existing session data
|
void |
resetStats() |
void |
shutdown() |
checkExpiration, checkInactiveSession, contains, delete, doStart, doStop, exists, get, getEvictionPolicy, getSessionDataStore, getSessionHandler, initialize, isRemoveUnloadableSessions, isSaveOnCreate, isSaveOnInactiveEviction, newSession, put, renewSessionId, setEvictionPolicy, setRemoveUnloadableSessions, setSaveOnCreate, setSaveOnInactiveEviction, setSessionDataStore, toString
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, wait, wait, wait
addLifeCycleListener, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop
protected ConcurrentHashMap<String,Session> _sessions
public DefaultSessionCache(SessionHandler manager)
manager
- public long getSessionsCurrent()
public long getSessionsMax()
public long getSessionsTotal()
public void resetStats()
public Session doGet(String id)
AbstractSessionCache
doGet
in class AbstractSessionCache
id
- session idAbstractSessionCache.doGet(java.lang.String)
public Session doPutIfAbsent(String id, Session session)
AbstractSessionCache
doPutIfAbsent
in class AbstractSessionCache
id
- the identity of the sessionsession
- the session objectAbstractSessionCache.doPutIfAbsent(java.lang.String, org.eclipse.jetty.server.session.Session)
public Session doDelete(String id)
AbstractSessionCache
doDelete
in class AbstractSessionCache
id
- the idAbstractSessionCache.doDelete(java.lang.String)
public void shutdown()
public Session newSession(HttpServletRequest request, SessionData data)
AbstractSessionCache
newSession
in class AbstractSessionCache
request
- the requestdata
- the session dataAbstractSessionCache.newSession(javax.servlet.http.HttpServletRequest, org.eclipse.jetty.server.session.SessionData)
public Session newSession(SessionData data)
AbstractSessionCache
newSession
in interface SessionCache
newSession
in class AbstractSessionCache
data
- the session dataAbstractSessionCache.newSession(org.eclipse.jetty.server.session.SessionData)
public boolean doReplace(String id, Session oldValue, Session newValue)
AbstractSessionCache
doReplace
in class AbstractSessionCache
id
- the idoldValue
- the old valuenewValue
- the new valueAbstractSessionCache.doReplace(java.lang.String, org.eclipse.jetty.server.session.Session, org.eclipse.jetty.server.session.Session)
Copyright © 1995–2017 Webtide. All rights reserved.