@ManagedObject public class JDBCSessionDataStore extends AbstractSessionDataStore
Modifier and Type | Class and Description |
---|---|
static class |
JDBCSessionDataStore.SessionTableSchema
SessionTableSchema
|
AbstractLifeCycle.AbstractLifeCycleListener
LifeCycle.Listener
Container.InheritedListener, Container.Listener
Modifier and Type | Field and Description |
---|---|
protected DatabaseAdaptor |
_dbAdaptor |
protected boolean |
_initialized |
protected boolean |
_schemaProvided |
protected JDBCSessionDataStore.SessionTableSchema |
_sessionTableSchema |
static java.lang.String |
NULL_CONTEXT_PATH
Used for Oracle and other databases where "" is treated as NULL
|
_context, _gracePeriodSec, _lastExpiryCheckTime, _savePeriodSec
Constructor and Description |
---|
JDBCSessionDataStore() |
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.
|
protected void |
doInsert(java.lang.String id,
SessionData data) |
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.
|
protected void |
doStop()
Stops the managed lifecycle beans in the reverse order they were added.
|
void |
doStore(java.lang.String id,
SessionData data,
long lastSaveTime)
Store the session data persistently.
|
protected void |
doUpdate(java.lang.String id,
SessionData data) |
boolean |
exists(java.lang.String id)
Test if data exists for a given session id.
|
void |
initialize() |
boolean |
isPassivating()
True if this type of datastore will passivate session objects
|
void |
setDatabaseAdaptor(DatabaseAdaptor dbAdaptor) |
void |
setSessionTableSchema(JDBCSessionDataStore.SessionTableSchema schema) |
checkStarted, getExpired, getGracePeriodSec, getSavePeriodSec, initialize, load, newSessionData, setGracePeriodSec, setSavePeriodSec, store, toString
addBean, 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
addLifeCycleListener, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, start, stop, stop
dumpObjects, dumpSelf
public static final java.lang.String NULL_CONTEXT_PATH
protected boolean _initialized
protected DatabaseAdaptor _dbAdaptor
protected JDBCSessionDataStore.SessionTableSchema _sessionTableSchema
protected boolean _schemaProvided
protected void doStart() throws java.lang.Exception
ContainerLifeCycle
doStart
in class AbstractSessionDataStore
java.lang.Exception
protected void doStop() throws java.lang.Exception
ContainerLifeCycle
doStop
in class ContainerLifeCycle
java.lang.Exception
public void initialize() throws java.lang.Exception
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 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 dataprotected void doInsert(java.lang.String id, SessionData data) throws java.lang.Exception
java.lang.Exception
protected void doUpdate(java.lang.String id, SessionData data) throws java.lang.Exception
java.lang.Exception
public 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 setDatabaseAdaptor(DatabaseAdaptor dbAdaptor)
public void setSessionTableSchema(JDBCSessionDataStore.SessionTableSchema schema)
@ManagedAttribute(value="does this 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 layerCopyright © 1995–2023 Webtide. All rights reserved.