org.apache.catalina.session
public abstract class ManagerBase extends Object implements Manager, MBeanRegistration
Version: $Revision: 892545 $ $Date: 2009-12-20 02:04:17 +0100 (Sun, 20 Dec 2009) $
Field Summary | |
---|---|
protected String | algorithm
The message digest algorithm to be used when generating session
identifiers. |
protected Container | container
The Container with which this Manager is associated. |
protected String | devRandomSource |
protected MessageDigest | digest
Return the MessageDigest implementation to be used when
creating session identifiers. |
protected boolean | distributable
The distributable flag for Sessions created by this Manager. |
protected String | domain |
protected int | duplicates |
protected static String | DEFAULT_ALGORITHM
The default message digest algorithm to use if we cannot use
the requested one. |
protected String | entropy
A String initialization parameter used to increase the entropy of
the initialization of our random number generator. |
protected int | expiredSessions
Number of sessions that have expired. |
protected boolean | initialized |
protected Log | log |
protected int | maxActive |
protected int | maxInactiveInterval
The default maximum inactive interval for Sessions created by
this Manager. |
protected MBeanServer | mserver |
protected static String | name
The descriptive name of this Manager implementation (for logging). |
protected ObjectName | oname |
protected int | processExpiresFrequency
Frequency of the session expiration, and related manager operations.
|
protected long | processingTime
Processing time during session expiration. |
protected Random | random
A random number generator to use when generating session identifiers. |
protected String | randomClass
The Java class name of the random number generator class to be used
when generating session identifiers. |
protected DataInputStream | randomIS |
protected int | sessionAverageAliveTime
Average time (in seconds) that expired sessions had been alive. |
protected int | sessionCounter |
protected int | sessionIdLength
The session id length of Sessions created by this Manager. |
protected int | sessionMaxAliveTime
The longest time (in seconds) that an expired session had been alive. |
protected Map<String,Session> | sessions
The set of currently active Sessions for this Manager, keyed by
session identifier. |
protected static StringManager | sm
The string manager for this package. |
protected PropertyChangeSupport | support
The property change support for this component. |
Method Summary | |
---|---|
void | add(Session session)
Add this Session to the set of active Sessions for this Manager.
|
void | addPropertyChangeListener(PropertyChangeListener listener)
Add a property change listener to this component.
|
void | backgroundProcess()
Implements the Manager interface, direct call to processExpires |
void | changeSessionId(Session session)
Change the session ID of the current session to a new randomly generated
session ID.
|
Session | createEmptySession()
Get a session from the recycled ones or create a new empty one.
|
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. |
void | destroy() |
void | expireSession(String sessionId) |
Session | findSession(String id)
Return the active Session, associated with this Manager, with the
specified session id (if any); otherwise return null .
|
Session[] | findSessions()
Return the set of active Sessions associated with this Manager.
|
protected String | generateSessionId()
Generate and return a new session identifier. |
int | getActiveSessions()
Returns the number of active sessions
|
String | getAlgorithm()
Return the message digest algorithm for this Manager. |
String | getClassName() Returns the name of the implementation class. |
Container | getContainer()
Return the Container with which this Manager is associated. |
String | getCreationTime(String sessionId) |
long | getCreationTimestamp(String sessionId) |
MessageDigest | getDigest()
Return the MessageDigest object to be used for calculating
session identifiers. |
boolean | getDistributable()
Return the distributable flag for the sessions supported by
this Manager. |
String | getDomain() |
int | getDuplicates()
Number of duplicated session IDs generated by the random source.
|
Engine | getEngine()
Retrieve the enclosing Engine for this Manager.
|
String | getEntropy()
Return the entropy increaser value, or compute a semi-useful value
if this String has not yet been set. |
int | getExpiredSessions()
Gets the number of sessions that have expired.
|
String | getInfo()
Return descriptive information about this Manager implementation and
the corresponding version number, in the format
<description>/<version> . |
String | getJvmRoute()
Retrieve the JvmRoute for the enclosing Engine. |
String | getLastAccessedTime(String sessionId) |
long | getLastAccessedTimestamp(String sessionId) |
int | getMaxActive()
Max number of concurrent active sessions
|
int | getMaxInactiveInterval()
Return the default maximum inactive interval (in seconds)
for Sessions created by this Manager. |
String | getName()
Return the descriptive short name of this Manager implementation. |
protected StandardSession | getNewSession()
Get new session class to be used in the doLoad() method. |
ObjectName | getObjectName() |
int | getProcessExpiresFrequency()
Return the frequency of manager checks. |
long | getProcessingTime() |
Random | getRandom()
Return the random number generator instance we should use for
generating session identifiers. |
protected void | getRandomBytes(byte[] bytes) |
String | getRandomClass()
Return the random number generator class name. |
String | getRandomFile() |
HashMap | getSession(String sessionId)
Returns information about the session with the given session id.
|
String | getSessionAttribute(String sessionId, String key)
For debugging: get a session attribute
|
int | getSessionAverageAliveTime()
Gets the average time (in seconds) that expired sessions had been
alive.
|
int | getSessionCounter()
Total sessions created by this manager.
|
int | getSessionIdLength()
Gets the session id length (in bytes) of Sessions created by
this Manager.
|
int | getSessionMaxAliveTime()
Gets the longest time (in seconds) that an expired session had been
alive.
|
void | init() |
String | listSessionIds()
For debugging: return a list of all session ids currently active
|
void | postDeregister() |
void | postRegister(Boolean registrationDone) |
void | preDeregister() |
ObjectName | preRegister(MBeanServer server, ObjectName name) |
void | processExpires()
Invalidate all sessions that have expired. |
void | remove(Session session)
Remove this Session from the active Sessions for this Manager.
|
void | removePropertyChangeListener(PropertyChangeListener listener)
Remove a property change listener from this component.
|
void | setAlgorithm(String algorithm)
Set the message digest algorithm for this Manager.
|
void | setContainer(Container container)
Set the Container with which this Manager is associated.
|
void | setDistributable(boolean distributable)
Set the distributable flag for the sessions supported by this
Manager. |
void | setDuplicates(int duplicates) |
void | setEntropy(String entropy)
Set the entropy increaser value.
|
void | setExpiredSessions(int expiredSessions)
Sets the number of sessions that have expired.
|
void | setMaxActive(int maxActive) |
void | setMaxInactiveInterval(int interval)
Set the default maximum inactive interval (in seconds)
for Sessions created by this Manager.
|
void | setProcessExpiresFrequency(int processExpiresFrequency)
Set the manager checks frequency.
|
void | setProcessingTime(long processingTime) |
void | setRandomClass(String randomClass)
Set the random number generator class name.
|
void | setRandomFile(String s)
Use /dev/random-type special device. |
void | setSessionAverageAliveTime(int sessionAverageAliveTime)
Sets the average time (in seconds) that expired sessions had been
alive.
|
void | setSessionCounter(int sessionCounter) |
void | setSessionIdLength(int idLength)
Sets the session id length (in bytes) for Sessions created by this
Manager.
|
void | setSessionMaxAliveTime(int sessionMaxAliveTime)
Sets the longest time (in seconds) that an expired session had been
alive.
|
java.security.MessageDigest
class on your platform.true
, any user attributes added to a
session controlled by this Manager must be Serializable.Parameters: session Session to be added
Parameters: listener The listener to add
Parameters: session The session to change the session ID for
Deprecated:
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, returnnull
.
Throws: IllegalStateException if a new session cannot be instantiated for any reason
null
.
Parameters: sessionId The session id which should be used to create the
new session; if null
, a new session id will be
generated
Throws: IllegalStateException if a new session cannot be instantiated for any reason
null
.
Parameters: id The session id for the session to be returned
Throws: IllegalStateException if a new session cannot be instantiated for any reason IOException if an input/output error occurs while processing this request
Returns: number of sessions active
Returns: The count of duplicates
Returns: an Engine object (or null).
Returns: Number of sessions that have expired
<description>/<version>
.Returns: the JvmRoute or null.
Returns: The highest number of concurrent active sessions
The session information is organized as a HashMap, mapping session attribute names to the String representation of their values.
Parameters: sessionId Session id
Returns: HashMap mapping session attribute names to the String representation of their values, or null if no session with the specified id exists, or if the session does not have any attributes
Parameters: sessionId key
Returns: The attribute value, if found, null otherwise
Returns: Average time (in seconds) that expired sessions had been alive.
Returns: sessions created
Returns: The session id length
Returns: Longest time (in seconds) that an expired session had been alive.
Parameters: session Session to be removed
Parameters: listener The listener to remove
Parameters: algorithm The new message digest algorithm
Parameters: container The newly associated Container
Parameters: distributable The new distributable flag
Parameters: entropy The new entropy increaser value
Parameters: expiredSessions Number of sessions that have expired
Parameters: interval The new default value
Parameters: processExpiresFrequency the new manager checks frequency
Parameters: randomClass The new random number generator class name
Parameters: sessionAverageAliveTime Average time (in seconds) that expired sessions had been alive.
Parameters: idLength The session id length
Parameters: sessionMaxAliveTime Longest time (in seconds) that an expired session had been alive.