Package org.apache.catalina.session
Class StandardManager
- java.lang.Object
- 
- org.apache.catalina.util.LifecycleBase
- 
- org.apache.catalina.util.LifecycleMBeanBase
- 
- org.apache.catalina.session.ManagerBase
- 
- org.apache.catalina.session.StandardManager
 
 
 
 
- 
- All Implemented Interfaces:
- javax.management.MBeanRegistration,- JmxEnabled,- Lifecycle,- Manager
 
 public class StandardManager extends ManagerBase 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()andstop()methods of this class at the correct times.- Author:
- Craig R. McClanahan
 
- 
- 
Nested Class Summary- 
Nested classes/interfaces inherited from class org.apache.catalina.session.ManagerBaseManagerBase.SessionTiming
 - 
Nested classes/interfaces inherited from interface org.apache.catalina.LifecycleLifecycle.SingleUse
 
- 
 - 
Field SummaryFields Modifier and Type Field Description protected static java.lang.StringnameThe descriptive name of this Manager implementation (for logging).protected java.lang.StringpathnamePath name of the disk file in which active sessions are saved when we stop, and from which these sessions are loaded when we start.- 
Fields inherited from class org.apache.catalina.session.ManagerBaseduplicates, expiredSessions, maxActive, maxActiveSessions, processExpiresFrequency, processingTime, rejectedSessions, secureRandomAlgorithm, secureRandomClass, secureRandomProvider, sessionCounter, sessionCreationTiming, sessionExpirationTiming, sessionIdGenerator, sessionIdGeneratorClass, sessionMaxAliveTime, sessions, sm, support, TIMING_STATS_CACHE_SIZE
 - 
Fields inherited from class org.apache.catalina.util.LifecycleMBeanBasemserver
 - 
Fields inherited from interface org.apache.catalina.LifecycleAFTER_DESTROY_EVENT, AFTER_INIT_EVENT, AFTER_START_EVENT, AFTER_STOP_EVENT, BEFORE_DESTROY_EVENT, BEFORE_INIT_EVENT, BEFORE_START_EVENT, BEFORE_STOP_EVENT, CONFIGURE_START_EVENT, CONFIGURE_STOP_EVENT, PERIODIC_EVENT, START_EVENT, STOP_EVENT
 
- 
 - 
Constructor SummaryConstructors Constructor Description StandardManager()
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voiddoLoad()Load any currently active sessions that were previously unloaded to the appropriate persistence mechanism, if any.protected voiddoUnload()Save any currently active sessions in the appropriate persistence mechanism, if any.protected java.io.Filefile()Return a File object representing the pathname to our persistence file, if any.java.lang.StringgetName()java.lang.StringgetPathname()voidload()Load any currently active sessions that were previously unloaded to the appropriate persistence mechanism, if any.voidsetPathname(java.lang.String pathname)Set the session persistence pathname to the specified value.protected voidstartInternal()Start this component and implement the requirements ofLifecycleBase.startInternal().protected voidstopInternal()Stop this component and implement the requirements ofLifecycleBase.stopInternal().voidunload()Save any currently active sessions in the appropriate persistence mechanism, if any.- 
Methods inherited from class org.apache.catalina.session.ManagerBaseadd, addPropertyChangeListener, backgroundProcess, changeSessionId, changeSessionId, changeSessionId, createEmptySession, createSession, expireSession, findSession, findSessions, generateSessionId, getActiveSessions, getClassName, getContext, getCreationTime, getCreationTimestamp, getDomainInternal, getDuplicates, getEngine, getExpiredSessions, getJvmRoute, getLastAccessedTime, getLastAccessedTimestamp, getMaxActive, getMaxActiveSessions, getNewSession, getObjectNameKeyProperties, getPersistAuthentication, getPersistAuthenticationNotes, getProcessExpiresFrequency, getProcessingTime, getRejectedSessions, getSecureRandomAlgorithm, getSecureRandomClass, getSecureRandomProvider, getSession, getSessionAttribute, getSessionAttributeNameFilter, getSessionAttributeNamePattern, getSessionAttributeValueClassNameFilter, getSessionAttributeValueClassNamePattern, getSessionAverageAliveTime, getSessionCounter, getSessionCreateRate, getSessionExpireRate, getSessionIdGenerator, getSessionMaxAliveTime, getThisAccessedTime, getThisAccessedTimestamp, getWarnOnSessionAttributeFilterFailure, initInternal, listSessionIds, processExpires, remove, remove, removePropertyChangeListener, rotateSessionId, setContext, setDuplicates, setExpiredSessions, setMaxActive, setMaxActiveSessions, setPersistAuthentication, setPersistAuthenticationNotes, setProcessExpiresFrequency, setProcessingTime, setSecureRandomAlgorithm, setSecureRandomClass, setSecureRandomProvider, setSessionAttributeNameFilter, setSessionAttributeValueClassNameFilter, setSessionCounter, setSessionIdGenerator, setSessionMaxAliveTime, setWarnOnSessionAttributeFilterFailure, toString, updateSessionMaxAliveTime, willAttributeDistribute
 - 
