org.wso2.carbon.webapp.mgt.session

## Class CarbonTomcatClusterableSessionManager

- java.lang.Object
- - org.apache.catalina.util.LifecycleBase
  - - org.apache.catalina.util.LifecycleMBeanBase
    - - org.apache.catalina.session.ManagerBase
      - - org.apache.catalina.ha.session.ClusterManagerBase
        - - org.apache.catalina.ha.session.DeltaManager
          - - org.wso2.carbon.webapp.mgt.session.CarbonTomcatClusterableSessionManager

- All Implemented Interfaces:
    MBeanRegistration, org.apache.catalina.ha.ClusterManager, org.apache.catalina.Lifecycle, org.apache.catalina.Manager

      public class CarbonTomcatClusterableSessionManager
      extends org.apache.catalina.ha.session.DeltaManager

  A Clusterable SessionManager implementation which ensures that sessions of distributable webapps are replicated across cluster nodes.

- - ### Nested Class Summary

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

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

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

      `org.apache.catalina.Lifecycle.SingleUse`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected static org.apache.tomcat.util.res.StringManager` | `sm` The string manager for this package.

    - ### Fields inherited from class org.apache.catalina.ha.session.DeltaManager

      `managerName, name`

    - ### Fields inherited from class org.apache.catalina.ha.session.ClusterManagerBase

      `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, 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
    `CarbonTomcatClusterableSessionManager()`
    `CarbonTomcatClusterableSessionManager(int ownerTenantId)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `changeSessionId(org.apache.catalina.Session session, boolean notify)`
    `org.apache.catalina.ha.ClusterManager` | `cloneFromTemplate()`
    `void` | `clusterMessageReceived(org.apache.catalina.ha.ClusterMessage msg)`
    `org.apache.catalina.Session` | `findSession(String id)`
    `org.apache.catalina.Session[]` | `findSessions()`
    `int` | `getActiveSessions()`
    `void` | `getAllClusterSessions()`
    `long` | `getExpiredSessions()`
    `int` | `getMaxActive()`
    `int` | `getMaxInactiveInterval()`
    `Map<String,CarbonTomcatSessionMessage>` | `getQueuedSessionMsgMap()`
    `int` | `getRejectedSessions()`
    `int` | `getSessionAverageAliveTime()`
    `int` | `getSessionMaxAliveTime()`
    `CarbonSessionReplicationMessage` | `getSessionReplicationMessage(String sessionId, boolean expires)`
    `protected void` | `handleGET_ALL_SESSIONS(org.apache.catalina.ha.session.SessionMessage msg, org.apache.catalina.tribes.Member sender)`
    `void` | `replicateSessions(org.apache.catalina.Session session)`
    `protected void` | `sendCreateSession(String sessionId, org.apache.catalina.ha.session.DeltaSession session)`
    `protected void` | `sendSessions(org.apache.catalina.tribes.Member sender, org.apache.catalina.Session[] currentSessions, long sendTimestamp)`
    `protected void` | `sessionExpired(String id)`
    `void` | `setOwnerTenantId(int ownerTenantId)`

    - ### Methods inherited from class org.apache.catalina.ha.session.DeltaManager

      `changeSessionId, createEmptySession, createSession, createSession, deserializeDeltaRequest, deserializeSessionId, deserializeSessions, expireAllLocalSessions, findSessionMasterMember, getCounterNoStateTransfered, getCounterReceive_EVT_ALL_SESSION_DATA, getCounterReceive_EVT_ALL_SESSION_NOCONTEXTMANAGER, getCounterReceive_EVT_ALL_SESSION_TRANSFERCOMPLETE, getCounterReceive_EVT_CHANGE_SESSION_ID, getCounterReceive_EVT_GET_ALL_SESSIONS, getCounterReceive_EVT_SESSION_ACCESSED, getCounterReceive_EVT_SESSION_CREATED, getCounterReceive_EVT_SESSION_DELTA, getCounterReceive_EVT_SESSION_EXPIRED, getCounterSend_EVT_ALL_SESSION_DATA, getCounterSend_EVT_ALL_SESSION_TRANSFERCOMPLETE, getCounterSend_EVT_CHANGE_SESSION_ID, getCounterSend_EVT_GET_ALL_SESSIONS, getCounterSend_EVT_SESSION_ACCESSED, getCounterSend_EVT_SESSION_CREATED, getCounterSend_EVT_SESSION_DELTA, getCounterSend_EVT_SESSION_EXPIRED, getInfo, getInvalidatedSessions, getName, getNewDeltaSession, getProcessingTime, getReceivedQueueSize, getSendAllSessionsSize, getSendAllSessionsWaitTime, getSessionReplaceCounter, getStateTransfered, getStateTransferTimeout, handleALL_SESSION_DATA, handleALL_SESSION_NOCONTEXTMANAGER, handleALL_SESSION_TRANSFERCOMPLETE, handleCHANGE_SESSION_ID, handleSESSION_ACCESSED, handleSESSION_CREATED, handleSESSION_DELTA, handleSESSION_EXPIRED, isExpireSessionsOnShutdown, isNoContextManagerReceived, isNotifyContainerListenersOnReplication, isNotifySessionListenersOnReplication, isSendAllSessions, isStateTimestampDrop, messageDataReceived, messageReceived, requestCompleted, requestCompleted, resetStatistics, send, serializeDeltaRequest, serializeSessionId, serializeSessions, setExpireSessionsOnShutdown, setName, setNoContextManagerReceived, setNotifyContainerListenersOnReplication, setNotifySessionListenersOnReplication, setSendAllSessions, setSendAllSessionsSize, setSendAllSessionsWaitTime, setStateTimestampDrop, setStateTransfered, setStateTransferTimeout, startInternal, stopInternal, waitForSendAllSessions`

    - ### Methods inherited from class org.apache.catalina.ha.session.ClusterManagerBase

      `clone, getClassLoaders, getClassLoaders, getCluster, getReplicationStream, getReplicationStream, getSessionAttributeFilter, isNotifyListenersOnReplication, isRecordAllActions, load, registerSessionAtReplicationValve, setCluster, setNotifyListenersOnReplication, setRecordAllActions, setSessionAttributeFilter, unload, willAttributeDistribute`

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

      `add, addPropertyChangeListener, backgroundProcess, expireSession, generateSessionId, getClassName, getContainer, getCreationTime, getCreationTimestamp, getDistributable, getDomainInternal, getDuplicates, getEngine, getJvmRoute, getLastAccessedTime, getLastAccessedTimestamp, getMaxActiveSessions, getNewSession, getObjectNameKeyProperties, getProcessExpiresFrequency, getSecureRandomAlgorithm, getSecureRandomClass, getSecureRandomProvider, getSession, getSessionAttribute, getSessionAttributeNameFilter, getSessionAttributeNamePattern, getSessionAttributeValueClassNameFilter, getSessionAttributeValueClassNamePattern, getSessionCounter, getSessionCreateRate, getSessionExpireRate, getSessionIdGenerator, getSessionIdLength, getThisAccessedTime, getThisAccessedTimestamp, getWarnOnSessionAttributeFilterFailure, initInternal, listSessionIds, processExpires, remove, remove, removePropertyChangeListener, setContainer, setDistributable, setDuplicates, setExpiredSessions, setMaxActive, setMaxActiveSessions, setMaxInactiveInterval, 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, 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

      `add, addPropertyChangeListener, backgroundProcess, getContainer, getDistributable, getSessionCounter, getSessionCreateRate, getSessionExpireRate, getSessionIdLength, remove, remove, removePropertyChangeListener, setContainer, setDistributable, setExpiredSessions, setMaxActive, setMaxInactiveInterval, setSessionCounter, setSessionIdLength, setSessionMaxAliveTime, willAttributeDistribute`

