DeltaSessionManager (Apache Geode 1.13.0)
Date: 2020-09-07

org.apache.geode.modules.session.catalina

## Class DeltaSessionManager

- java.lang.Object
- - org.apache.catalina.session.ManagerBase
  - - org.apache.geode.modules.session.catalina.DeltaSessionManager

- All Implemented Interfaces:
    PropertyChangeListener, EventListener, MBeanRegistration, org.apache.catalina.Lifecycle, org.apache.catalina.Manager, SessionManager
  Direct Known Subclasses:
    Tomcat6DeltaSessionManager, Tomcat7DeltaSessionManager, Tomcat8DeltaSessionManager, Tomcat9DeltaSessionManager

      public abstract class DeltaSessionManager
      extends org.apache.catalina.session.ManagerBase
      implements org.apache.catalina.Lifecycle, PropertyChangeListener, SessionManager

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class org.apache.catalina.session.ManagerBase

      `org.apache.catalina.session.ManagerBase.SessionTiming`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected String` | `name` The name of this `Manager`
    `protected String` | `regionName`
    `protected AtomicBoolean` | `started` Has this `Manager` been started?

    - ### Fields inherited from class org.apache.catalina.session.ManagerBase

      `algorithm, container, DEFAULT_ALGORITHM, devRandomSource, digest, distributable, domain, duplicates, entropy, expiredSessions, initialized, log, maxActive, maxInactiveInterval, mserver, oname, processExpiresFrequency, processingTime, random, randomClass, randomIS, sessionAverageAliveTime, sessionCounter, sessionCreationTiming, sessionExpirationTiming, sessionIdLength, sessionMaxAliveTime, sessions, sm, support, TIMING_STATS_CACHE_SIZE`

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

      `AFTER_START_EVENT, AFTER_STOP_EVENT, BEFORE_START_EVENT, BEFORE_STOP_EVENT, DESTROY_EVENT, INIT_EVENT, PERIODIC_EVENT, START_EVENT, STOP_EVENT`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `DeltaSessionManager()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `add(org.apache.catalina.Session session)`
    `protected void` | `cancelTimer()`
    `org.apache.catalina.Session` | `findSession(String id)`
    `int` | `getActiveSessions()` Returns the number of active sessions
    `boolean` | `getEnableDebugListener()`
    `boolean` | `getEnableGatewayDeltaReplication()`
    `boolean` | `getEnableGatewayReplication()`
    `boolean` | `getEnableLocalCache()`
    `org.apache.juli.logging.Log` | `getLogger()`
    `int` | `getMaxActiveSessions()`
    `protected org.apache.catalina.session.StandardSession` | `getNewSession()`
    `boolean` | `getPreferDeserializedForm()`
    `String` | `getRegionAttributesId()`
    `String` | `getRegionName()`
    `int` | `getRejectedSessions()`
    `SessionCache` | `getSessionCache()`
    `protected Set<String>` | `getSessionsToTouch()`
    `org.apache.geode.modules.session.catalina.internal.DeltaSessionStatistics` | `getStatistics()`
    `String` | `getStatisticsName()`
    `org.apache.catalina.Context` | `getTheContext()`
    `protected void` | `initializeSessionCache()`
    `boolean` | `isBackingCacheAvailable()`
    `boolean` | `isClientServer()`
    `boolean` | `isCommitValveEnabled()`
    `boolean` | `isCommitValveFailfastEnabled()`
    `String` | `listSessionIds()` For debugging: return a list of all session ids currently active
    `void` | `load()`
    `void` | `propertyChange(PropertyChangeEvent event)` Process property change events from our associated Context.
    `protected void` | `registerCommitSessionValve()`
    `protected void` | `registerJvmRouteBinderValve()`
    `void` | `remove(org.apache.catalina.Session session)`
    `void` | `remove(org.apache.catalina.Session session, boolean update)`
    `protected void` | `scheduleTimerTasks()`
    `void` | `setContainer(org.apache.catalina.Container container)` This method was taken from StandardManager to set the default maxInactiveInterval based on the container (to 30 minutes).
    `void` | `setEnableCommitValve(boolean enable)`
    `void` | `setEnableCommitValveFailfast(boolean enable)`
    `void` | `setEnableDebugListener(boolean enableDebugListener)`
    `void` | `setEnableGatewayDeltaReplication(boolean enableGatewayDeltaReplication)`
    `void` | `setEnableGatewayReplication(boolean enableGatewayReplication)`
    `void` | `setEnableLocalCache(boolean enableLocalCache)`
    `void` | `setMaxActiveSessions(int maxActiveSessions)`
    `void` | `setMaxInactiveInterval(int interval)`
    `void` | `setPreferDeserializedForm(boolean enable)`
    `void` | `setRegionAttributesId(String regionType)`
    `void` | `setRegionName(String regionName)`
    `void` | `setRejectedSessions(int rejectedSessions)`
    `String` | `toString()`
    `void` | `unload()`
    `protected void` | `unregisterCommitSessionValve()`
    `protected void` | `unregisterJvmRouteBinderValve()`

    - ### Methods inherited from class org.apache.catalina.session.ManagerBase

      `addPropertyChangeListener, backgroundProcess, changeSessionId, createEmptySession, createSession, createSession, destroy, expireSession, findSessions, generateSessionId, getAlgorithm, getClassName, getContainer, getCreationTime, getCreationTimestamp, getDigest, getDistributable, getDomain, getDuplicates, getEngine, getEntropy, getExpiredSessions, getInfo, getJvmRoute, getLastAccessedTime, getLastAccessedTimestamp, getMaxActive, getMaxInactiveInterval, getName, getObjectName, getProcessExpiresFrequency, getProcessingTime, getRandom, getRandomBytes, getRandomClass, getRandomFile, getSession, getSessionAttribute, getSessionAverageAliveTime, getSessionCounter, getSessionCreateRate, getSessionExpireRate, getSessionIdLength, getSessionMaxAliveTime, init, postDeregister, postRegister, preDeregister, preRegister, processExpires, removePropertyChangeListener, setAlgorithm, setDistributable, setDuplicates, setEntropy, setExpiredSessions, setMaxActive, setProcessExpiresFrequency, setProcessingTime, setRandomClass, setRandomFile, setSessionAverageAliveTime, setSessionCounter, setSessionIdLength, setSessionMaxAliveTime`

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

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

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

      `addLifecycleListener, findLifecycleListeners, removeLifecycleListener, start, stop`

    - ### Methods inherited from interface org.apache.geode.modules.session.catalina.SessionManager

      `getMaxInactiveInterval`

