org.apache.catalina.session

## Class ManagerBase

- java.lang.Object
- - org.apache.catalina.util.LifecycleBase
  - - org.apache.catalina.util.LifecycleMBeanBase
    - - org.apache.catalina.session.ManagerBase

- All Implemented Interfaces:
    java.beans.PropertyChangeListener, java.util.EventListener, javax.management.MBeanRegistration, Lifecycle, Manager
  Direct Known Subclasses:
    ClusterManagerBase, PersistentManagerBase, StandardManager

      public abstract class ManagerBase
      extends LifecycleMBeanBase
      implements Manager, java.beans.PropertyChangeListener

  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

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `protected static class` | `ManagerBase.SessionTiming`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected Container` | `container` The Container with which this Manager is associated.
    `protected boolean` | `distributable` The distributable flag for Sessions created by this Manager.
    `protected int` | `duplicates`
    `protected java.util.concurrent.atomic.AtomicLong` | `expiredSessions` Number of sessions that have expired.
    `protected int` | `maxActive`
    `protected int` | `maxActiveSessions` The maximum number of active Sessions allowed, or -1 for no limit.
    `protected int` | `maxInactiveInterval` The default maximum inactive interval for Sessions created by this Manager.
    `protected int` | `processExpiresFrequency` Frequency of the session expiration, and related manager operations.
    `protected long` | `processingTime` Processing time during session expiration.
    `protected int` | `rejectedSessions` Number of session creations that failed due to maxActiveSessions.
    `protected java.lang.String` | `secureRandomAlgorithm` The name of the algorithm to use to create instances of `SecureRandom` which are used to generate session IDs.
    `protected java.lang.String` | `secureRandomClass` The Java class name of the secure random number generator class to be used when generating session identifiers.
    `protected java.lang.String` | `secureRandomProvider` The name of the provider to use to create instances of `SecureRandom` which are used to generate session IDs.
    `protected static int` | `SESSION_ID_LENGTH_UNSET`
    `protected long` | `sessionCounter`
    `protected java.util.Deque<ManagerBase.SessionTiming>` | `sessionCreationTiming`
    `protected java.util.Deque<ManagerBase.SessionTiming>` | `sessionExpirationTiming`
    `protected SessionIdGenerator` | `sessionIdGenerator`
    `protected java.lang.Class<? extends SessionIdGenerator>` | `sessionIdGeneratorClass`
    `protected int` | `sessionIdLength` The session id length of Sessions created by this Manager.
    `protected int` | `sessionMaxAliveTime` The longest time (in seconds) that an expired session had been alive.
    `protected java.util.Map<java.lang.String,Session>` | `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.
    `protected static int` | `TIMING_STATS_CACHE_SIZE`

    - ### Fields inherited from class org.apache.catalina.util.LifecycleMBeanBase

      `mserver`

    - ### Fields inherited from interface org.apache.catalina.Lifecycle

      `AFTER_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 Summary

    Constructors
    Constructor and Description
    `ManagerBase()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `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
    `void` | `changeSessionId(Session session)` Change the session ID of the current session to a new randomly generated session ID.
    `Session` | `createEmptySession()` Get a session from the recycled ones or create a new empty one.
    `Session` | `createSession(java.lang.String sessionId)` Construct and return a new session object, based on the default settings specified by this Manager's properties.
    `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` | `getClassName()` Returns the name of the implementation class.
    `Container` | `getContainer()` Return the Container with which this Manager is associated.
    `java.lang.String` | `getCreationTime(java.lang.String sessionId)`
    `long` | `getCreationTimestamp(java.lang.String sessionId)`
    `boolean` | `getDistributable()` Return the distributable flag for the sessions supported by this Manager.
    `java.lang.String` | `getDomainInternal()` Method implemented by sub-classes to identify the domain in which MBeans should be registered.
    `int` | `getDuplicates()` Number of duplicated session IDs generated by the random source.
    `Engine` | `getEngine()` Retrieve the enclosing Engine for this Manager.
    `long` | `getExpiredSessions()` Gets the number of sessions that have expired.
    `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)`
    `long` | `getLastAccessedTimestamp(java.lang.String sessionId)`
    `int` | `getMaxActive()` Max number of concurrent active sessions
    `int` | `getMaxActiveSessions()` Return the maximum number of active Sessions allowed, or -1 for no limit.
    `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.
    `java.lang.String` | `getObjectNameKeyProperties()` Allow sub-classes to specify the key properties component of the `ObjectName` that will be used to register this component.
    `int` | `getProcessExpiresFrequency()` Return the frequency of manager checks.
    `long` | `getProcessingTime()`
    `int` | `getRejectedSessions()` Number of session creations that failed due to maxActiveSessions
    `java.lang.String` | `getSecureRandomAlgorithm()` Return the secure random number generator algorithm name.
    `java.lang.String` | `getSecureRandomClass()` Return the secure random number generator class name.
    `java.lang.String` | `getSecureRandomProvider()` Return the secure random number generator provider name.
    `java.util.HashMap<java.lang.String,java.lang.String>` | `getSession(java.lang.String sessionId)` Returns information about the session with the given session id.
    `java.lang.String` | `getSessionAttribute(java.lang.String sessionId, java.lang.String key)` For debugging: get a session attribute
    `int` | `getSessionAverageAliveTime()` Gets the average time (in seconds) that expired sessions had been alive based on the last 100 sessions to expire.
    `long` | `getSessionCounter()` Total sessions created by this manager.
    `int` | `getSessionCreateRate()` Gets the current rate of session creation (in session per minute) based on the creation time of the previous 100 sessions created.
    `int` | `getSessionExpireRate()` Gets the current rate of session expiration (in session per minute) based on the expiry time of the previous 100 sessions expired.
    `SessionIdGenerator` | `getSessionIdGenerator()` Gets the session id generator.
    `int` | `getSessionIdLength()` Deprecated. Use `SessionIdGenerator.getSessionIdLength()`. This method will be removed in Tomcat 9 onwards.
    `int` | `getSessionMaxAliveTime()` Gets the longest time (in seconds) that an expired session had been alive.
    `java.lang.String` | `getThisAccessedTime(java.lang.String sessionId)`
    `long` | `getThisAccessedTimestamp(java.lang.String sessionId)`
    `protected void` | `initInternal()` Sub-classes wishing to perform additional initialization should override this method, ensuring that super.initInternal() is the first call in the overriding method.
    `java.lang.String` | `listSessionIds()` For debugging: return a list of all session ids currently active
    `void` | `processExpires()` Invalidate all sessions that have expired.
    `void` | `propertyChange(java.beans.PropertyChangeEvent event)` Process property change events from our associated Context.
    `void` | `remove(Session session)` Remove this Session from the active Sessions for this Manager.
    `void` | `remove(Session session, boolean update)` 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` | `setContainer(Container container)` Set the Container 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` | `setExpiredSessions(long expiredSessions)` Sets the number of sessions that have expired.
    `void` | `setMaxActive(int maxActive)` (Re)sets the maximum number of sessions that have been active at the same time.
    `void` | `setMaxActiveSessions(int max)` Set the maximum number of active Sessions allowed, or -1 for no limit.
    `void` | `setMaxInactiveInterval(int interval)` Set the default maximum inactive interval (in seconds) for Sessions created by this Manager.
    `void` | `setProcessExpiresFrequency(int processExpiresFrequency)` Set the manager checks frequency.
    `void` | `setProcessingTime(long processingTime)`
    `void` | `setSecureRandomAlgorithm(java.lang.String secureRandomAlgorithm)` Set the secure random number generator algorithm name.
    `void` | `setSecureRandomClass(java.lang.String secureRandomClass)` Set the secure random number generator class name.
    `void` | `setSecureRandomProvider(java.lang.String secureRandomProvider)` Set the secure random number generator provider name.
    `void` | `setSessionCounter(long sessionCounter)` Sets the total number of sessions created by this manager.
    `void` | `setSessionIdGenerator(SessionIdGenerator sessionIdGenerator)` Sets the session id generator
    `void` | `setSessionIdLength(int idLength)` Deprecated. Use `SessionIdGenerator.setSessionIdLength(int)`. This method will be removed in Tomcat 9 onwards.
    `void` | `setSessionMaxAliveTime(int sessionMaxAliveTime)` Sets the longest time (in seconds) that an expired session had been alive.
    `protected void` | `startInternal()` Sub-classes must ensure that the state is changed to `LifecycleState.STARTING` during the execution of this method.
    `protected void` | `stopInternal()` Sub-classes must ensure that the state is changed to `LifecycleState.STOPPING` during the execution of this method.
    `java.lang.String` | `toString()` Return a String rendering of this object.
    `void` | `updateSessionMaxAliveTime(int sessionAliveTime)` Updates the sessionMaxAliveTime attribute if the candidate value is larger than the current value.

    - ### Methods inherited from class org.apache.catalina.util.LifecycleMBeanBase

      `destroyInternal, getDomain, getObjectName, postDeregister, postRegister, preDeregister, preRegister, register, setDomain, unregister`

    - ### Methods inherited from class org.apache.catalina.util.LifecycleBase

      `addLifecycleListener, destroy, findLifecycleListeners, fireLifecycleEvent, getState, getStateName, init, removeLifecycleListener, setState, setState, start, stop`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

    - ### Methods inherited from interface org.apache.catalina.Manager

      `load, unload`

