Method Summary |
|
public void | addLifecycleListener(LifecycleListener listener) Add a lifecycle event listener to this component. |
public void | clearStore() Clear all sessions from the Store. |
public Session | createSession() Return a new session object as long as the number of active
sessions does not exceed maxActiveSessions. |
public LifecycleListener[] | findLifecycleListeners() Get the lifecycle listeners associated with this lifecycle. |
public Session | findSession(String id) Return the active Session, associated with this Manager, with the
specified session id (if any); otherwise return null . |
public int | getCheckInterval() Return the check interval (in seconds) for this Manager. |
public String | getInfo() Return descriptive information about this Manager implementation and
the corresponding version number, in the format
<description>/<version> . |
public int | getMaxActiveSessions() Return the maximum number of active Sessions allowed, or -1 for
no limit. |
public int | getMaxIdleBackup() Indicates how many seconds old a session can get, after its last
use in a request, before it should be backed up to the store. |
public int | getMaxIdleSwap() The time in seconds after which a session should be swapped out of
memory to disk. |
public int | getMinIdleSwap() The minimum time in seconds that a session must be idle before
it can be swapped out of memory, or -1 if it can be swapped out
at any time. |
public String | getName() Return the descriptive short name of this Manager implementation. |
public boolean | getSaveOnRestart() Indicates whether sessions are saved when the Manager is shut down
properly. |
public Store | getStore() Return the Store object which manages persistent Session
storage for this Manager. |
protected boolean | isSessionStale(Session session, long timeNow) Indicate whether the session has been idle for longer
than its expiration date as of the supplied time. |
protected boolean | isStarted() Get the started status. |
public void | load() Load all sessions found in the persistence mechanism, assuming
they are marked as valid and have not passed their expiration
limit. |
protected void | processExpires() Invalidate all sessions that have expired. |
protected void | processMaxActiveSwaps() |
protected void | processMaxIdleBackups() Back up idle sessions. |
protected void | processMaxIdleSwaps() Swap idle sessions out to Store if they are idle too long. |
public void | processPersistenceChecks() Called by the background thread after active sessions have
been checked for expiration, to allow sessions to be
swapped out, backed up, etc. |
public void | propertyChange(PropertyChangeEvent event) Process property change events from our associated Context. |
public void | remove(Session session) Remove this Session from the active Sessions for this Manager,
and from the Store. |
public void | removeLifecycleListener(LifecycleListener listener) Remove a lifecycle event listener from this component. |
public void | run() The background thread that checks for session timeouts and shutdown. |
public void | setCheckInterval(int checkInterval) Set the check interval (in seconds) for this Manager. |
public void | setContainer(Container container) Set the Container with which this Manager has been associated. |
public void | setMaxActiveSessions(int max) Set the maximum number of actives Sessions allowed, or -1 for
no limit. |
public void | setMaxIdleBackup(int backup) Sets the option to back sessions up to the Store after they
are used in a request. |
public void | setMaxIdleSwap(int max) Sets the time in seconds after which a session should be swapped out of
memory to disk. |
public void | setMinIdleSwap(int min) Sets the minimum time in seconds that a session must be idle before
it can be swapped out of memory due to maxActiveSession. |
public void | setSaveOnRestart(boolean saveOnRestart) Set the option to save sessions to the Store when the Manager is
shut down, then loaded when the Manager starts again. |
protected void | setStarted(boolean started) |
public void | setStore(Store store) Set the Store object which will manage persistent Session
storage for this Manager. |
public void | start() Prepare for the beginning of active use of the public methods of this
component. |
public void | stop() Gracefully terminate the active use of the public methods of this
component. |
protected Session | swapIn(String id) Look for a session in the Store and, if found, restore
it in the Manager's list of active sessions if appropriate. |
protected void | swapOut(Session session) Remove the session from the Manager's list of active
sessions and write it out to the Store. |
protected void | threadSleep() Sleep for the duration specified by the checkInterval
property. |
protected void | threadStart() Start the background thread that will periodically check for
session timeouts. |
protected void | threadStop() Stop the background thread that is periodically checking for
session timeouts. |
public void | unload() Save all currently active sessions in the appropriate persistence
mechanism, if any. |
protected void | writeSession(Session session) Write the provided session to the Store without modifying
the copy in memory or triggering passivation events. |