Top Description Inners Fields Constructors Methods
org.apache.catalina.session

public Class StandardManager

extends ManagerBase
Class Inheritance
Imports
java.io.BufferedInputStream, .BufferedOutputStream, .File, .FileInputStream, .FileNotFoundException, .FileOutputStream, .IOException, .ObjectInputStream, .ObjectOutputStream, java.security.AccessController, .PrivilegedActionException, .PrivilegedExceptionAction, java.util.ArrayList, .List, jakarta.servlet.ServletContext, org.apache.catalina.Context, .LifecycleException, .LifecycleState, .Loader, .Session, org.apache.catalina.security.SecurityUtil, org.apache.catalina.util.CustomObjectInputStream, org.apache.juli.logging.Log, .LogFactory, org.apache.tomcat.util.ExceptionUtils

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.

Author
Craig R. McClanahan

Nested and Inner Type Summary

Modifier and TypeClass and Description
private class
private class

Field Summary

Modifier and TypeField and Description
private final Log
protected static final String
name

Hides org.apache.catalina.session.ManagerBase.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.

Inherited from org.apache.catalina.session.ManagerBase:
duplicatesexpiredSessionsmaxActivemaxActiveSessionsprocessExpiresFrequencyprocessingTimerejectedSessionssecureRandomAlgorithmsecureRandomClasssecureRandomProvidersessionCountersessionCreationTimingsessionExpirationTimingsessionIdGeneratorsessionIdGeneratorClasssessionMaxAliveTimesessionssmsupportTIMING_STATS_CACHE_SIZE

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected void
doLoad()

Load any currently active sessions that were previously unloaded to the appropriate persistence mechanism, if any.

protected void
doUnload()

Save any currently active sessions in the appropriate persistence mechanism, if any.

protected File

Returns:

the file
file
()

Return a File object representing the pathname to our persistence file, if any.

public String
public String

Returns:

The session persistence pathname, if any.
getPathname
()

public void
load()

Implements org.apache.catalina.Manager.load.

Load any currently active sessions that were previously unloaded to the appropriate persistence mechanism, if any.

public void
setPathname(String
New session persistence pathname
pathname
)

Set the session persistence pathname to the specified value.

protected void
protected void
public void
unload()

Implements org.apache.catalina.Manager.unload.

Save any currently active sessions in the appropriate persistence mechanism, if any.

Inherited from org.apache.catalina.session.ManagerBase:
addaddPropertyChangeListenerbackgroundProcesschangeSessionIdchangeSessionIdcreateEmptySessioncreateSessionexpireSessionfindSessionfindSessionsgenerateSessionIdgetActiveSessionsgetClassNamegetContextgetCreationTimegetCreationTimestampgetDomainInternalgetDuplicatesgetEnginegetExpiredSessionsgetJvmRoutegetLastAccessedTimegetLastAccessedTimestampgetMaxActivegetMaxActiveSessionsgetNewSessiongetNotifyAttributeListenerOnUnchangedValuegetNotifyBindingListenerOnUnchangedValuegetObjectNameKeyPropertiesgetPersistAuthenticationgetProcessExpiresFrequencygetProcessingTimegetRejectedSessionsgetSecureRandomAlgorithmgetSecureRandomClassgetSecureRandomProvidergetSessiongetSessionActivityCheckgetSessionAttributegetSessionAttributeNameFiltergetSessionAttributeNamePatterngetSessionAttributeValueClassNameFiltergetSessionAttributeValueClassNamePatterngetSessionAverageAliveTimegetSessionCountergetSessionCreateRategetSessionExpireRategetSessionIdGeneratorgetSessionLastAccessAtStartgetSessionMaxAliveTimegetThisAccessedTimegetThisAccessedTimestampgetWarnOnSessionAttributeFilterFailureinitInternallistSessionIdsprocessExpiresremoveremoveremovePropertyChangeListenerrotateSessionIdsetContextsetDuplicatessetExpiredSessionssetMaxActivesetMaxActiveSessionssetNotifyAttributeListenerOnUnchangedValuesetNotifyBindingListenerOnUnchangedValuesetPersistAuthenticationsetProcessExpiresFrequencysetProcessingTimesetSecureRandomAlgorithmsetSecureRandomClasssetSecureRandomProvidersetSessionActivityChecksetSessionAttributeNameFiltersetSessionAttributeValueClassNameFiltersetSessionCountersetSessionIdGeneratorsetSessionLastAccessAtStartsetSessionMaxAliveTimesetWarnOnSessionAttributeFilterFailuretoStringupdateSessionMaxAliveTimewillAttributeDistribute

Field Detail