- - ### Field Detail

    - #### sm

          protected static final org.apache.tomcat.util.res.StringManager sm

      The string manager for this package.

  - ### Constructor Detail

    - #### CarbonTomcatClusterableSessionManager

          public CarbonTomcatClusterableSessionManager()

    - #### CarbonTomcatClusterableSessionManager

          public CarbonTomcatClusterableSessionManager(int ownerTenantId)

  - ### Method Detail

    - #### setOwnerTenantId

          public void setOwnerTenantId(int ownerTenantId)

    - #### getRejectedSessions

          public int getRejectedSessions()

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

    - #### getExpiredSessions

          public long getExpiredSessions()

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

    - #### getMaxInactiveInterval

          public int getMaxInactiveInterval()

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

    - #### 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`

    - #### findSessions

          public org.apache.catalina.Session[] findSessions()

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

    - #### getMaxActive

          public int getMaxActive()

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

    - #### getSessionAverageAliveTime

          public int getSessionAverageAliveTime()

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

    - #### getSessionMaxAliveTime

          public int getSessionMaxAliveTime()

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

    - #### getActiveSessions

          public int getActiveSessions()

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

    - #### getSessionReplicationMessage

          public CarbonSessionReplicationMessage getSessionReplicationMessage(String sessionId,
                                                                              boolean expires)

    - #### replicateSessions

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

    - #### clusterMessageReceived

          public void clusterMessageReceived(org.apache.catalina.ha.ClusterMessage msg)

    - #### sessionExpired

          protected void sessionExpired(String id)

      Overrides:
        `sessionExpired` in class `org.apache.catalina.ha.session.DeltaManager`

    - #### handleGET_ALL_SESSIONS

          protected void handleGET_ALL_SESSIONS(org.apache.catalina.ha.session.SessionMessage msg,
                                                org.apache.catalina.tribes.Member sender)
                                         throws IOException

      Overrides:
        `handleGET_ALL_SESSIONS` in class `org.apache.catalina.ha.session.DeltaManager`
      Throws:
        `IOException`

    - #### sendSessions

          protected void sendSessions(org.apache.catalina.tribes.Member sender,
                                      org.apache.catalina.Session[] currentSessions,
                                      long sendTimestamp)
                               throws IOException

      Overrides:
        `sendSessions` in class `org.apache.catalina.ha.session.DeltaManager`
      Throws:
        `IOException`

    - #### sendCreateSession

          protected void sendCreateSession(String sessionId,
                                           org.apache.catalina.ha.session.DeltaSession session)

      Overrides:
        `sendCreateSession` in class `org.apache.catalina.ha.session.DeltaManager`

    - #### changeSessionId

          public void changeSessionId(org.apache.catalina.Session session,
                                      boolean notify)

      Overrides:
        `changeSessionId` in class `org.apache.catalina.ha.session.DeltaManager`

    - #### getAllClusterSessions

          public void getAllClusterSessions()

      Overrides:
        `getAllClusterSessions` in class `org.apache.catalina.ha.session.DeltaManager`

    - #### cloneFromTemplate

          public org.apache.catalina.ha.ClusterManager cloneFromTemplate()

      Specified by:
        `cloneFromTemplate` in interface `org.apache.catalina.ha.ClusterManager`
      Overrides:
        `cloneFromTemplate` in class `org.apache.catalina.ha.session.DeltaManager`

    - #### getQueuedSessionMsgMap

          public Map<String,CarbonTomcatSessionMessage> getQueuedSessionMsgMap()

Copyright © 2017 WSO2. All rights reserved.