Methods inherited from class org.apache.catalina.util.LifecycleMBeanBasedestroyInternal, getDomain, getObjectName, postDeregister, postRegister, preDeregister, preRegister, register, setDomain, unregister
 - 
Methods inherited from class org.apache.catalina.util.LifecycleBaseaddLifecycleListener, destroy, findLifecycleListeners, fireLifecycleEvent, getState, getStateName, getThrowOnFailure, init, removeLifecycleListener, setState, setState, setThrowOnFailure, start, stop
 
- 
 
- 
- 
- 
Field Detail- 
nameprotected static final java.lang.String name The descriptive name of this Manager implementation (for logging).- See Also:
- Constant Field Values
 
 - 
pathnameprotected 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. Anullvalue 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 thejavax.servlet.context.tempdircontext attribute.
 
- 
 - 
Method Detail- 
getNamepublic java.lang.String getName() - Overrides:
- getNamein class- ManagerBase
- Returns:
- The descriptive short name of this Manager implementation.
 
 - 
getPathnamepublic java.lang.String getPathname() - Returns:
- The session persistence pathname, if any.
 
 - 
setPathnamepublic void setPathname(java.lang.String pathname) Set the session persistence pathname to the specified value. If no persistence support is desired, set the pathname tonull.- Parameters:
- pathname- New session persistence pathname
 
 - 
loadpublic void load() throws java.lang.ClassNotFoundException, java.io.IOExceptionDescription copied from interface:ManagerLoad 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.- Throws:
- java.lang.ClassNotFoundException- if a serialized class cannot be found during the reload
- java.io.IOException- if an input/output error occurs
 
 - 
doLoadprotected void doLoad() throws java.lang.ClassNotFoundException, java.io.IOExceptionLoad 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.- Throws:
- java.lang.ClassNotFoundException- if a serialized class cannot be found during the reload
- java.io.IOException- if an input/output error occurs
 
 - 
unloadpublic void unload() throws java.io.IOExceptionDescription copied from interface:ManagerSave any currently active sessions in the appropriate persistence mechanism, if any. If persistence is not supported, this method returns without doing anything.- Throws:
- java.io.IOException- if an input/output error occurs
 
 - 
doUnloadprotected void doUnload() throws java.io.IOExceptionSave any currently active sessions in the appropriate persistence mechanism, if any. If persistence is not supported, this method returns without doing anything.- Throws:
- java.io.IOException- if an input/output error occurs
 
 - 
startInternalprotected void startInternal() throws LifecycleExceptionStart this component and implement the requirements ofLifecycleBase.startInternal().- Overrides:
- startInternalin class- ManagerBase
- Throws:
- LifecycleException- if this component detects a fatal error that prevents this component from being used
 
 - 
stopInternalprotected void stopInternal() throws LifecycleExceptionStop this component and implement the requirements ofLifecycleBase.stopInternal().- Overrides:
- stopInternalin class- ManagerBase
- Throws:
- LifecycleException- if this component detects a fatal error that prevents this component from being used
 
 - 
fileprotected java.io.File file() Return a File object representing the pathname to our persistence file, if any.- Returns:
- the file
 
 
- 
 
-