ClusterManagerBase (Apache Tomcat 7.0.104 API Documentation)

org.apache.catalina.ha.session

## Class ClusterManagerBase

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

- All Implemented Interfaces:
    MBeanRegistration, ClusterManager, JmxEnabled, Lifecycle, Manager
  Direct Known Subclasses:
    BackupManager, DeltaManager

      public abstract class ClusterManagerBase
      extends ManagerBase
      implements ClusterManager

  Author:
    Filip Hanik

- - ### Nested Class Summary

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

      `ManagerBase.SessionTiming`

    - ### Nested classes/interfaces inherited from interface org.apache.catalina.Lifecycle

      `Lifecycle.SingleUse`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected CatalinaCluster` | `cluster` A reference to the cluster

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

      `container, distributable, duplicates, expiredSessions, maxActive, maxActiveSessions, maxInactiveInterval, processExpiresFrequency, processingTime, rejectedSessions, secureRandomAlgorithm, secureRandomClass, secureRandomProvider, SESSION_ID_LENGTH_UNSET, sessionCounter, sessionCreationTiming, sessionExpirationTiming, sessionIdGenerator, sessionIdGeneratorClass, sessionIdLength, sessionMaxAliveTime, sessions, sm, support, 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
    `ClusterManagerBase()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected void` | `clone(ClusterManagerBase copy)`
    `ClassLoader[]` | `getClassLoaders()`
    `static ClassLoader[]` | `getClassLoaders(Container container)`
    `CatalinaCluster` | `getCluster()`
    `protected SynchronizedStack<DeltaRequest>` | `getDeltaRequestPool()`
    `ReplicationStream` | `getReplicationStream(byte[] data)` Open stream and use correct ClassLoader (Container), switching thread context class loader.
    `ReplicationStream` | `getReplicationStream(byte[] data, int offset, int length)`
    `String` | `getSessionAttributeFilter()` Deprecated. Use `ManagerBase.getSessionAttributeNameFilter()`. Will be removed in Tomcat 9.0.x
    `boolean` | `isNotifyListenersOnReplication()`
    `boolean` | `isRecordAllActions()`
    `void` | `load()` `Manager` implementations that also implement `ClusterManager` do not support local session persistence.
    `protected void` | `registerSessionAtReplicationValve(DeltaSession session)` Register cross context session at replication valve thread local
    `void` | `setCluster(CatalinaCluster cluster)`
    `void` | `setNotifyListenersOnReplication(boolean notifyListenersOnReplication)`
    `void` | `setRecordAllActions(boolean recordAllActions)`
    `void` | `setSessionAttributeFilter(String sessionAttributeFilter)` Deprecated. Use `ManagerBase.setSessionAttributeNameFilter(String)`. Will be removed in Tomcat 9.0.x
    `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.
    `void` | `unload()` `Manager` implementations that also implement `ClusterManager` do not support local session persistence.
    `boolean` | `willAttributeDistribute(String name)` Deprecated. Use `ManagerBase.willAttributeDistribute(String, Object)`. Will be removed in Tomcat 9.0.x

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

      `add, addPropertyChangeListener, backgroundProcess, changeSessionId, changeSessionId, createEmptySession, createSession, expireSession, findSession, findSessions, generateSessionId, getActiveSessions, getClassName, getContainer, getCreationTime, getCreationTimestamp, getDistributable, getDomainInternal, getDuplicates, getEngine, getExpiredSessions, getInfo, getJvmRoute, getLastAccessedTime, getLastAccessedTimestamp, getMaxActive, getMaxActiveSessions, getMaxInactiveInterval, getName, getNewSession, getObjectNameKeyProperties, getPersistAuthentication, getProcessExpiresFrequency, getProcessingTime, getRejectedSessions, getSecureRandomAlgorithm, getSecureRandomClass, getSecureRandomProvider, getSession, getSessionAttribute, getSessionAttributeNameFilter, getSessionAttributeNamePattern, getSessionAttributeValueClassNameFilter, getSessionAttributeValueClassNamePattern, getSessionAverageAliveTime, getSessionCounter, getSessionCreateRate, getSessionExpireRate, getSessionIdGenerator, getSessionIdLength, getSessionMaxAliveTime, getThisAccessedTime, getThisAccessedTimestamp, getWarnOnSessionAttributeFilterFailure, initInternal, listSessionIds, processExpires, remove, remove, removePropertyChangeListener, rotateSessionId, setContainer, setDistributable, setDuplicates, setExpiredSessions, setMaxActive, setMaxActiveSessions, setMaxInactiveInterval, setPersistAuthentication, setProcessExpiresFrequency, setProcessingTime, setSecureRandomAlgorithm, setSecureRandomClass, setSecureRandomProvider, setSessionAttributeNameFilter, setSessionAttributeValueClassNameFilter, setSessionCounter, setSessionIdGenerator, setSessionIdLength, setSessionMaxAliveTime, setWarnOnSessionAttributeFilterFailure, toString, updateSessionMaxAliveTime, willAttributeDistribute`

    - ### 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, getThrowOnFailure, init, removeLifecycleListener, setState, setState, setThrowOnFailure, 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.ha.ClusterManager

      `cloneFromTemplate, getInvalidatedSessions, getName, messageDataReceived, requestCompleted, setName`

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

      `add, addPropertyChangeListener, backgroundProcess, changeSessionId, createEmptySession, createSession, findSession, findSessions, getActiveSessions, getContainer, getDistributable, getExpiredSessions, getInfo, getMaxActive, getMaxInactiveInterval, getRejectedSessions, getSessionAverageAliveTime, getSessionCounter, getSessionCreateRate, getSessionExpireRate, getSessionIdLength, getSessionMaxAliveTime, remove, remove, removePropertyChangeListener, setContainer, setDistributable, setExpiredSessions, setMaxActive, setMaxInactiveInterval, setSessionCounter, setSessionIdLength, setSessionMaxAliveTime, willAttributeDistribute`

- - ### Field Detail

    - #### cluster

          protected CatalinaCluster cluster

      A reference to the cluster

  - ### Constructor Detail

    - #### ClusterManagerBase

          public ClusterManagerBase()

  - ### Method Detail

    - #### getDeltaRequestPool

          protected SynchronizedStack<DeltaRequest> getDeltaRequestPool()

    - #### getCluster

          public CatalinaCluster getCluster()

      Specified by:
        `getCluster` in interface `ClusterManager`

    - #### setCluster

          public void setCluster(CatalinaCluster cluster)

      Specified by:
        `setCluster` in interface `ClusterManager`

    - #### isNotifyListenersOnReplication

          public boolean isNotifyListenersOnReplication()

      Specified by:
        `isNotifyListenersOnReplication` in interface `ClusterManager`

    - #### setNotifyListenersOnReplication

          public void setNotifyListenersOnReplication(boolean notifyListenersOnReplication)

    - #### getSessionAttributeFilter

          @Deprecated
          public String getSessionAttributeFilter()

      Deprecated. Use `ManagerBase.getSessionAttributeNameFilter()`. Will be removed in Tomcat 9.0.x
      Return the string pattern used for including session attributes to replication.
      Returns:
        the sessionAttributeFilter

    - #### setSessionAttributeFilter

          @Deprecated
          public void setSessionAttributeFilter(String sessionAttributeFilter)

      Deprecated. Use `ManagerBase.setSessionAttributeNameFilter(String)`. Will be removed in Tomcat 9.0.x
      Set the pattern used for including session attributes to replication. If not set, all session attributes will be eligible for replication.

      E.g. `^(userName|sessionHistory)$`

      Parameters:
        `sessionAttributeFilter` - the filter name pattern to set

    - #### isRecordAllActions

          public boolean isRecordAllActions()

    - #### setRecordAllActions

          public void setRecordAllActions(boolean recordAllActions)

    - #### willAttributeDistribute

          @Deprecated
          public boolean willAttributeDistribute(String name)

      Deprecated. Use `ManagerBase.willAttributeDistribute(String, Object)`. Will be removed in Tomcat 9.0.x
      Check whether the given session attribute should be distributed based on attribute name only.
      Returns:
        true if the attribute should be distributed

    - #### getClassLoaders

          public static ClassLoader[] getClassLoaders(Container container)

    - #### getClassLoaders

          public ClassLoader[] getClassLoaders()

    - #### getReplicationStream

          public ReplicationStream getReplicationStream(byte[] data)
                                                 throws IOException

      Description copied from interface: `ClusterManager`
      Open stream and use correct ClassLoader (Container), switching thread context class loader.
      Specified by:
        `getReplicationStream` in interface `ClusterManager`
      Parameters:
        `data` - The data
      Returns:
        The object input stream
      Throws:
        `IOException` - An error occurred

    - #### getReplicationStream

          public ReplicationStream getReplicationStream(byte[] data,
                                               int offset,
                                               int length)
                                                 throws IOException

      Specified by:
        `getReplicationStream` in interface `ClusterManager`
      Throws:
        `IOException`

    - #### load

          public void load()

      `Manager` implementations that also implement `ClusterManager` do not support local session persistence.
      Specified by:
        `load` in interface `Manager`

    - #### unload

          public void unload()

      `Manager` implementations that also implement `ClusterManager` do not support local session persistence.
      Specified by:
        `unload` in interface `Manager`

    - #### clone

          protected void clone(ClusterManagerBase copy)

    - #### registerSessionAtReplicationValve

          protected void registerSessionAtReplicationValve(DeltaSession session)

      Register cross context session at replication valve thread local
      Parameters:
        `session` - cross context session

    - #### 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.
      Overrides:
        `startInternal` in class `ManagerBase`
      Throws:
        `LifecycleException` - Start error occurred

    - #### 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.
      Overrides:
        `stopInternal` in class `ManagerBase`
      Throws:
        `LifecycleException` - Stop error occurred

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