public class StandardManager extends ManagerBase implements Lifecycle, PropertyChangeListener
IMPLEMENTATION NOTE: Correct behavior of session storing and
reloading depends upon external calls to the start() and
stop() methods of this class at the correct times.
| Modifier and Type | Field and Description |
|---|---|
protected LifecycleSupport |
lifecycle
The lifecycle event support for this component.
|
protected static String |
name
The descriptive name of this Manager implementation (for logging).
|
container, debug, devRandomSource, distributable, domain, duplicates, entropy, expiredSessions, initialized, log, maxActive, maxActiveUpdateLock, maxInactiveInterval, oname, randomClass, randomIS, rb, rejectedSessions, sessionAverageAliveTime, sessionCounter, sessionIdLength, sessionLocker, sessionMaxAliveTime, sessions, support, uuidGeneratorAFTER_START_EVENT, AFTER_STOP_EVENT, BEFORE_START_EVENT, BEFORE_STOP_EVENT, INIT_EVENT, START_EVENT, STOP_EVENT| Constructor and Description |
|---|
StandardManager() |
| Modifier and Type | Method and Description |
|---|---|
void |
addLifecycleListener(LifecycleListener listener)
Add a lifecycle event listener to this component.
|
void |
clearStore() |
Session |
createSession()
Construct and return a new session object, based on the default
settings specified by this Manager's properties.
|
Session |
createSession(String sessionId)
Construct and return a new session object, based on the default
settings specified by this Manager's properties, using the specified
session id.
|
List<LifecycleListener> |
findLifecycleListeners()
Gets the (possibly empty) list of lifecycle listeners
associated with this StandardManager.
|
String |
getInfo()
Return descriptive information about this Manager implementation and
the corresponding version number, in the format
<description>/<version>. |
int |
getMaxActiveSessions()
Return the maximum number of active Sessions allowed, or -1 for
no limit.
|
String |
getName()
Return the descriptive short name of this Manager implementation.
|
String |
getPathname()
Return the session persistence pathname, if any.
|
long |
getProcessingTime() |
void |
load()
Loads any currently active sessions that were previously unloaded
to the appropriate persistence mechanism, if any.
|
void |
processExpires()
Invalidate all sessions that have expired.
|
void |
propertyChange(PropertyChangeEvent event)
Process property change events from our associated Context.
|
void |
readSessions(InputStream is) |
void |
release() |
void |
removeLifecycleListener(LifecycleListener listener)
Remove a lifecycle event listener from this component.
|
void |
setContainer(Container container)
Set the Container with which this Manager has been associated.
|
void |
setMaxActiveSessions(int max)
Set the maximum number of active Sessions allowed, or -1 for
no limit.
|
void |
setPathname(String pathname)
Set the session persistence pathname to the specified value.
|
void |
setProcessingTime(long processingTime) |
void |
start()
Prepare for the beginning of active use of the public methods of this
component.
|
void |
stop()
Gracefully terminate the active use of the public methods of this
component.
|
void |
stop(boolean isShutdown)
Gracefully terminate the active use of the public methods of this
component.
|
void |
unload()
Save any currently active sessions in the appropriate persistence
mechanism, if any.
|
protected void |
unload(boolean doExpire,
boolean isShutdown)
Save any currently active sessions in the appropriate persistence
mechanism, if any.
|
void |
writeSessions(OutputStream os)
Writes all active sessions to the given output stream.
|
void |
writeSessions(OutputStream os,
boolean doExpire) |
add, addPropertyChangeListener, changeSessionId, checkSessionAttribute, clearSessions, createEmptySession, destroy, expireSession, findSession, findSession, findSession, findSessions, generateSessionId, generateSessionId, getActiveSessions, getClassName, getContainer, getDebug, getDistributable, getDomain, getDuplicates, getEngine, getEntropy, getExpiredSessions, getJvmRoute, getLastAccessedTimeMillis, getMaxActive, getMaxInactiveInterval, getMaxInactiveIntervalSeconds, getNewSession, getObjectName, getRandom, getRandomBytes, getRandomClass, getRandomFile, getRejectedSessions, getSessionAttribute, getSessionAverageAliveTime, getSessionAverageAliveTimeSeconds, getSessionCount, getSessionCounter, getSessionIdLength, getSessionMaxAliveTime, getSessionMaxAliveTimeSeconds, getUuidGenerator, init, isSessionVersioningSupported, listSessionIds, lockSession, log, log, postRequestDispatcherProcess, preRequestDispatcherProcess, remove, removePropertyChangeListener, resetRandom, setDebug, setDistributable, setDuplicates, setEntropy, setExpiredSessions, setMaxActive, setMaxInactiveInterval, setMaxInactiveIntervalSeconds, setRandomClass, setRandomFile, setRejectedSessions, setSessionAverageAliveTime, setSessionAverageAliveTimeSeconds, setSessionCount, setSessionCounter, setSessionIdLength, setSessionLocker, setSessionMaxAliveTime, setSessionMaxAliveTimeSeconds, setUuidGenerator, toCookie, unlockSession, updateprotected LifecycleSupport lifecycle
protected static final String name
public void setContainer(Container container)
setContainer in interface ManagersetContainer in class ManagerBasecontainer - The associated Containerpublic String getInfo()
<description>/<version>.getInfo in interface ManagergetInfo in class ManagerBasepublic int getMaxActiveSessions()
public long getProcessingTime()
public void setProcessingTime(long processingTime)
public void setMaxActiveSessions(int max)
max - The new maximum number of sessionspublic String getName()
getName in class ManagerBasepublic String getPathname()
public void setPathname(String pathname)
null.pathname - New session persistence pathnamepublic Session createSession()
null.createSession in interface ManagercreateSession in class ManagerBaseIllegalStateException - if a new session cannot be
instantiated for any reasonpublic Session createSession(String sessionId)
createSession in interface ManagercreateSession in class ManagerBasesessionId - the session id to assign to the new sessionnull if a session with the
requested id already existsIllegalStateException - if a new session cannot be
instantiated for any reasonpublic void release()
release in class ManagerBasepublic void clearStore()
public void load()
throws ClassNotFoundException,
IOException
load in interface ManagerClassNotFoundException - if a serialized class cannot be
found during the reloadIOException - if a read error occurspublic void readSessions(InputStream is) throws ClassNotFoundException, IOException
ClassNotFoundExceptionIOExceptionpublic void unload()
throws IOException
unload in interface ManagerIOException - if an input/output error occurspublic void writeSessions(OutputStream os) throws IOException
os - the output stream to which to writeIOException - if an input/output error occursprotected void unload(boolean doExpire,
boolean isShutdown)
throws IOException
isShutdown - true if this manager is being stopped as part of a
domain shutdown (as opposed to an undeployment), and false otherwiseIOException - if an input/output error occurspublic void writeSessions(OutputStream os, boolean doExpire) throws IOException
IOExceptionpublic void addLifecycleListener(LifecycleListener listener)
addLifecycleListener in interface Lifecyclelistener - The listener to addpublic List<LifecycleListener> findLifecycleListeners()
findLifecycleListeners in interface Lifecyclepublic void removeLifecycleListener(LifecycleListener listener)
removeLifecycleListener in interface Lifecyclelistener - The listener to removepublic void start()
throws LifecycleException
configure(),
and before any of the public methods of the component are utilized.start in interface LifecycleLifecycleException - if this component detects a fatal error
that prevents this component from being usedpublic void stop()
throws LifecycleException
stop in interface LifecycleLifecycleException - if this component detects a fatal error
that needs to be reportedpublic void stop(boolean isShutdown)
throws LifecycleException
isShutdown - true if this manager is being stopped as part of a
domain shutdown (as opposed to an undeployment), and false otherwiseLifecycleException - if this component detects a fatal error
that needs to be reportedpublic void propertyChange(PropertyChangeEvent event)
propertyChange in interface PropertyChangeListenerevent - The property change event that has occurredpublic void processExpires()
Copyright © 2017. All rights reserved.