org.apache.catalina.session
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.
Version: $Revision: 612761 $ $Date: 2008-01-17 09:48:45 +0100 (Thu, 17 Jan 2008) $
Field Summary | |
---|---|
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
Has this component been started yet? |
Method Summary | |
---|---|
void | addLifecycleListener(LifecycleListener listener)
Add a lifecycle event listener to this component.
|
Session | createSession(String sessionId)
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. |
LifecycleListener[] | findLifecycleListeners()
Get the lifecycle listeners associated with this lifecycle. |
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. |
int | getRejectedSessions() Number of session creations that failed due to maxActiveSessions
|
void | load()
Load any currently active sessions that were previously unloaded
to the appropriate persistence mechanism, if any. |
void | propertyChange(PropertyChangeEvent event)
Process property change events from our associated Context.
|
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 actives Sessions allowed, or -1 for
no limit.
|
void | setPathname(String pathname)
Set the session persistence pathname to the specified value. |
void | setRejectedSessions(int rejectedSessions) |
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 | unload()
Save any currently active sessions in the appropriate persistence
mechanism, if any. |
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.Parameters: listener The listener to add
null
.
Throws: IllegalStateException if a new session cannot be instantiated for any reason
Throws: ClassNotFoundException if a serialized class cannot be found during the reload IOException if an input/output error occurs
Throws: IOException if an input/output error occurs
<description>/<version>
.Returns: The count
Throws: ClassNotFoundException if a serialized class cannot be found during the reload IOException if an input/output error occurs
Parameters: event The property change event that has occurred
Parameters: listener The listener to remove
Parameters: container The associated Container
Parameters: max The new maximum number of sessions
null
.
Parameters: pathname New session persistence pathname
configure()
,
and before any of the public methods of the component are utilized.
Throws: LifecycleException if this component detects a fatal error that prevents this component from being used
Throws: LifecycleException if this component detects a fatal error that needs to be reported
Throws: IOException if an input/output error occurs