@ManagedObject public class InfinispanSessionDataStore extends AbstractSessionDataStore
AbstractLifeCycle.AbstractLifeCycleListener
LifeCycle.Listener
Container.InheritedListener, Container.Listener
_context, _gracePeriodSec, _lastExpiryCheckTime, _savePeriodSec
Constructor and Description |
---|
InfinispanSessionDataStore() |
Modifier and Type | Method and Description |
---|---|
boolean |
delete(java.lang.String id)
Delete session data
|
java.util.Set<java.lang.String> |
doGetExpired(java.util.Set<java.lang.String> candidates)
Implemented by subclasses to resolve which sessions this node
should attempt to expire.
|
SessionData |
doLoad(java.lang.String id)
Load the session from persistent store.
|
protected void |
doStart()
Starts the managed lifecycle beans in the order they were added.
|
void |
doStore(java.lang.String id,
SessionData data,
long lastSaveTime)
Store the session data persistently.
|
boolean |
exists(java.lang.String id)
Test if data exists for a given session id.
|
org.infinispan.commons.api.BasicCache<java.lang.String,java.lang.Object> |
getCache()
Get the clustered cache instance.
|
java.lang.String |
getCacheKey(java.lang.String id) |
int |
getInfinispanIdleTimeoutSec() |
boolean |
isPassivating()
True if this type of datastore will passivate session objects
|
SessionData |
newSessionData(java.lang.String id,
long created,
long accessed,
long lastAccessed,
long maxInactiveMs)
Create a new SessionData
|
void |
setCache(org.infinispan.commons.api.BasicCache<java.lang.String,java.lang.Object> cache)
Set the clustered cache instance.
|
void |
setInfinispanIdleTimeoutSec(int sec) |
java.lang.String |
toString() |
checkStarted, getExpired, getGracePeriodSec, getSavePeriodSec, initialize, load, setGracePeriodSec, setSavePeriodSec, store
addBean, addBean, addBean, addEventListener, addManaged, contains, destroy, doStop, 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
addLifeCycleListener, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, start, stop, stop
dumpObjects, dumpSelf
public org.infinispan.commons.api.BasicCache<java.lang.String,java.lang.Object> getCache()
public void setCache(org.infinispan.commons.api.BasicCache<java.lang.String,java.lang.Object> cache)
cache
- the cacheprotected void doStart() throws java.lang.Exception
ContainerLifeCycle
doStart
in class AbstractSessionDataStore
java.lang.Exception
public SessionData doLoad(java.lang.String id) throws java.lang.Exception
AbstractSessionDataStore
doLoad
in class AbstractSessionDataStore
id
- the id of the session to loadjava.lang.Exception
- if unable to load the sessionpublic boolean delete(java.lang.String id) throws java.lang.Exception
SessionDataMap
id
- identity of session to deletejava.lang.Exception
- if unable to delete session datapublic java.util.Set<java.lang.String> doGetExpired(java.util.Set<java.lang.String> candidates)
AbstractSessionDataStore
doGetExpired
in class AbstractSessionDataStore
candidates
- the ids of sessions the SessionDataStore thinks has expiredpublic void doStore(java.lang.String id, SessionData data, long lastSaveTime) throws java.lang.Exception
AbstractSessionDataStore
doStore
in class AbstractSessionDataStore
id
- identity of session to storedata
- info of the sessionlastSaveTime
- time of previous save or 0 if never savedjava.lang.Exception
- if unable to store datapublic java.lang.String getCacheKey(java.lang.String id)
@ManagedAttribute(value="does store serialize sessions", readonly=true) public boolean isPassivating()
SessionDataStore
public boolean exists(java.lang.String id) throws java.lang.Exception
SessionDataStore
id
- Identity of session whose existence should be checkedjava.lang.Exception
- if problem checking existence with persistence layerpublic SessionData newSessionData(java.lang.String id, long created, long accessed, long lastAccessed, long maxInactiveMs)
SessionDataStore
newSessionData
in interface SessionDataStore
newSessionData
in class AbstractSessionDataStore
id
- the idcreated
- the timestamp when createdaccessed
- the timestamp when accessedlastAccessed
- the timestamp when last accessedmaxInactiveMs
- the max inactive time in millisecondspublic void setInfinispanIdleTimeoutSec(int sec)
sec
- the infinispan-specific idle timeout in sec or 0 if not set@ManagedAttribute(value="infinispan idle timeout sec", readonly=true) public int getInfinispanIdleTimeoutSec()
public java.lang.String toString()
toString
in class AbstractSessionDataStore
Copyright © 1995–2023 Webtide. All rights reserved.