public class NullSessionCache extends AbstractSessionCache
AbstractLifeCycle.AbstractLifeCycleListener
LifeCycle.Listener
Container.InheritedListener, Container.Listener
_context, _evictionPolicy, _flushOnResponseCommit, _handler, _removeUnloadableSessions, _saveOnCreate, _saveOnInactiveEviction, _sessionDataStore
FAILED, RUNNING, STARTED, STARTING, STOPPED, STOPPING
EVICT_ON_INACTIVITY, EVICT_ON_SESSION_EXIT, NEVER_EVICT
Constructor and Description |
---|
NullSessionCache(SessionHandler handler) |
Modifier and Type | Method and Description |
---|---|
protected Session |
doComputeIfAbsent(java.lang.String id,
java.util.function.Function<java.lang.String,Session> mappingFunction)
Compute the mappingFunction to create a Session object iff the session
with the given id isn't already in the map, otherwise return the existing Session.
|
Session |
doDelete(java.lang.String id)
Remove the session with this identity from the store
|
Session |
doGet(java.lang.String id)
Get the session matching the key from the cache.
|
Session |
doPutIfAbsent(java.lang.String id,
Session session)
Put the session into the map if it wasn't already there
|
boolean |
doReplace(java.lang.String id,
Session oldValue,
Session newValue)
Replace the mapping from id to oldValue with newValue
|
Session |
newSession(javax.servlet.http.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 |
setEvictionPolicy(int evictionTimeout)
-1 means we never evict inactive sessions.
|
void |
shutdown() |
add, checkExpiration, checkInactiveSession, commit, contains, delete, doStart, doStop, exists, get, getAndEnter, getEvictionPolicy, getSessionDataStore, getSessionHandler, initialize, isFlushOnResponseCommit, isRemoveUnloadableSessions, isSaveOnCreate, isSaveOnInactiveEviction, newSession, put, release, renewSessionId, renewSessionId, setFlushOnResponseCommit, setRemoveUnloadableSessions, setSaveOnCreate, setSaveOnInactiveEviction, setSessionDataStore, toString
addBean, addBean, addEventListener, addManaged, contains, destroy, dump, dump, dump, dump, dump, dumpBeans, dumpObject, dumpObjects, dumpStdErr, dumpThis, getBean, getBeans, getBeans, getContainedBeans, getContainedBeans, isAuto, isManaged, isUnmanaged, 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
renewSessionId
addLifeCycleListener, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, start, stop, stop
dumpContainer, dumpIterable, dumpMapEntries, dumpObjects, dumpSelf, named
public NullSessionCache(SessionHandler handler)
handler
- The SessionHandler related to this SessionCachepublic void shutdown()
public Session newSession(SessionData data)
AbstractSessionCache
newSession
in interface SessionCache
newSession
in class AbstractSessionCache
data
- the session datapublic Session newSession(javax.servlet.http.HttpServletRequest request, SessionData data)
AbstractSessionCache
newSession
in class AbstractSessionCache
request
- the requestdata
- the session datapublic Session doGet(java.lang.String id)
AbstractSessionCache
doGet
in class AbstractSessionCache
id
- session idpublic Session doPutIfAbsent(java.lang.String id, Session session)
AbstractSessionCache
doPutIfAbsent
in class AbstractSessionCache
id
- the identity of the sessionsession
- the session objectpublic boolean doReplace(java.lang.String id, Session oldValue, Session newValue)
AbstractSessionCache
doReplace
in class AbstractSessionCache
id
- the idoldValue
- the old valuenewValue
- the new valuepublic Session doDelete(java.lang.String id)
AbstractSessionCache
doDelete
in class AbstractSessionCache
id
- the idpublic void setEvictionPolicy(int evictionTimeout)
AbstractSessionCache
setEvictionPolicy
in interface SessionCache
setEvictionPolicy
in class AbstractSessionCache
evictionTimeout
- -1 is never evict; 0 is evict-on-exit; and any other positive
value is the time in seconds that a session can be idle before it can
be evicted.SessionCache.setEvictionPolicy(int)
protected Session doComputeIfAbsent(java.lang.String id, java.util.function.Function<java.lang.String,Session> mappingFunction)
AbstractSessionCache
ConcurrentHashMap.computeIfAbsent(K, java.util.function.Function<? super K, ? extends V>)
doComputeIfAbsent
in class AbstractSessionCache
id
- the session idmappingFunction
- the function to load the data for the sessionCopyright © 1995–2020 Webtide. All rights reserved.