|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.catalina.session.ManagerBase
Minimal implementation of the Manager interface that supports no session persistence or distributable capabilities. This class may be subclassed to create more sophisticated Manager implementations.
Field Summary | |
protected java.lang.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 int |
debug
The debugging detail level for this component. |
protected static java.lang.String |
DEFAULT_ALGORITHM
The default message digest algorithm to use if we cannot use the requested one. |
protected DefaultContext |
defaultContext
The DefaultContext with which this Manager is associated. |
protected java.lang.String |
devRandomSource
|
protected java.security.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 java.lang.String |
domain
|
protected int |
duplicates
|
protected java.lang.String |
entropy
A String initialization parameter used to increase the entropy of the initialization of our random number generator. |
protected boolean |
initialized
|
protected org.apache.commons.logging.Log |
log
|
protected int |
maxActive
|
protected int |
maxInactiveInterval
The default maximum inactive interval for Sessions created by this Manager. |
protected javax.management.MBeanServer |
mserver
|
protected static java.lang.String |
name
The descriptive name of this Manager implementation (for logging). |
protected javax.management.ObjectName |
oname
|
protected java.util.Random |
random
A random number generator to use when generating session identifiers. |
protected java.lang.String |
randomClass
The Java class name of the random number generator class to be used when generating session identifiers. |
protected java.io.DataInputStream |
randomIS
|
protected int |
sessionCounter
|
protected int |
sessionIdLength
The session id length of Sessions created by this Manager. |
protected java.util.HashMap |
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 java.beans.PropertyChangeSupport |
support
The property change support for this component. |
Constructor Summary | |
ManagerBase()
|
Method Summary | |
void |
add(Session session)
Add this Session to the set of active Sessions for this Manager. |
void |
addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Add a property change listener to this component. |
void |
backgroundProcess()
Implements the Manager interface, direct call to processExpires |
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. |
void |
destroy()
|
void |
expireSession(java.lang.String sessionId)
|
Session |
findSession(java.lang.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 java.lang.String |
generateSessionId()
Generate and return a new session identifier. |
int |
getActiveSessions()
Returns the number of active sessions |
java.lang.String |
getAlgorithm()
Return the message digest algorithm for this Manager. |
java.lang.String |
getClassName()
Returns the name of the implementation class. |
Container |
getContainer()
Return the Container with which this Manager is associated. |
int |
getDebug()
Return the debugging detail level for this component. |
DefaultContext |
getDefaultContext()
Return the DefaultContext with which this Manager is associated. |
java.security.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. |
java.lang.String |
getDomain()
|
int |
getDuplicates()
Number of duplicated session IDs generated by the random source. |
Engine |
getEngine()
Retrieve the enclosing Engine for this Manager. |
java.lang.String |
getEntropy()
Return the entropy increaser value, or compute a semi-useful value if this String has not yet been set. |
java.lang.String |
getInfo()
Return descriptive information about this Manager implementation and the corresponding version number, in the format <description>/<version> . |
java.lang.String |
getJvmRoute()
Retrieve the JvmRoute for the enclosing Engine. |
java.lang.String |
getLastAccessedTime(java.lang.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. |
java.lang.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. |
javax.management.ObjectName |
getObjectName()
|
java.util.Random |
getRandom()
Return the random number generator instance we should use for generating session identifiers. |
protected void |
getRandomBytes(byte[] bytes)
|
java.lang.String |
getRandomClass()
Return the random number generator class name. |
java.lang.String |
getRandomFile()
|
java.lang.String |
getSessionAttribute(java.lang.String sessionId,
java.lang.String key)
For debugging: get a session attribute |
int |
getSessionCounter()
Total sessions created by this manager. |
int |
getSessionIdLength()
Gets the session id length (in bytes) of Sessions created by this Manager. |
void |
init()
|
java.lang.String |
listSessionIds()
For debugging: return a list of all session ids currently active |
protected void |
log(java.lang.String message)
Deprecated. |
protected void |
log(java.lang.String message,
java.lang.Throwable throwable)
Deprecated. |
void |
postDeregister()
|
void |
postRegister(java.lang.Boolean registrationDone)
|
void |
preDeregister()
|
javax.management.ObjectName |
preRegister(javax.management.MBeanServer server,
javax.management.ObjectName name)
|
void |
remove(Session session)
Remove this Session from the active Sessions for this Manager. |
void |
removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Remove a property change listener from this component. |
void |
setAlgorithm(java.lang.String algorithm)
Set the message digest algorithm for this Manager. |
void |
setContainer(Container container)
Set the Container with which this Manager is associated. |
void |
setDebug(int debug)
Set the debugging detail level for this component. |
void |
setDefaultContext(DefaultContext defaultContext)
Set the DefaultContext 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(java.lang.String entropy)
Set the entropy increaser value. |
void |
setMaxActive(int maxActive)
(Re)sets the maximum number of sessions that have been active at the same time. |
void |
setMaxInactiveInterval(int interval)
Set the default maximum inactive interval (in seconds) for Sessions created by this Manager. |
void |
setRandomClass(java.lang.String randomClass)
Set the random number generator class name. |
void |
setRandomFile(java.lang.String s)
Use /dev/random-type special device. |
void |
setSessionCounter(int sessionCounter)
Sets the total number of sessions created by this manager. |
void |
setSessionIdLength(int idLength)
Sets the session id length (in bytes) for Sessions created by this Manager. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.apache.catalina.Manager |
getExpiredSessions, getRejectedSessions, load, setExpiredSessions, setRejectedSessions, unload |
Field Detail |
protected org.apache.commons.logging.Log log
protected java.io.DataInputStream randomIS
protected java.lang.String devRandomSource
protected static final java.lang.String DEFAULT_ALGORITHM
protected java.lang.String algorithm
java.security.MessageDigest
class on your platform.
protected Container container
protected int debug
protected DefaultContext defaultContext
protected java.security.MessageDigest digest
protected boolean distributable
true
, any user attributes added to a
session controlled by this Manager must be Serializable.
protected java.lang.String entropy
protected int maxInactiveInterval
protected int sessionIdLength
protected static java.lang.String name
protected java.util.Random random
protected java.lang.String randomClass
protected java.util.HashMap sessions
protected int sessionCounter
protected int maxActive
protected int duplicates
protected boolean initialized
protected static StringManager sm
protected java.beans.PropertyChangeSupport support
protected java.lang.String domain
protected javax.management.ObjectName oname
protected javax.management.MBeanServer mserver
Constructor Detail |
public ManagerBase()
Method Detail |
public java.lang.String getAlgorithm()
public void setAlgorithm(java.lang.String algorithm)
algorithm
- The new message digest algorithmpublic Container getContainer()
getContainer
in interface Manager
public void setContainer(Container container)
setContainer
in interface Manager
container
- The newly associated Containerpublic DefaultContext getDefaultContext()
getDefaultContext
in interface Manager
public void setDefaultContext(DefaultContext defaultContext)
setDefaultContext
in interface Manager
defaultContext
- The newly associated DefaultContextpublic int getDebug()
public void setDebug(int debug)
debug
- The new debugging detail levelpublic java.lang.String getClassName()
public java.security.MessageDigest getDigest()
public boolean getDistributable()
getDistributable
in interface Manager
public void setDistributable(boolean distributable)
setDistributable
in interface Manager
distributable
- The new distributable flagpublic java.lang.String getEntropy()
public void setEntropy(java.lang.String entropy)
entropy
- The new entropy increaser valuepublic java.lang.String getInfo()
<description>/<version>
.
getInfo
in interface Manager
public int getMaxInactiveInterval()
getMaxInactiveInterval
in interface Manager
public void setMaxInactiveInterval(int interval)
setMaxInactiveInterval
in interface Manager
interval
- The new default valuepublic int getSessionIdLength()
getSessionIdLength
in interface Manager
public void setSessionIdLength(int idLength)
setSessionIdLength
in interface Manager
idLength
- The session id lengthpublic java.lang.String getName()
public void setRandomFile(java.lang.String s)
public java.lang.String getRandomFile()
public java.util.Random getRandom()
public java.lang.String getRandomClass()
public void setRandomClass(java.lang.String randomClass)
randomClass
- The new random number generator class namepublic void backgroundProcess()
backgroundProcess
in interface Manager
public void destroy()
public void init()
public void add(Session session)
add
in interface Manager
session
- Session to be addedpublic void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
addPropertyChangeListener
in interface Manager
listener
- The listener to addpublic Session createSession()
null
.
createSession
in interface Manager
java.lang.IllegalStateException
- if a new session cannot be
instantiated for any reasonpublic Session createEmptySession()
createEmptySession
in interface Manager
public Session findSession(java.lang.String id) throws java.io.IOException
null
.
findSession
in interface Manager
id
- The session id for the session to be returned
java.lang.IllegalStateException
- if a new session cannot be
instantiated for any reason
java.io.IOException
- if an input/output error occurs while
processing this requestpublic Session[] findSessions()
findSessions
in interface Manager
public void remove(Session session)
remove
in interface Manager
session
- Session to be removedpublic void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
removePropertyChangeListener
in interface Manager
listener
- The listener to removeprotected StandardSession getNewSession()
protected void getRandomBytes(byte[] bytes)
protected java.lang.String generateSessionId()
public Engine getEngine()
public java.lang.String getJvmRoute()
protected void log(java.lang.String message)
message
- Message to be loggedprotected void log(java.lang.String message, java.lang.Throwable throwable)
message
- Message to be loggedthrowable
- Associated exceptionpublic void setSessionCounter(int sessionCounter)
Manager
setSessionCounter
in interface Manager
sessionCounter
- Total number of sessions created by this manager.public int getSessionCounter()
getSessionCounter
in interface Manager
public int getDuplicates()
public void setDuplicates(int duplicates)
public int getActiveSessions()
getActiveSessions
in interface Manager
public int getMaxActive()
getMaxActive
in interface Manager
public void setMaxActive(int maxActive)
Manager
setMaxActive
in interface Manager
maxActive
- Maximum number of sessions that have been active at
the same time.public java.lang.String listSessionIds()
public java.lang.String getSessionAttribute(java.lang.String sessionId, java.lang.String key)
sessionId
- key
-
public void expireSession(java.lang.String sessionId)
public java.lang.String getLastAccessedTime(java.lang.String sessionId)
public javax.management.ObjectName getObjectName()
public java.lang.String getDomain()
public javax.management.ObjectName preRegister(javax.management.MBeanServer server, javax.management.ObjectName name) throws java.lang.Exception
preRegister
in interface javax.management.MBeanRegistration
java.lang.Exception
public void postRegister(java.lang.Boolean registrationDone)
postRegister
in interface javax.management.MBeanRegistration
public void preDeregister() throws java.lang.Exception
preDeregister
in interface javax.management.MBeanRegistration
java.lang.Exception
public void postDeregister()
postDeregister
in interface javax.management.MBeanRegistration
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |