Package org.apache.catalina.ha.session
Class BackupManager
- 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.BackupManager
 
 
 
 
 
- 
- All Implemented Interfaces:
- javax.management.MBeanRegistration,- DistributedManager,- ClusterManager,- JmxEnabled,- Lifecycle,- Manager,- AbstractReplicatedMap.MapOwner
 
 public class BackupManager extends ClusterManagerBase implements AbstractReplicatedMap.MapOwner, DistributedManager 
- 
- 
Nested Class Summary- 
Nested classes/interfaces inherited from class org.apache.catalina.session.ManagerBaseManagerBase.SessionTiming
 - 
Nested classes/interfaces inherited from interface org.apache.catalina.LifecycleLifecycle.SingleUse
 
- 
 - 
Field SummaryFields Modifier and Type Field Description protected static longDEFAULT_REPL_TIMEOUTprotected java.lang.StringnameThe name of this managerprotected static StringManagersmThe string manager for this package.- 
Fields inherited from class org.apache.catalina.ha.session.ClusterManagerBasecluster
 - 
Fields inherited from class org.apache.catalina.session.ManagerBaseduplicates, expiredSessions, maxActive, maxActiveSessions, processExpiresFrequency, processingTime, rejectedSessions, secureRandomAlgorithm, secureRandomClass, secureRandomProvider, sessionCounter, sessionCreationTiming, sessionExpirationTiming, sessionIdGenerator, sessionIdGeneratorClass, sessionMaxAliveTime, sessions, support, TIMING_STATS_CACHE_SIZE
 - 
Fields inherited from class org.apache.catalina.util.LifecycleMBeanBasemserver
 - 
Fields inherited from interface org.apache.catalina.LifecycleAFTER_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 SummaryConstructors Constructor Description BackupManager()Constructor, just calls super()
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description ClusterManagercloneFromTemplate()SessioncreateEmptySession()Get a session from the recycled ones or create a new empty one.longgetAccessTimeout()intgetActiveSessionsFull()Returns the total session count for primary, backup and proxy.java.lang.String[]getInvalidatedSessions()When the manager expires session not tied to a request.java.lang.StringgetMapName()intgetMapSendOptions()java.lang.StringgetName()Return the name of the manager, at host /context name and at engine hostname+/context.longgetRpcTimeout()java.util.Set<java.lang.String>getSessionIdsFull()Returns the list of all sessions IDS (primary, backup and proxy).booleanisTerminateOnStartFailure()voidmessageDataReceived(ClusterMessage msg)A message was received from another node, this is the callback method to implement if you are interested in receiving replication messages.voidobjectMadePrimary(java.lang.Object key, java.lang.Object value)ClusterMessagerequestCompleted(java.lang.String sessionId)When the request has been completed, the replication valve will notify the manager, and the manager will decide whether any replication is needed or not.voidsetAccessTimeout(long accessTimeout)voidsetMapSendOptions(int mapSendOptions)voidsetName(java.lang.String name)Set the name of the manager, at host /context name and at engine hostname+/contextvoidsetRpcTimeout(long rpcTimeout)voidsetTerminateOnStartFailure(boolean terminateOnStartFailure)protected voidstartInternal()Start this component and implement the requirements ofLifecycleBase.startInternal().protected voidstopInternal()Stop this component and implement the requirements ofLifecycleBase.stopInternal().- 
Methods inherited from class org.apache.catalina.ha.session.ClusterManagerBaseclone, getClassLoaders, getClassLoaders, getCluster, getDeltaRequestPool, getReplicationStream, getReplicationStream, isNotifyListenersOnReplication, isRecordAllActions, load, registerSessionAtReplicationValve, setCluster, setNotifyListenersOnReplication, setRecordAllActions, unload
 - 
Methods inherited from class org.apache.catalina.session.ManagerBaseadd, addPropertyChangeListener, backgroundProcess, changeSessionId, changeSessionId, changeSessionId, createSession, expireSession, findSession, findSessions, generateSessionId, getActiveSessions, getClassName, getContext, getCreationTime, getCreationTimestamp, getDomainInternal, getDuplicates, getEngine, getExpiredSessions, getJvmRoute, getLastAccessedTime, getLastAccessedTimestamp, getMaxActive, getMaxActiveSessions, getNewSession, getObjectNameKeyProperties, getPersistAuthentication, getPersistAuthenticationNotes, getProcessExpiresFrequency, getProcessingTime, getRejectedSessions, getSecureRandomAlgorithm, getSecureRandomClass, getSecureRandomProvider, getSession, getSessionAttribute, getSessionAttributeNameFilter, getSessionAttributeNamePattern, getSessionAttributeValueClassNameFilter, getSessionAttributeValueClassNamePattern, getSessionAverageAliveTime, getSessionCounter, getSessionCreateRate, getSessionExpireRate, getSessionIdGenerator, getSessionMaxAliveTime, getThisAccessedTime, getThisAccessedTimestamp, getWarnOnSessionAttributeFilterFailure, initInternal, listSessionIds, processExpires, remove, remove, removePropertyChangeListener, rotateSessionId, setContext, setDuplicates, setExpiredSessions, setMaxActive, setMaxActiveSessions, setPersistAuthentication, setPersistAuthenticationNotes, setProcessExpiresFrequency, setProcessingTime, setSecureRandomAlgorithm, setSecureRandomClass, setSecureRandomProvider, setSessionAttributeNameFilter, setSessionAttributeValueClassNameFilter, setSessionCounter, setSessionIdGenerator, setSessionMaxAliveTime, setWarnOnSessionAttributeFilterFailure, toString, updateSessionMaxAliveTime, willAttributeDistribute
 - 
Methods inherited from class org.apache.catalina.util.LifecycleMBeanBasedestroyInternal, getDomain, getObjectName, postDeregister, postRegister, preDeregister, preRegister, register, setDomain, unregister
 - 
Methods inherited from class org.apache.catalina.util.LifecycleBaseaddLifecycleListener, destroy, findLifecycleListeners, fireLifecycleEvent, getState, getStateName, getThrowOnFailure, init, removeLifecycleListener, setState, setState, setThrowOnFailure, start, stop
 - 
Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 - 
Methods inherited from interface org.apache.catalina.Manageradd, addPropertyChangeListener, backgroundProcess, changeSessionId, changeSessionId, createSession, findSession, findSessions, getActiveSessions, getContext, getExpiredSessions, getMaxActive, getRejectedSessions, getSessionAverageAliveTime, getSessionCounter, getSessionCreateRate, getSessionExpireRate, getSessionIdGenerator, getSessionMaxAliveTime, remove, remove, removePropertyChangeListener, setContext, setExpiredSessions, setMaxActive, setSessionCounter, setSessionIdGenerator, setSessionMaxAliveTime, willAttributeDistribute
 
- 
 
- 
- 
- 
Field Detail- 
smprotected static final StringManager sm The string manager for this package.
 - 
DEFAULT_REPL_TIMEOUTprotected static final long DEFAULT_REPL_TIMEOUT - See Also:
- Constant Field Values
 
 - 
nameprotected java.lang.String name The name of this manager
 
- 
 - 
Method Detail- 
messageDataReceivedpublic void messageDataReceived(ClusterMessage msg) Description copied from interface:ClusterManagerA message was received from another node, this is the callback method to implement if you are interested in receiving replication messages.- Specified by:
- messageDataReceivedin interface- ClusterManager
- Parameters:
- msg- - the message received.
 
 - 
requestCompletedpublic ClusterMessage requestCompleted(java.lang.String sessionId) Description copied from interface:ClusterManagerWhen the request has been completed, the replication valve will notify the manager, and the manager will decide whether any replication is needed or not. If there is a need for replication, the manager will create a session message and that will be replicated. The cluster determines where it gets sent.- Specified by:
- requestCompletedin interface- ClusterManager
- Parameters:
- sessionId- - the sessionId that just completed.
- Returns:
- a SessionMessage to be sent.
 
 - 
objectMadePrimarypublic void objectMadePrimary(java.lang.Object key, java.lang.Object value)- Specified by:
- objectMadePrimaryin interface- AbstractReplicatedMap.MapOwner
 
 - 
createEmptySessionpublic Session createEmptySession() Description copied from interface:ManagerGet 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:
- createEmptySessionin interface- Manager
- Overrides:
- createEmptySessionin class- ManagerBase
- Returns:
- An empty Session object
 
 - 
getNamepublic java.lang.String getName() Description copied from interface:ClusterManagerReturn the name of the manager, at host /context name and at engine hostname+/context.- Specified by:
- getNamein interface- ClusterManager
- Overrides:
- getNamein class- ManagerBase
- Returns:
- The descriptive short name of this Manager implementation.
 
 - 
startInternalprotected void startInternal() throws LifecycleExceptionStart this component and implement the requirements ofLifecycleBase.startInternal(). Starts the cluster communication channel, this will connect with the other nodes in the cluster, and request the current session state to be transferred to this node.- Overrides:
- startInternalin class- ClusterManagerBase
- Throws:
- LifecycleException- if this component detects a fatal error that prevents this component from being used
 
 - 
getMapNamepublic java.lang.String getMapName() 
 - 
stopInternalprotected void stopInternal() throws LifecycleExceptionStop this component and implement the requirements ofLifecycleBase.stopInternal(). This will disconnect the cluster communication channel and stop the listener thread.- Overrides:
- stopInternalin class- ClusterManagerBase
- Throws:
- LifecycleException- if this component detects a fatal error that prevents this component from being used
 
 - 
setNamepublic void setName(java.lang.String name) Description copied from interface:ClusterManagerSet the name of the manager, at host /context name and at engine hostname+/context- Specified by:
- setNamein interface- ClusterManager
- Parameters:
- name- The manager name
 
 - 
setMapSendOptionspublic void setMapSendOptions(int mapSendOptions) 
 - 
getMapSendOptionspublic int getMapSendOptions() 
 - 
setRpcTimeoutpublic void setRpcTimeout(long rpcTimeout) 
 - 
getRpcTimeoutpublic long getRpcTimeout() 
 - 
setTerminateOnStartFailurepublic void setTerminateOnStartFailure(boolean terminateOnStartFailure) 
 - 
isTerminateOnStartFailurepublic boolean isTerminateOnStartFailure() 
 - 
getAccessTimeoutpublic long getAccessTimeout() 
 - 
setAccessTimeoutpublic void setAccessTimeout(long accessTimeout) 
 - 
getInvalidatedSessionspublic java.lang.String[] getInvalidatedSessions() Description copied from interface:ClusterManagerWhen the manager expires session not tied to a request. The cluster will periodically ask for a list of sessions that should expire and that should be sent across the wire.- Specified by:
- getInvalidatedSessionsin interface- ClusterManager
- Returns:
- String[] The invalidated sessions
 
 - 
cloneFromTemplatepublic ClusterManager cloneFromTemplate() - Specified by:
- cloneFromTemplatein interface- ClusterManager
 
 - 
getActiveSessionsFullpublic int getActiveSessionsFull() Description copied from interface:DistributedManagerReturns the total session count for primary, backup and proxy.- Specified by:
- getActiveSessionsFullin interface- DistributedManager
- Returns:
- The total session count across the cluster.
 
 - 
getSessionIdsFullpublic java.util.Set<java.lang.String> getSessionIdsFull() Description copied from interface:DistributedManagerReturns the list of all sessions IDS (primary, backup and proxy).- Specified by:
- getSessionIdsFullin interface- DistributedManager
- Returns:
- The complete set of sessions IDs across the cluster.
 
 
- 
 
-