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:
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.ManagerBase
ManagerBase.SessionTiming
Nested classes/interfaces inherited from interface org.apache.catalina.Lifecycle
Lifecycle.SingleUse
-
Field Summary
Modifier and TypeFieldDescriptionprotected static final long
protected String
The name of this managerprotected static final StringManager
The string manager for this package.Fields inherited from class org.apache.catalina.ha.session.ClusterManagerBase
cluster
Fields inherited from class org.apache.catalina.session.ManagerBase
duplicates, 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.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
-
Method Summary
Modifier and TypeMethodDescriptionGet a session from the recycled ones or create a new empty one.long
int
Returns the total session count for primary, backup and proxy.String[]
When the manager expires session not tied to a request.int
returns the SendOptions as a comma separated list of namesgetName()
Return the name of the manager, at host /context name and at engine hostname+/context.long
Returns the list of all sessions IDS (primary, backup and proxy).boolean
void
A message was received from another node, this is the callback method to implement if you are interested in receiving replication messages.void
objectMadePrimary
(Object key, Object value) requestCompleted
(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.void
setAccessTimeout
(long accessTimeout) void
setMapSendOptions
(int mapSendOptions) void
setMapSendOptions
(String mapSendOptions) void
Set the name of the manager, at host /context name and at engine hostname+/contextvoid
setRpcTimeout
(long rpcTimeout) void
setTerminateOnStartFailure
(boolean terminateOnStartFailure) protected void
Start this component and implement the requirements ofLifecycleBase.startInternal()
.protected void
Stop this component and implement the requirements ofLifecycleBase.stopInternal()
.Methods inherited from class org.apache.catalina.ha.session.ClusterManagerBase
clone, getClassLoaders, getClassLoaders, getCluster, getDeltaRequestPool, getReplicationStream, getReplicationStream, isNotifyListenersOnReplication, isRecordAllActions, load, registerSessionAtReplicationValve, setCluster, setNotifyListenersOnReplication, setRecordAllActions, unload
Methods inherited from class org.apache.catalina.session.ManagerBase
add, 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, getNotifyAttributeListenerOnUnchangedValue, getNotifyBindingListenerOnUnchangedValue, 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, setNotifyAttributeListenerOnUnchangedValue, setNotifyBindingListenerOnUnchangedValue, setPersistAuthentication, setPersistAuthenticationNotes, setProcessExpiresFrequency, setProcessingTime, setSecureRandomAlgorithm, setSecureRandomClass, setSecureRandomProvider, setSessionAttributeNameFilter, setSessionAttributeValueClassNameFilter, setSessionCounter, setSessionIdGenerator, setSessionMaxAliveTime, setWarnOnSessionAttributeFilterFailure, toString, updateSessionMaxAliveTime, willAttributeDistribute
Methods inherited from class org.apache.catalina.util.LifecycleMBeanBase
destroyInternal, getDomain, getObjectName, postDeregister, postRegister, preDeregister, preRegister, register, setDomain, unregister, 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.Manager
add, addPropertyChangeListener, backgroundProcess, changeSessionId, changeSessionId, createSession, findSession, findSessions, getActiveSessions, getContext, getExpiredSessions, getMaxActive, getNotifyAttributeListenerOnUnchangedValue, getNotifyBindingListenerOnUnchangedValue, getRejectedSessions, getSessionAverageAliveTime, getSessionCounter, getSessionCreateRate, getSessionExpireRate, getSessionIdGenerator, getSessionMaxAliveTime, remove, remove, removePropertyChangeListener, rotateSessionId, setContext, setExpiredSessions, setMaxActive, setNotifyAttributeListenerOnUnchangedValue, setNotifyBindingListenerOnUnchangedValue, setSessionCounter, setSessionIdGenerator, setSessionMaxAliveTime, willAttributeDistribute
-
Field Details
-
sm
The string manager for this package. -
DEFAULT_REPL_TIMEOUT
protected static final long DEFAULT_REPL_TIMEOUT- See Also:
-
name
The name of this manager
-
-
Constructor Details
-
BackupManager
public BackupManager()Constructor, just calls super()
-
-
Method Details
-
messageDataReceived
Description copied from interface:ClusterManager
A message was received from another node, this is the callback method to implement if you are interested in receiving replication messages.- Specified by:
messageDataReceived
in interfaceClusterManager
- Parameters:
msg
- - the message received.
-
requestCompleted
Description copied from interface:ClusterManager
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. 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:
requestCompleted
in interfaceClusterManager
- Parameters:
sessionId
- - the sessionId that just completed.- Returns:
- a SessionMessage to be sent.
-
objectMadePrimary
- Specified by:
objectMadePrimary
in interfaceAbstractReplicatedMap.MapOwner
-
createEmptySession
Description copied from interface:Manager
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 interfaceManager
- Overrides:
createEmptySession
in classManagerBase
- Returns:
- An empty Session object
-
getName
Description copied from interface:ClusterManager
Return the name of the manager, at host /context name and at engine hostname+/context.- Specified by:
getName
in interfaceClusterManager
- Overrides:
getName
in classManagerBase
- Returns:
- The descriptive short name of this Manager implementation.
-
startInternal
Start 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:
startInternal
in classClusterManagerBase
- Throws:
LifecycleException
- if this component detects a fatal error that prevents this component from being used
-
getMapName
-
stopInternal
Stop this component and implement the requirements ofLifecycleBase.stopInternal()
. This will disconnect the cluster communication channel and stop the listener thread.- Overrides:
stopInternal
in classClusterManagerBase
- Throws:
LifecycleException
- if this component detects a fatal error that prevents this component from being used
-
setName
Description copied from interface:ClusterManager
Set the name of the manager, at host /context name and at engine hostname+/context- Specified by:
setName
in interfaceClusterManager
- Parameters:
name
- The manager name
-
setMapSendOptions
public void setMapSendOptions(int mapSendOptions) -
setMapSendOptions
-
getMapSendOptions
public int getMapSendOptions() -
getMapSendOptionsName
returns the SendOptions as a comma separated list of names- Returns:
- a comma separated list of the option names
-
setRpcTimeout
public void setRpcTimeout(long rpcTimeout) -
getRpcTimeout
public long getRpcTimeout() -
setTerminateOnStartFailure
public void setTerminateOnStartFailure(boolean terminateOnStartFailure) -
isTerminateOnStartFailure
public boolean isTerminateOnStartFailure() -
getAccessTimeout
public long getAccessTimeout() -
setAccessTimeout
public void setAccessTimeout(long accessTimeout) -
getInvalidatedSessions
Description copied from interface:ClusterManager
When 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:
getInvalidatedSessions
in interfaceClusterManager
- Returns:
- String[] The invalidated sessions
-
cloneFromTemplate
- Specified by:
cloneFromTemplate
in interfaceClusterManager
- Returns:
- a clone of a template manager configuration
-
getActiveSessionsFull
public int getActiveSessionsFull()Description copied from interface:DistributedManager
Returns the total session count for primary, backup and proxy.- Specified by:
getActiveSessionsFull
in interfaceDistributedManager
- Returns:
- The total session count across the cluster.
-
getSessionIdsFull
Description copied from interface:DistributedManager
Returns the list of all sessions IDS (primary, backup and proxy).- Specified by:
getSessionIdsFull
in interfaceDistributedManager
- Returns:
- The complete set of sessions IDs across the cluster.
-