Save This Page
Home » apache-tomcat-6.0.26-src » org.apache » catalina » session » [javadoc | source]
org.apache.catalina.session
public class: StandardManager [javadoc | source]
java.lang.Object
   org.apache.catalina.session.ManagerBase
      org.apache.catalina.session.StandardManager

All Implemented Interfaces:
    PropertyChangeListener, Lifecycle, Manager, MBeanRegistration

Direct Known Subclasses:
    SimpleTcpReplicationManager, SimpleTcpReplicationManager, BackupManager

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 final  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. A 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    Has this component been started yet? 
protected  int rejectedSessions    Number of session creations that failed due to maxActiveSessions. 
protected  long processingTime    Processing time during session expiration. 
Fields inherited from org.apache.catalina.session.ManagerBase:
log,  randomIS,  devRandomSource,  DEFAULT_ALGORITHM,  algorithm,  container,  digest,  distributable,  entropy,  maxInactiveInterval,  sessionIdLength,  name,  random,  randomClass,  sessionMaxAliveTime,  sessionAverageAliveTime,  expiredSessions,  sessions,  sessionCounter,  maxActive,  duplicates,  initialized,  processingTime,  processExpiresFrequency,  sm,  support,  domain,  oname,  mserver
Method from org.apache.catalina.session.StandardManager Summary:
addLifecycleListener,   createSession,   doLoad,   doUnload,   file,   findLifecycleListeners,   getInfo,   getMaxActiveSessions,   getName,   getPathname,   getRejectedSessions,   load,   propertyChange,   removeLifecycleListener,   setContainer,   setMaxActiveSessions,   setPathname,   setRejectedSessions,   start,   stop,   unload
Methods from org.apache.catalina.session.ManagerBase:
add,   addPropertyChangeListener,   backgroundProcess,   changeSessionId,   createEmptySession,   createSession,   createSession,   destroy,   expireSession,   findSession,   findSessions,   generateSessionId,   getActiveSessions,   getAlgorithm,   getClassName,   getContainer,   getCreationTime,   getCreationTimestamp,   getDigest,   getDistributable,   getDomain,   getDuplicates,   getEngine,   getEntropy,   getExpiredSessions,   getInfo,   getJvmRoute,   getLastAccessedTime,   getLastAccessedTimestamp,   getMaxActive,   getMaxInactiveInterval,   getName,   getNewSession,   getObjectName,   getProcessExpiresFrequency,   getProcessingTime,   getRandom,   getRandomBytes,   getRandomClass,   getRandomFile,   getSession,   getSessionAttribute,   getSessionAverageAliveTime,   getSessionCounter,   getSessionIdLength,   getSessionMaxAliveTime,   init,   listSessionIds,   postDeregister,   postRegister,   preDeregister,   preRegister,   processExpires,   remove,   removePropertyChangeListener,   setAlgorithm,   setContainer,   setDistributable,   setDuplicates,   setEntropy,   setExpiredSessions,   setMaxActive,   setMaxInactiveInterval,   setProcessExpiresFrequency,   setProcessingTime,   setRandomClass,   setRandomFile,   setSessionAverageAliveTime,   setSessionCounter,   setSessionIdLength,   setSessionMaxAliveTime
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.catalina.session.StandardManager Detail:
 public  void addLifecycleListener(LifecycleListener listener) 
    Add a lifecycle event listener to this component.
 public Session createSession(String sessionId) 
    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.
 protected  void doLoad() throws ClassNotFoundException, IOException 
    Load any currently active sessions that were previously unloaded to the appropriate persistence mechanism, if any. If persistence is not supported, this method returns without doing anything.
 protected  void doUnload() throws IOException 
    Save any currently active sessions in the appropriate persistence mechanism, if any. If persistence is not supported, this method returns without doing anything.
 protected File file() 
    Return a File object representing the pathname to our persistence file, if any.
 public LifecycleListener[] findLifecycleListeners() 
    Get the lifecycle listeners associated with this lifecycle. If this Lifecycle has no listeners registered, a zero-length array is returned.
 public String getInfo() 
    Return descriptive information about this Manager implementation and the corresponding version number, in the format <description>/<version>.
 public int getMaxActiveSessions() 
    Return the maximum number of active Sessions allowed, or -1 for no limit.
 public String getName() 
    Return the descriptive short name of this Manager implementation.
 public String getPathname() 
    Return the session persistence pathname, if any.
 public int getRejectedSessions() 
    Number of session creations that failed due to maxActiveSessions
 public  void load() throws ClassNotFoundException, IOException 
    Load any currently active sessions that were previously unloaded to the appropriate persistence mechanism, if any. If persistence is not supported, this method returns without doing anything.
 public  void propertyChange(PropertyChangeEvent event) 
    Process property change events from our associated Context.
 public  void removeLifecycleListener(LifecycleListener listener) 
    Remove a lifecycle event listener from this component.
 public  void setContainer(Container container) 
    Set the Container with which this Manager has been associated. If it is a Context (the usual case), listen for changes to the session timeout property.
 public  void setMaxActiveSessions(int max) 
    Set the maximum number of actives Sessions allowed, or -1 for no limit.
 public  void setPathname(String pathname) 
    Set the session persistence pathname to the specified value. If no persistence support is desired, set the pathname to null.
 public  void setRejectedSessions(int rejectedSessions) 
 public  void start() throws LifecycleException 
    Prepare for the beginning of active use of the public methods of this component. This method should be called after configure(), and before any of the public methods of the component are utilized.
 public  void stop() throws LifecycleException 
    Gracefully terminate the active use of the public methods of this component. This method should be the last one called on a given instance of this component.
 public  void unload() throws IOException 
    Save any currently active sessions in the appropriate persistence mechanism, if any. If persistence is not supported, this method returns without doing anything.