- - ### Field Detail

    - #### started

          protected AtomicBoolean started

      Has this `Manager` been started?

    - #### name

          protected String name

      The name of this `Manager`

    - #### regionName

          protected String regionName

  - ### Constructor Detail

    - #### DeltaSessionManager

          public DeltaSessionManager()

  - ### Method Detail

    - #### getRegionName

          public String getRegionName()

      Specified by:
        `getRegionName` in interface `SessionManager`

    - #### setRegionName

          public void setRegionName(String regionName)

    - #### setMaxInactiveInterval

          public void setMaxInactiveInterval(int interval)

      Specified by:
        `setMaxInactiveInterval` in interface `org.apache.catalina.Manager`
      Overrides:
        `setMaxInactiveInterval` in class `org.apache.catalina.session.ManagerBase`

    - #### getRegionAttributesId

          public String getRegionAttributesId()

      Specified by:
        `getRegionAttributesId` in interface `SessionManager`

    - #### setRegionAttributesId

          public void setRegionAttributesId(String regionType)

    - #### getEnableLocalCache

          public boolean getEnableLocalCache()

      Specified by:
        `getEnableLocalCache` in interface `SessionManager`

    - #### setEnableLocalCache

          public void setEnableLocalCache(boolean enableLocalCache)

    - #### getMaxActiveSessions

          public int getMaxActiveSessions()

    - #### setMaxActiveSessions

          public void setMaxActiveSessions(int maxActiveSessions)

    - #### getEnableGatewayDeltaReplication

          public boolean getEnableGatewayDeltaReplication()

      Specified by:
        `getEnableGatewayDeltaReplication` in interface `SessionManager`

    - #### setEnableGatewayDeltaReplication

          public void setEnableGatewayDeltaReplication(boolean enableGatewayDeltaReplication)

    - #### getEnableGatewayReplication

          public boolean getEnableGatewayReplication()

      Specified by:
        `getEnableGatewayReplication` in interface `SessionManager`

    - #### setEnableGatewayReplication

          public void setEnableGatewayReplication(boolean enableGatewayReplication)

    - #### getEnableDebugListener

          public boolean getEnableDebugListener()

      Specified by:
        `getEnableDebugListener` in interface `SessionManager`

    - #### setEnableDebugListener

          public void setEnableDebugListener(boolean enableDebugListener)

    - #### isCommitValveEnabled

          public boolean isCommitValveEnabled()

      Specified by:
        `isCommitValveEnabled` in interface `SessionManager`

    - #### setEnableCommitValve

          public void setEnableCommitValve(boolean enable)

    - #### isCommitValveFailfastEnabled

          public boolean isCommitValveFailfastEnabled()

      Specified by:
        `isCommitValveFailfastEnabled` in interface `SessionManager`

    - #### setEnableCommitValveFailfast

          public void setEnableCommitValveFailfast(boolean enable)

    - #### isBackingCacheAvailable

          public boolean isBackingCacheAvailable()

      Specified by:
        `isBackingCacheAvailable` in interface `SessionManager`

    - #### setPreferDeserializedForm

          public void setPreferDeserializedForm(boolean enable)

    - #### getPreferDeserializedForm

          public boolean getPreferDeserializedForm()

      Specified by:
        `getPreferDeserializedForm` in interface `SessionManager`

    - #### getStatisticsName

          public String getStatisticsName()

      Specified by:
        `getStatisticsName` in interface `SessionManager`

    - #### getLogger

          public org.apache.juli.logging.Log getLogger()

      Specified by:
        `getLogger` in interface `SessionManager`

    - #### getSessionCache

          public SessionCache getSessionCache()

    - #### getStatistics

          public org.apache.geode.modules.session.catalina.internal.DeltaSessionStatistics getStatistics()

    - #### isClientServer

          public boolean isClientServer()

    - #### setContainer

          public void setContainer(org.apache.catalina.Container container)

      This method was taken from StandardManager to set the default maxInactiveInterval based on the container (to 30 minutes).

      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.

      Specified by:
        `setContainer` in interface `org.apache.catalina.Manager`
      Overrides:
        `setContainer` in class `org.apache.catalina.session.ManagerBase`
      Parameters:
        `container` - The associated Container

    - #### findSession

          public org.apache.catalina.Session findSession(String id)
                                                  throws IOException

      Specified by:
        `findSession` in interface `org.apache.catalina.Manager`
      Overrides:
        `findSession` in class `org.apache.catalina.session.ManagerBase`
      Throws:
        `IOException`

    - #### initializeSessionCache

          protected void initializeSessionCache()

    - #### getNewSession

          protected org.apache.catalina.session.StandardSession getNewSession()

      Overrides:
        `getNewSession` in class `org.apache.catalina.session.ManagerBase`

    - #### remove

          public void remove(org.apache.catalina.Session session)

      Specified by:
        `remove` in interface `org.apache.catalina.Manager`
      Overrides:
        `remove` in class `org.apache.catalina.session.ManagerBase`

    - #### remove

          public void remove(org.apache.catalina.Session session,
                             boolean update)

    - #### add

          public void add(org.apache.catalina.Session session)

      Specified by:
        `add` in interface `org.apache.catalina.Manager`
      Overrides:
        `add` in class `org.apache.catalina.session.ManagerBase`

    - #### getRejectedSessions

          public int getRejectedSessions()

      Specified by:
        `getRejectedSessions` in interface `org.apache.catalina.Manager`

    - #### setRejectedSessions

          public void setRejectedSessions(int rejectedSessions)

      Specified by:
        `setRejectedSessions` in interface `org.apache.catalina.Manager`

    - #### getActiveSessions

          public int getActiveSessions()

      Returns the number of active sessions
      Specified by:
        `getActiveSessions` in interface `org.apache.catalina.Manager`
      Overrides:
        `getActiveSessions` in class `org.apache.catalina.session.ManagerBase`
      Returns:
        number of sessions active

    - #### listSessionIds

          public String listSessionIds()

      For debugging: return a list of all session ids currently active
      Overrides:
        `listSessionIds` in class `org.apache.catalina.session.ManagerBase`

    - #### getSessionsToTouch

          protected Set<String> getSessionsToTouch()

    - #### scheduleTimerTasks

          protected void scheduleTimerTasks()

    - #### cancelTimer

          protected void cancelTimer()

    - #### load

          public void load()
                    throws ClassNotFoundException,
                           IOException

      Specified by:
        `load` in interface `org.apache.catalina.Manager`
      Throws:
        `ClassNotFoundException`
        `IOException`

    - #### unload

          public void unload()
                      throws IOException

      Specified by:
        `unload` in interface `org.apache.catalina.Manager`
      Throws:
        `IOException`

    - #### registerJvmRouteBinderValve

          protected void registerJvmRouteBinderValve()

    - #### unregisterJvmRouteBinderValve

          protected void unregisterJvmRouteBinderValve()

    - #### registerCommitSessionValve

          protected void registerCommitSessionValve()

    - #### unregisterCommitSessionValve

          protected void unregisterCommitSessionValve()

    - #### propertyChange

          public void propertyChange(PropertyChangeEvent event)

      Process property change events from our associated Context.

      Part of this method implementation was taken from StandardManager. The sessionTimeout can be changed in the web.xml which is processed after the context.xml. The context (and the default session timeout) would already have been set in this Manager. This is the way to get the new session timeout value specified in the web.xml.

      The precedence order for setting the session timeout value is:

      1. the max inactive interval is set based on the Manager defined in the context.xml
      2. the max inactive interval is then overwritten by the value of the Context's session timeout when setContainer is called
      3. the max inactive interval is then overwritten by the value of the session-timeout specified in the web.xml (if any)
      Specified by:
        `propertyChange` in interface `PropertyChangeListener`
      Parameters:
        `event` - The property change event that has occurred

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### getTheContext

          public org.apache.catalina.Context getTheContext()