logback to summary
private final Log log

Hides org.apache.catalina.session.ManagerBase.log.

nameback to summary
protected static final String name

Hides org.apache.catalina.session.ManagerBase.name.

The descriptive name of this Manager implementation (for logging).

pathnameback to summary
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 jakarta.servlet.context.tempdir context attribute.

Constructor Detail

StandardManagerback to summary
public StandardManager()

Method Detail

doLoadback to summary
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.

Exceptions
ClassNotFoundException:
if a serialized class cannot be found during the reload
IOException:
if an input/output error occurs
doUnloadback to summary
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.

Exceptions
IOException:
if an input/output error occurs
fileback to summary
protected File file()

Return a File object representing the pathname to our persistence file, if any.

Returns:File

the file

getNameback to summary
public String getName()

Overrides org.apache.catalina.session.ManagerBase.getName.

Returns:String

Doc from org.apache.catalina.session.ManagerBase.getName.

The descriptive short name of this Manager implementation.

Annotations
@Override
getPathnameback to summary
public String getPathname()
Returns:String

The session persistence pathname, if any.

loadback to summary
public void load() throws ClassNotFoundException, IOException

Implements org.apache.catalina.Manager.load.

Doc from org.apache.catalina.Manager.load.

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.

Annotations
@Override
Exceptions
ClassNotFoundException:
if a serialized class cannot be found during the reload
IOException:
if an input/output error occurs
setPathnameback to summary
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.

Parameters
pathname:String

New session persistence pathname

startInternalback to summary
protected void startInternal() throws LifecycleException

Overrides org.apache.catalina.session.ManagerBase.startInternal.

Start this component and implement the requirements of org.apache.catalina.util.LifecycleBase#startInternal().

Annotations
@Override
Exceptions
LifecycleException:
if this component detects a fatal error that prevents this component from being used
stopInternalback to summary
protected void stopInternal() throws LifecycleException

Overrides org.apache.catalina.session.ManagerBase.stopInternal.

Stop this component and implement the requirements of org.apache.catalina.util.LifecycleBase#stopInternal().

Annotations
@Override
Exceptions
LifecycleException:
if this component detects a fatal error that prevents this component from being used
unloadback to summary
public void unload() throws IOException

Implements org.apache.catalina.Manager.unload.

Doc from org.apache.catalina.Manager.unload.

Save any currently active sessions in the appropriate persistence mechanism, if any. If persistence is not supported, this method returns without doing anything.

Annotations
@Override
Exceptions
IOException:
if an input/output error occurs
org.apache.catalina.session back to summary

private Class StandardManager.PrivilegedDoLoad

extends Object
implements PrivilegedExceptionAction<Void>
Class Inheritance
All Implemented Interfaces
java.security.PrivilegedExceptionAction

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public Void
run()

Implements java.security.PrivilegedExceptionAction.run.

Performs the computation.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

PrivilegedDoLoadback to summary
pack-priv PrivilegedDoLoad()

Method Detail

runback to summary
public Void run() throws Exception

Implements java.security.PrivilegedExceptionAction.run.

Doc from java.security.PrivilegedExceptionAction.run.

Performs the computation. This method will be called by AccessController.doPrivileged after enabling privileges.

Returns:Void

a class-dependent value that may represent the results of the computation. Each class that implements PrivilegedExceptionAction should document what (if anything) this value represents.

Annotations
@Override
Exceptions
Exception:
an exceptional condition has occurred. Each class that implements PrivilegedExceptionAction should document the exceptions that its run method can throw.
org.apache.catalina.session back to summary

private Class StandardManager.PrivilegedDoUnload

extends Object
implements PrivilegedExceptionAction<Void>
Class Inheritance
  • java.lang.Object
  • org.apache.catalina.session.StandardManager.PrivilegedDoUnload
All Implemented Interfaces
java.security.PrivilegedExceptionAction

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public Void
run()

Implements java.security.PrivilegedExceptionAction.run.

Performs the computation.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

PrivilegedDoUnloadback to summary
pack-priv PrivilegedDoUnload()

Method Detail

runback to summary
public Void run() throws Exception

Implements java.security.PrivilegedExceptionAction.run.

Doc from java.security.PrivilegedExceptionAction.run.

Performs the computation. This method will be called by AccessController.doPrivileged after enabling privileges.

Returns:Void

a class-dependent value that may represent the results of the computation. Each class that implements PrivilegedExceptionAction should document what (if anything) this value represents.

Annotations
@Override
Exceptions
Exception:
an exceptional condition has occurred. Each class that implements PrivilegedExceptionAction should document the exceptions that its run method can throw.