- - ### Field Detail

    - #### container

          protected Container container

      The Container with which this Manager is associated.

    - #### distributable

          protected boolean distributable

      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.

    - #### maxInactiveInterval

          protected int maxInactiveInterval

      The default maximum inactive interval for Sessions created by this Manager.

    - #### SESSION_ID_LENGTH_UNSET

          protected static final int SESSION_ID_LENGTH_UNSET

      See Also:
        Constant Field Values

    - #### sessionIdLength

          protected int sessionIdLength

      The session id length of Sessions created by this Manager. The length should be set directly on the SessionIdGenerator. Setting it here is deprecated.

    - #### secureRandomClass

          protected java.lang.String secureRandomClass

      The Java class name of the secure random number generator class to be used when generating session identifiers. The random number generator class must be self-seeding and have a zero-argument constructor. If not specified, an instance of `SecureRandom` will be generated.

    - #### secureRandomAlgorithm

          protected java.lang.String secureRandomAlgorithm

      The name of the algorithm to use to create instances of `SecureRandom` which are used to generate session IDs. If no algorithm is specified, SHA1PRNG is used. To use the platform default (which may be SHA1PRNG), specify the empty string. If an invalid algorithm and/or provider is specified the SecureRandom instances will be created using the defaults. If that fails, the SecureRandom instances will be created using platform defaults.

    - #### secureRandomProvider

          protected java.lang.String secureRandomProvider

      The name of the provider to use to create instances of `SecureRandom` which are used to generate session IDs. If no algorithm is specified the of SHA1PRNG default is used. If an invalid algorithm and/or provider is specified the SecureRandom instances will be created using the defaults. If that fails, the SecureRandom instances will be created using platform defaults.

    - #### sessionIdGenerator

          protected SessionIdGenerator sessionIdGenerator

    - #### sessionIdGeneratorClass

          protected java.lang.Class<? extends SessionIdGenerator> sessionIdGeneratorClass

    - #### sessionMaxAliveTime

          protected volatile int sessionMaxAliveTime

      The longest time (in seconds) that an expired session had been alive.

    - #### TIMING_STATS_CACHE_SIZE

          protected static final int TIMING_STATS_CACHE_SIZE

      See Also:
        Constant Field Values

    - #### sessionCreationTiming

          protected final java.util.Deque<ManagerBase.SessionTiming> sessionCreationTiming

    - #### sessionExpirationTiming

          protected final java.util.Deque<ManagerBase.SessionTiming> sessionExpirationTiming

    - #### expiredSessions

          protected final java.util.concurrent.atomic.AtomicLong expiredSessions

      Number of sessions that have expired.

    - #### sessions

          protected java.util.Map<java.lang.String,Session> sessions

      The set of currently active Sessions for this Manager, keyed by session identifier.

    - #### sessionCounter

          protected long sessionCounter

    - #### maxActive

          protected volatile int maxActive

    - #### maxActiveSessions

          protected int maxActiveSessions

      The maximum number of active Sessions allowed, or -1 for no limit.

    - #### rejectedSessions

          protected int rejectedSessions

      Number of session creations that failed due to maxActiveSessions.

    - #### duplicates

          protected volatile int duplicates

    - #### processingTime

          protected long processingTime

      Processing time during session expiration.

    - #### processExpiresFrequency

          protected int processExpiresFrequency

      Frequency of the session expiration, and related manager operations. Manager operations will be done once for the specified amount of backgrondProcess calls (ie, the lower the amount, the most often the checks will occur).

    - #### sm

          protected static final StringManager sm

      The string manager for this package.

    - #### support

          protected final java.beans.PropertyChangeSupport support

      The property change support for this component.

  - ### Constructor Detail

    - #### ManagerBase

          public ManagerBase()

  - ### Method Detail

    - #### getContainer

          public Container getContainer()

      Return the Container with which this Manager is associated.
      Specified by:
        `getContainer` in interface `Manager`

    - #### setContainer

          public void setContainer(Container container)

      Set the Container with which this Manager is associated.
      Specified by:
        `setContainer` in interface `Manager`
      Parameters:
        `container` - The newly associated Container

    - #### getClassName

          public java.lang.String getClassName()

      Returns the name of the implementation class.

    - #### getDistributable

          public boolean getDistributable()

      Return the distributable flag for the sessions supported by this Manager.
      Specified by:
        `getDistributable` in interface `Manager`

    - #### setDistributable

          public void setDistributable(boolean distributable)

      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.
      Specified by:
        `setDistributable` in interface `Manager`
      Parameters:
        `distributable` - The new distributable flag

    - #### getInfo

          public java.lang.String getInfo()

      Return descriptive information about this Manager implementation and the corresponding version number, in the format `<description>/<version>`.
      Specified by:
        `getInfo` in interface `Manager`

    - #### getMaxInactiveInterval

          public int getMaxInactiveInterval()

      Return the default maximum inactive interval (in seconds) for Sessions created by this Manager.
      Specified by:
        `getMaxInactiveInterval` in interface `Manager`

    - #### setMaxInactiveInterval

          public void setMaxInactiveInterval(int interval)

      Set the default maximum inactive interval (in seconds) for Sessions created by this Manager.
      Specified by:
        `setMaxInactiveInterval` in interface `Manager`
      Parameters:
        `interval` - The new default value

    - #### getSessionIdLength

          @Deprecated
          public int getSessionIdLength()

      Deprecated. Use `SessionIdGenerator.getSessionIdLength()`. This method will be removed in Tomcat 9 onwards.
      Gets the session id length (in bytes) of Sessions created by this Manager.
      Specified by:
        `getSessionIdLength` in interface `Manager`
      Returns:
        The session id length

    - #### setSessionIdLength

          @Deprecated
          public void setSessionIdLength(int idLength)

      Deprecated. Use `SessionIdGenerator.setSessionIdLength(int)`. This method will be removed in Tomcat 9 onwards.
      Sets the session id length (in bytes) for Sessions created by this Manager.
      Specified by:
        `setSessionIdLength` in interface `Manager`
      Parameters:
        `idLength` - The session id length

    - #### getSessionIdGenerator

          public SessionIdGenerator getSessionIdGenerator()

      Gets the session id generator.
      Returns:
        The session id generator

    - #### setSessionIdGenerator

          public void setSessionIdGenerator(SessionIdGenerator sessionIdGenerator)

      Sets the session id generator
      Parameters:
        `sessionIdGenerator` - The session id generator

    - #### getName

          public java.lang.String getName()

      Return the descriptive short name of this Manager implementation.

    - #### getSecureRandomClass

          public java.lang.String getSecureRandomClass()

      Return the secure random number generator class name.

    - #### setSecureRandomClass

          public void setSecureRandomClass(java.lang.String secureRandomClass)

      Set the secure random number generator class name.
      Parameters:
        `secureRandomClass` - The new secure random number generator class name

    - #### getSecureRandomAlgorithm

          public java.lang.String getSecureRandomAlgorithm()

      Return the secure random number generator algorithm name.

    - #### setSecureRandomAlgorithm

          public void setSecureRandomAlgorithm(java.lang.String secureRandomAlgorithm)

      Set the secure random number generator algorithm name.
      Parameters:
        `secureRandomAlgorithm` - The new secure random number generator algorithm name

    - #### getSecureRandomProvider

          public java.lang.String getSecureRandomProvider()

      Return the secure random number generator provider name.

    - #### setSecureRandomProvider

          public void setSecureRandomProvider(java.lang.String secureRandomProvider)

      Set the secure random number generator provider name.
      Parameters:
        `secureRandomProvider` - The new secure random number generator provider name

    - #### getRejectedSessions

          public int getRejectedSessions()

      Number of session creations that failed due to maxActiveSessions
      Specified by:
        `getRejectedSessions` in interface `Manager`
      Returns:
        The count

    - #### getExpiredSessions

          public long getExpiredSessions()

      Gets the number of sessions that have expired.
      Specified by:
        `getExpiredSessions` in interface `Manager`
      Returns:
        Number of sessions that have expired

    - #### setExpiredSessions

          public void setExpiredSessions(long expiredSessions)

      Sets the number of sessions that have expired.
      Specified by:
        `setExpiredSessions` in interface `Manager`
      Parameters:
        `expiredSessions` - Number of sessions that have expired

    - #### getProcessingTime

          public long getProcessingTime()

    - #### setProcessingTime

          public void setProcessingTime(long processingTime)

    - #### getProcessExpiresFrequency

          public int getProcessExpiresFrequency()

      Return the frequency of manager checks.

    - #### setProcessExpiresFrequency

          public void setProcessExpiresFrequency(int processExpiresFrequency)

      Set the manager checks frequency.
      Parameters:
        `processExpiresFrequency` - the new manager checks frequency

    - #### backgroundProcess

          public void backgroundProcess()

      Implements the Manager interface, direct call to processExpires
      Specified by:
        `backgroundProcess` in interface `Manager`

    - #### processExpires

          public void processExpires()

      Invalidate all sessions that have expired.

    - #### initInternal

          protected void initInternal()
                               throws LifecycleException

      Description copied from class: `LifecycleMBeanBase`
      Sub-classes wishing to perform additional initialization should override this method, ensuring that super.initInternal() is the first call in the overriding method.
      Overrides:
        `initInternal` in class `LifecycleMBeanBase`
      Throws:
        `LifecycleException`

    - #### startInternal

          protected void startInternal()
                                throws LifecycleException

      Description copied from class: `LifecycleBase`
      Sub-classes must ensure that the state is changed to `LifecycleState.STARTING` during the execution of this method. Changing state will trigger the `Lifecycle.START_EVENT` event. If a component fails to start it may either throw a `LifecycleException` which will cause it's parent to fail to start or it can place itself in the error state in which case `LifecycleBase.stop()` will be called on the failed component but the parent component will continue to start normally.
      Specified by:
        `startInternal` in class `LifecycleBase`
      Throws:
        `LifecycleException`

    - #### stopInternal

          protected void stopInternal()
                               throws LifecycleException

      Description copied from class: `LifecycleBase`
      Sub-classes must ensure that the state is changed to `LifecycleState.STOPPING` during the execution of this method. Changing state will trigger the `Lifecycle.STOP_EVENT` event.
      Specified by:
        `stopInternal` in class `LifecycleBase`
      Throws:
        `LifecycleException`

    - #### add

          public void add(Session session)

      Add this Session to the set of active Sessions for this Manager.
      Specified by:
        `add` in interface `Manager`
      Parameters:
        `session` - Session to be added

    - #### addPropertyChangeListener

          public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)

      Add a property change listener to this component.
      Specified by:
        `addPropertyChangeListener` in interface `Manager`
      Parameters:
        `listener` - The listener to add

    - #### createSession

          public Session createSession(java.lang.String sessionId)

      Construct and return a new session object, based on the default settings specified by this Manager's properties. The session id specified will be used as the session id. If a new session cannot be created for any reason, return `null`.
      Specified by:
        `createSession` in interface `Manager`
      Parameters:
        `sessionId` - The session id which should be used to create the new session; if `null`, a new session id will be generated
      Throws:
        `java.lang.IllegalStateException` - if a new session cannot be instantiated for any reason

    - #### createEmptySession

          public Session createEmptySession()

      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.
      Specified by:
        `createEmptySession` in interface `Manager`

    - #### findSession

          public Session findSession(java.lang.String id)
                              throws java.io.IOException

      Return the active Session, associated with this Manager, with the specified session id (if any); otherwise return `null`.
      Specified by:
        `findSession` in interface `Manager`
      Parameters:
        `id` - The session id for the session to be returned
      Throws:
        `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 request

    - #### findSessions

          public Session[] findSessions()

      Return the set of active Sessions associated with this Manager. If this Manager has no active Sessions, a zero-length array is returned.
      Specified by:
        `findSessions` in interface `Manager`

    - #### remove

          public void remove(Session session)

      Remove this Session from the active Sessions for this Manager.
      Specified by:
        `remove` in interface `Manager`
      Parameters:
        `session` - Session to be removed

    - #### remove

          public void remove(Session session,
                    boolean update)

      Remove this Session from the active Sessions for this Manager.
      Specified by:
        `remove` in interface `Manager`
      Parameters:
        `session` - Session to be removed
        `update` - Should the expiration statistics be updated

    - #### removePropertyChangeListener

          public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)

      Remove a property change listener from this component.
      Specified by:
        `removePropertyChangeListener` in interface `Manager`
      Parameters:
        `listener` - The listener to remove

    - #### changeSessionId

          public void changeSessionId(Session session)

      Change the session ID of the current session to a new randomly generated session ID.
      Specified by:
        `changeSessionId` in interface `Manager`
      Parameters:
        `session` - The session to change the session ID for

    - #### getNewSession

          protected StandardSession getNewSession()

      Get new session class to be used in the doLoad() method.

    - #### generateSessionId

          protected java.lang.String generateSessionId()

      Generate and return a new session identifier.

    - #### getEngine

          public Engine getEngine()

      Retrieve the enclosing Engine for this Manager.
      Returns:
        an Engine object (or null).

    - #### getJvmRoute

          public java.lang.String getJvmRoute()

      Retrieve the JvmRoute for the enclosing Engine.
      Returns:
        the JvmRoute or null.

    - #### setSessionCounter

          public void setSessionCounter(long sessionCounter)

      Description copied from interface: `Manager`
      Sets the total number of sessions created by this manager.
      Specified by:
        `setSessionCounter` in interface `Manager`
      Parameters:
        `sessionCounter` - Total number of sessions created by this manager.

    - #### getSessionCounter

          public long getSessionCounter()

      Total sessions created by this manager.
      Specified by:
        `getSessionCounter` in interface `Manager`
      Returns:
        sessions created

    - #### getDuplicates

          public int getDuplicates()

      Number of duplicated session IDs generated by the random source. Anything bigger than 0 means problems.
      Returns:
        The count of duplicates

    - #### setDuplicates

          public void setDuplicates(int duplicates)

    - #### getActiveSessions

          public int getActiveSessions()

      Returns the number of active sessions
      Specified by:
        `getActiveSessions` in interface `Manager`
      Returns:
        number of sessions active

    - #### getMaxActive

          public int getMaxActive()

      Max number of concurrent active sessions
      Specified by:
        `getMaxActive` in interface `Manager`
      Returns:
        The highest number of concurrent active sessions

    - #### setMaxActive

          public void setMaxActive(int maxActive)

      Description copied from interface: `Manager`
      (Re)sets the maximum number of sessions that have been active at the same time.
      Specified by:
        `setMaxActive` in interface `Manager`
      Parameters:
        `maxActive` - Maximum number of sessions that have been active at the same time.

    - #### getMaxActiveSessions

          public int getMaxActiveSessions()

      Return the maximum number of active Sessions allowed, or -1 for no limit.

    - #### setMaxActiveSessions

          public void setMaxActiveSessions(int max)

      Set the maximum number of active Sessions allowed, or -1 for no limit.
      Parameters:
        `max` - The new maximum number of sessions

    - #### getSessionMaxAliveTime

          public int getSessionMaxAliveTime()

      Gets the longest time (in seconds) that an expired session had been alive.
      Specified by:
        `getSessionMaxAliveTime` in interface `Manager`
      Returns:
        Longest time (in seconds) that an expired session had been alive.

    - #### setSessionMaxAliveTime

          public void setSessionMaxAliveTime(int sessionMaxAliveTime)

      Sets the longest time (in seconds) that an expired session had been alive. Typically used for resetting the current value.
      Specified by:
        `setSessionMaxAliveTime` in interface `Manager`
      Parameters:
        `sessionMaxAliveTime` - Longest time (in seconds) that an expired session had been alive.

    - #### updateSessionMaxAliveTime

          public void updateSessionMaxAliveTime(int sessionAliveTime)

      Updates the sessionMaxAliveTime attribute if the candidate value is larger than the current value.
      Parameters:
        `sessionAliveTime` - The candidate value (in seconds) for the new sessionMaxAliveTime value.

    - #### getSessionAverageAliveTime

          public int getSessionAverageAliveTime()

      Gets the average time (in seconds) that expired sessions had been alive based on the last 100 sessions to expire. If less than 100 sessions have expired then all available data is used.
      Specified by:
        `getSessionAverageAliveTime` in interface `Manager`
      Returns:
        Average time (in seconds) that expired sessions had been alive.

    - #### getSessionCreateRate

          public int getSessionCreateRate()

      Gets the current rate of session creation (in session per minute) based on the creation time of the previous 100 sessions created. If less than 100 sessions have been created then all available data is used.
      Specified by:
        `getSessionCreateRate` in interface `Manager`
      Returns:
        The current rate (in sessions per minute) of session creation

    - #### getSessionExpireRate

          public int getSessionExpireRate()

      Gets the current rate of session expiration (in session per minute) based on the expiry time of the previous 100 sessions expired. If less than 100 sessions have expired then all available data is used.
      Specified by:
        `getSessionExpireRate` in interface `Manager`
      Returns:
        The current rate (in sessions per minute) of session expiration

    - #### listSessionIds

          public java.lang.String listSessionIds()

      For debugging: return a list of all session ids currently active

    - #### getSessionAttribute

          public java.lang.String getSessionAttribute(java.lang.String sessionId,
                                             java.lang.String key)

      For debugging: get a session attribute
      Parameters:
        `sessionId` -
        `key` -
      Returns:
        The attribute value, if found, null otherwise

    - #### getSession

          public java.util.HashMap<java.lang.String,java.lang.String> getSession(java.lang.String sessionId)

      Returns information about the session with the given session id.

      The session information is organized as a HashMap, mapping session attribute names to the String representation of their values.

      Parameters:
        `sessionId` - Session id
      Returns:
        HashMap mapping session attribute names to the String representation of their values, or null if no session with the specified id exists, or if the session does not have any attributes

    - #### expireSession

          public void expireSession(java.lang.String sessionId)

    - #### getThisAccessedTimestamp

          public long getThisAccessedTimestamp(java.lang.String sessionId)

    - #### getThisAccessedTime

          public java.lang.String getThisAccessedTime(java.lang.String sessionId)

    - #### getLastAccessedTimestamp

          public long getLastAccessedTimestamp(java.lang.String sessionId)

    - #### getLastAccessedTime

          public java.lang.String getLastAccessedTime(java.lang.String sessionId)

    - #### getCreationTime

          public java.lang.String getCreationTime(java.lang.String sessionId)

    - #### getCreationTimestamp

          public long getCreationTimestamp(java.lang.String sessionId)

    - #### toString

          public java.lang.String toString()

      Return a String rendering of this object.
      Overrides:
        `toString` in class `java.lang.Object`

    - #### getObjectNameKeyProperties

          public java.lang.String getObjectNameKeyProperties()

      Description copied from class: `LifecycleMBeanBase`
      Allow sub-classes to specify the key properties component of the `ObjectName` that will be used to register this component.
      Specified by:
        `getObjectNameKeyProperties` in class `LifecycleMBeanBase`
      Returns:
        The string representation of the key properties component of the desired `ObjectName`

    - #### getDomainInternal

          public java.lang.String getDomainInternal()

      Description copied from class: `LifecycleMBeanBase`
      Method implemented by sub-classes to identify the domain in which MBeans should be registered.
      Specified by:
        `getDomainInternal` in class `LifecycleMBeanBase`
      Returns:
        The name of the domain to use to register MBeans.

    - #### propertyChange

          public void propertyChange(java.beans.PropertyChangeEvent event)

      Process property change events from our associated Context.
      Specified by:
        `propertyChange` in interface `java.beans.PropertyChangeListener`
      Parameters:
        `event` - The property change event that has occurred

Copyright © 2000-2015 Apache Software Foundation. All Rights Reserved.