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.
author: Craig R. McClanahan version: $Revision: 1.27 $ $Date: 2004/05/26 16:13:59 $
getInfo() Return descriptive information about this Manager implementation and
the corresponding version number, in the format
<description>/<version>.
The message digest algorithm to be used when generating session
identifiers. This must be an algorithm supported by the
java.security.MessageDigest class on your platform.
The distributable flag for Sessions created by this Manager. If this
flag is set to true, any user attributes added to a
session controlled by this Manager must be Serializable.
Get a session from the recycled ones or create a new empty one.
The PersistentManager manager does not need to create session data
because it reads it from the Store.
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
Return the active Session, associated with this Manager, with the
specified session id (if any); otherwise return null.
Parameters: id - The session id for the session to be returned exception: IllegalStateException - if a new session cannot beinstantiated for any reason exception: IOException - if an input/output error occurs whileprocessing this request
Return the MessageDigest object to be used for calculating
session identifiers. If none has been created yet, initialize
one the first time this method is called.
Return the random number generator instance we should use for
generating session identifiers. If there is no such generator
currently defined, construct and seed a new one.
Log a message on the Logger associated with our Container (if any).
Parameters: message - Message to be logged Parameters: throwable - Associated exception
Set the DefaultContext with which this Manager is associated.
Parameters: defaultContext - The newly associated DefaultContext
setDistributable
public void setDistributable(boolean distributable)(Code)
Set the distributable flag for the sessions supported by this
Manager. If this flag is set, all user data objects added to
sessions associated with this manager must implement Serializable.
Parameters: distributable - The new distributable flag
Use /dev/random-type special device. This is new code, but may reduce
the big delay in generating the random.
You must specify a path to a random generator file. Use /dev/urandom
for linux ( or similar ) systems. Use /dev/random for maximum security
( it may block if not enough "random" exist ). You can also use
a pipe that generates random.
The code will check if the file exists, and default to java Random
if not found. There is a significant performance difference, very
visible on the first call to getSession ( like in the first JSP )
- so use it if available.
setSessionCounter
public void setSessionCounter(int sessionCounter)(Code)
setSessionIdLength
public void setSessionIdLength(int idLength)(Code)
Sets the session id length (in bytes) for Sessions created by this
Manager.
Parameters: idLength - The session id length