|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.catalina.session.ManagerBase org.apache.catalina.session.StandardManager
public class StandardManager
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.
Field Summary | |
---|---|
protected static java.lang.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 java.lang.String |
name
The descriptive name of this Manager implementation (for logging). |
protected java.lang.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? |
Fields inherited from class org.apache.catalina.session.ManagerBase |
---|
algorithm, container, DEFAULT_ALGORITHM, devRandomSource, digest, distributable, domain, duplicates, entropy, expiredSessions, initialized, log, maxActive, maxInactiveInterval, mserver, oname, processExpiresFrequency, random, randomClass, randomIS, sessionAverageAliveTime, sessionCounter, sessionIdLength, sessionMaxAliveTime, sessions, sm, support |
Fields inherited from interface org.apache.catalina.Lifecycle |
---|
AFTER_START_EVENT, AFTER_STOP_EVENT, BEFORE_START_EVENT, BEFORE_STOP_EVENT, DESTROY_EVENT, INIT_EVENT, PERIODIC_EVENT, START_EVENT, STOP_EVENT |
Constructor Summary | |
---|---|
StandardManager()
|
Method Summary | |
---|---|
void |
addLifecycleListener(LifecycleListener listener)
Add a lifecycle event listener to this component. |
Session |
createSession(java.lang.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 java.io.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. |
java.lang.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. |
java.lang.String |
getName()
Return the descriptive short name of this Manager implementation. |
java.lang.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(java.beans.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(java.lang.String pathname)
Set the session persistence pathname to the specified value. |
void |
setRejectedSessions(int rejectedSessions)
Sets the number of sessions that were not created because the maximum number of active sessions was reached. |
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final java.lang.String info
protected LifecycleSupport lifecycle
protected int maxActiveSessions
protected static java.lang.String name
protected java.lang.String pathname
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.
protected boolean started
protected int rejectedSessions
protected long processingTime
Constructor Detail |
---|
public StandardManager()
Method Detail |
---|
public void setContainer(Container container)
setContainer
in interface Manager
setContainer
in class ManagerBase
container
- The associated Containerpublic java.lang.String getInfo()
<description>/<version>
.
getInfo
in interface Manager
getInfo
in class ManagerBase
public int getMaxActiveSessions()
public int getRejectedSessions()
getRejectedSessions
in interface Manager
public void setRejectedSessions(int rejectedSessions)
Manager
setRejectedSessions
in interface Manager
rejectedSessions
- Number of rejected sessionspublic void setMaxActiveSessions(int max)
max
- The new maximum number of sessionspublic java.lang.String getName()
getName
in class ManagerBase
public java.lang.String getPathname()
public void setPathname(java.lang.String pathname)
null
.
pathname
- New session persistence pathnamepublic Session createSession(java.lang.String sessionId)
null
.
createSession
in interface Manager
createSession
in class ManagerBase
sessionId
- The session id which should be used to create the
new session; if null
, a new session id will be
generated
java.lang.IllegalStateException
- if a new session cannot be
instantiated for any reasonpublic void load() throws java.lang.ClassNotFoundException, java.io.IOException
load
in interface Manager
java.lang.ClassNotFoundException
- if a serialized class cannot be
found during the reload
java.io.IOException
- if an input/output error occursprotected void doLoad() throws java.lang.ClassNotFoundException, java.io.IOException
java.lang.ClassNotFoundException
- if a serialized class cannot be
found during the reload
java.io.IOException
- if an input/output error occurspublic void unload() throws java.io.IOException
unload
in interface Manager
java.io.IOException
- if an input/output error occursprotected void doUnload() throws java.io.IOException
java.io.IOException
- if an input/output error occurspublic void addLifecycleListener(LifecycleListener listener)
addLifecycleListener
in interface Lifecycle
listener
- The listener to addpublic LifecycleListener[] findLifecycleListeners()
findLifecycleListeners
in interface Lifecycle
public void removeLifecycleListener(LifecycleListener listener)
removeLifecycleListener
in interface Lifecycle
listener
- The listener to removepublic void start() throws LifecycleException
configure()
,
and before any of the public methods of the component are utilized.
start
in interface Lifecycle
LifecycleException
- if this component detects a fatal error
that prevents this component from being usedpublic void stop() throws LifecycleException
stop
in interface Lifecycle
LifecycleException
- if this component detects a fatal error
that needs to be reportedpublic void propertyChange(java.beans.PropertyChangeEvent event)
propertyChange
in interface java.beans.PropertyChangeListener
event
- The property change event that has occurredprotected java.io.File file()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |