| java.lang.Object org.apache.catalina.session.ManagerBase org.apache.catalina.session.StandardManager
StandardManager | public class StandardManager extends ManagerBase implements Lifecycle,PropertyChangeListener(Code) | | Standard implementation of the Manager interface that provides
simple session persistence across restarts of this component (such as
when the entire server is shut down and restarted, or when a particular
web application is reloaded.
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.
author: Craig R. McClanahan author: Jean-Francois Arcand version: $Revision: 1.22 $ $Date: 2004/05/26 16:14:10 $ |
Field Summary | |
protected int | expiredSessions Number of sessions that expired. | final protected static String | info The descriptive information about this implementation. | protected LifecycleSupport | lifecycle The lifecycle event support for this component. | protected int | maxActiveSessions The maximum number of active Sessions allowed, or -1 for no limit. | protected static String | name The descriptive name of this Manager implementation (for logging). | protected String | pathname Path name of the disk file in which active sessions are saved
when we stop, and from which these sessions are loaded when we start. | protected long | processingTime Processing time during session expiration. | protected int | rejectedSessions Number of session creations that failed due to maxActiveSessions. | protected boolean | started |
Method Summary | |
public void | addLifecycleListener(LifecycleListener listener) Add a lifecycle event listener to this component. | public void | backgroundProcess() | public Session | createSession() Construct and return a new session object, based on the default
settings specified by this Manager's properties. | protected void | doLoad() Load any currently active sessions that were previously unloaded
to the appropriate persistence mechanism, if any. | protected void | doUnload() Save any currently active sessions in the appropriate persistence
mechanism, if any. | protected File | file() Return a File object representing the pathname to our
persistence file, if any. | public LifecycleListener[] | findLifecycleListeners() Get the lifecycle listeners associated with this lifecycle. | public int | getExpiredSessions() Number of sessions that expired. | 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 String | getName() Return the descriptive short name of this Manager implementation. | public String | getPathname() Return the session persistence pathname, if any. | public long | getProcessingTime() | public int | getRejectedSessions() | public void | load() Load any currently active sessions that were previously unloaded
to the appropriate persistence mechanism, if any. | public void | processExpires() Invalidate all sessions that have expired. | public void | propertyChange(PropertyChangeEvent event) Process property change events from our associated Context. | public void | removeLifecycleListener(LifecycleListener listener) Remove a lifecycle event listener from this component. | public void | setContainer(Container container) Set the Container with which this Manager has been associated. | public void | setExpiredSessions(int expiredSessions) | public void | setMaxActiveSessions(int max) Set the maximum number of actives Sessions allowed, or -1 for
no limit. | public void | setPathname(String pathname) Set the session persistence pathname to the specified value. | public void | setProcessingTime(long processingTime) | public void | setRejectedSessions(int rejectedSessions) | 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. | public void | unload() Save any currently active sessions in the appropriate persistence
mechanism, if any. |
expiredSessions | protected int expiredSessions(Code) | | Number of sessions that expired.
|
info | final protected static String info(Code) | | The descriptive information about this implementation.
|
maxActiveSessions | protected int maxActiveSessions(Code) | | The maximum number of active Sessions allowed, or -1 for no limit.
|
name | protected static String name(Code) | | The descriptive name of this Manager implementation (for logging).
|
pathname | protected String pathname(Code) | | Path name of the disk file in which active sessions are saved
when we stop, and from which these sessions are loaded when we start.
A null value indicates that no persistence is desired.
If this pathname is relative, it will be resolved against the
temporary working directory provided by our context, available via
the javax.servlet.context.tempdir context attribute.
|
processingTime | protected long processingTime(Code) | | Processing time during session expiration.
|
rejectedSessions | protected int rejectedSessions(Code) | | Number of session creations that failed due to maxActiveSessions.
|
started | protected boolean started(Code) | | Has this component been started yet?
|
addLifecycleListener | public void addLifecycleListener(LifecycleListener listener)(Code) | | Add a lifecycle event listener to this component.
Parameters: listener - The listener to add |
backgroundProcess | public void backgroundProcess()(Code) | | Implements the Manager interface, direct call to processExpires
|
createSession | public Session createSession()(Code) | | Construct and return a new session object, based on the default
settings specified by this Manager's properties. The session
id will be assigned by this method, and available via the getId()
method of the returned session. If a new session cannot be created
for any reason, return null .
exception: IllegalStateException - if a new session cannot beinstantiated for any reason |
doLoad | protected void doLoad() throws ClassNotFoundException, IOException(Code) | | Load any currently active sessions that were previously unloaded
to the appropriate persistence mechanism, if any. If persistence is not
supported, this method returns without doing anything.
exception: ClassNotFoundException - if a serialized class cannot befound during the reload exception: IOException - if an input/output error occurs |
doUnload | protected void doUnload() throws IOException(Code) | | Save any currently active sessions in the appropriate persistence
mechanism, if any. If persistence is not supported, this method
returns without doing anything.
exception: IOException - if an input/output error occurs |
file | protected File file()(Code) | | Return a File object representing the pathname to our
persistence file, if any.
|
findLifecycleListeners | public LifecycleListener[] findLifecycleListeners()(Code) | | Get the lifecycle listeners associated with this lifecycle. If this
Lifecycle has no listeners registered, a zero-length array is returned.
|
getExpiredSessions | public int getExpiredSessions()(Code) | | Number of sessions that expired.
The count |
getInfo | public String getInfo()(Code) | | Return descriptive information about this Manager implementation and
the corresponding version number, in the format
<description>/<version> .
|
getMaxActiveSessions | public int getMaxActiveSessions()(Code) | | Return the maximum number of active Sessions allowed, or -1 for
no limit.
|
getName | public String getName()(Code) | | Return the descriptive short name of this Manager implementation.
|
getPathname | public String getPathname()(Code) | | Return the session persistence pathname, if any.
|
getProcessingTime | public long getProcessingTime()(Code) | | |
getRejectedSessions | public int getRejectedSessions()(Code) | | Number of session creations that failed due to maxActiveSessions
The count |
load | public void load() throws ClassNotFoundException, IOException(Code) | | Load any currently active sessions that were previously unloaded
to the appropriate persistence mechanism, if any. If persistence is not
supported, this method returns without doing anything.
exception: ClassNotFoundException - if a serialized class cannot befound during the reload exception: IOException - if an input/output error occurs |
processExpires | public void processExpires()(Code) | | Invalidate all sessions that have expired.
|
propertyChange | public void propertyChange(PropertyChangeEvent event)(Code) | | Process property change events from our associated Context.
Parameters: event - The property change event that has occurred |
removeLifecycleListener | public void removeLifecycleListener(LifecycleListener listener)(Code) | | Remove a lifecycle event listener from this component.
Parameters: listener - The listener to remove |
setContainer | public void setContainer(Container container)(Code) | | Set the Container with which this Manager has been associated. If
it is a Context (the usual case), listen for changes to the session
timeout property.
Parameters: container - The associated Container |
setExpiredSessions | public void setExpiredSessions(int expiredSessions)(Code) | | |
setMaxActiveSessions | public void setMaxActiveSessions(int max)(Code) | | Set the maximum number of actives Sessions allowed, or -1 for
no limit.
Parameters: max - The new maximum number of sessions |
setPathname | public void setPathname(String pathname)(Code) | | Set the session persistence pathname to the specified value. If no
persistence support is desired, set the pathname to null .
Parameters: pathname - New session persistence pathname |
setProcessingTime | public void setProcessingTime(long processingTime)(Code) | | |
setRejectedSessions | public void setRejectedSessions(int rejectedSessions)(Code) | | |
start | public void start() throws LifecycleException(Code) | | Prepare for the beginning of active use of the public methods of this
component. This method should be called after configure() ,
and before any of the public methods of the component are utilized.
exception: LifecycleException - if this component detects a fatal errorthat prevents this component from being used |
stop | public void stop() throws LifecycleException(Code) | | Gracefully terminate the active use of the public methods of this
component. This method should be the last one called on a given
instance of this component.
exception: LifecycleException - if this component detects a fatal errorthat needs to be reported |
unload | public void unload() throws IOException(Code) | | Save any currently active sessions in the appropriate persistence
mechanism, if any. If persistence is not supported, this method
returns without doing anything.
exception: IOException - if an input/output error occurs |
|
|