Package com.arjuna.ats.arjuna.common
Class RecoveryEnvironmentBean
java.lang.Object
com.arjuna.ats.arjuna.common.RecoveryEnvironmentBean
- All Implemented Interfaces:
RecoveryEnvironmentBeanMBean
A JavaBean containing configuration properties for the recovery system.
- Author:
- Jonathan Halliday (jonathan.halliday@redhat.com)
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
Returns the interval on which the ObjectStore will be scanned for expired items, in hours.Returns a list of names of classes that implement ExpiryScanner.Returns the set of ExpiryScanner instances.int
Returns the initial period to wait before starting recovery.int
Returns the interval between recovery scans, in seconds.Returns a list of names of classes that implement RecoveryActivator.Returns the set of RecoveryActivator instances.Returns the hostname on which the recovery listener should bind.int
Returns the interval between recovery phases within a recovery scan, in seconds.Returns a list of names of classes that implement RecoveryModule.Returns the set of RecoveryModule instances.int
Returns the network port number on which the recovery listener should bind.Returns the hostname on which the transaction status manager should bind.int
Returns the time period after which items will be considered to have expired, in hours.int
Returns the network port number on which the transaction status manager should bind.boolean
Returns true if the recovery system should listen on a network socket.boolean
Returns true if SO_TIMEOUT should be set on Listener socket instances.boolean
This method gives information about the behaviour ofRecoveryManager
when suspending.void
setExpiryScanInterval
(int expiryScanInterval) Sets the interval on which the ObjectStore will be scanned for expired items, in hours.void
setExpiryScannerClassNames
(List<String> expiryScannerClassNames) Sets the expiry scanners.void
setExpiryScanners
(List<ExpiryScanner> expiryScanners) Sets the instances of ExpiryScanner.setPeriodicRecoveryInitilizationOffset
(int periodicRecoveryInitilizationOffset) Set the period of time to wait before starting recovery.void
setPeriodicRecoveryPeriod
(int periodicRecoveryPeriod) Sets the interval between recovery scans, in seconds.void
setRecoveryActivatorClassNames
(List<String> recoveryActivatorClassNames) Sets the recovery activators.void
setRecoveryActivators
(List<RecoveryActivator> recoveryActivators) Sets the instances of RecoveryActivator.void
setRecoveryAddress
(String recoveryAddress) Sets the hostname on which the recovery listener should bind.void
setRecoveryBackoffPeriod
(int recoveryBackoffPeriod) Sets the interval between recovery phases, in seconds.void
setRecoveryInetAddress
(InetAddress inetAddress) Sets the InetAddress on which the recovery listener should bind.void
setRecoveryListener
(boolean recoveryListener) Sets if the recovery system should listen on a network socket or not.void
setRecoveryModuleClassNames
(List<String> recoveryModuleClassNames) Sets the recovery modules.void
setRecoveryModules
(List<RecoveryModule> recoveryModules) Sets the instances of RecoveryModule.void
setRecoveryPort
(int recoveryPort) Sets the network port number on which the recovery listener should bind.void
setTimeoutSocket
(boolean timeoutSocket) Sets the socket timeout behaviour of the Listener instances.void
setTransactionStatusManagerAddress
(String transactionStatusManagerAddress) Sets the hostname on which the transaction status manager should bind.void
setTransactionStatusManagerExpiryTime
(int transactionStatusManagerExpiryTime) Sets the time period after which items will be considered to have expired, in hours.void
setTransactionStatusManagerInetAddress
(InetAddress inetAddress) Sets the InetAddress on which the transaction status manager should bind.void
setTransactionStatusManagerPort
(int transactionStatusManagerPort) Sets the network port number on which the transaction status manager should bind.void
setWaitForWorkLeftToDo
(boolean waitForWorkLeftToDo) Configure the suspension ofRecoveryManager
-
Constructor Details
-
RecoveryEnvironmentBean
public RecoveryEnvironmentBean()
-
-
Method Details
-
getPeriodicRecoveryPeriod
public int getPeriodicRecoveryPeriod()Returns the interval between recovery scans, in seconds. Default: 120 seconds Equivalent deprecated property: com.arjuna.ats.arjuna.recovery.periodicRecoveryPeriod- Specified by:
getPeriodicRecoveryPeriod
in interfaceRecoveryEnvironmentBeanMBean
- Returns:
- the recovery scan period, in seconds.
-
setPeriodicRecoveryPeriod
public void setPeriodicRecoveryPeriod(int periodicRecoveryPeriod) Sets the interval between recovery scans, in seconds.- Parameters:
periodicRecoveryPeriod
- the recovery scan period, in seconds.
-
getRecoveryBackoffPeriod
public int getRecoveryBackoffPeriod()Returns the interval between recovery phases within a recovery scan, in seconds. Default: 10 seconds Equivalent deprecated property: com.arjuna.ats.arjuna.recovery.recoveryBackoffPeriod- Specified by:
getRecoveryBackoffPeriod
in interfaceRecoveryEnvironmentBeanMBean
- Returns:
- the interval between recovery phases, in seconds.
-
setRecoveryBackoffPeriod
public void setRecoveryBackoffPeriod(int recoveryBackoffPeriod) Sets the interval between recovery phases, in seconds.- Parameters:
recoveryBackoffPeriod
- the interval between recovery scan phases, in seconds.
-
getPeriodicRecoveryInitilizationOffset
public int getPeriodicRecoveryInitilizationOffset()Returns the initial period to wait before starting recovery. Useful when starting multiple servers at once.- Returns:
- The initial offset (in seconds)
-
setPeriodicRecoveryInitilizationOffset
public RecoveryEnvironmentBean setPeriodicRecoveryInitilizationOffset(int periodicRecoveryInitilizationOffset) Set the period of time to wait before starting recovery.- Parameters:
periodicRecoveryInitilizationOffset
- The period (in seconds) to wait before starting first recovery run.
-
isRecoveryListener
public boolean isRecoveryListener()Returns true if the recovery system should listen on a network socket. Default: true Equivalent deprecated property: com.arjuna.ats.arjuna.recovery.recoveryListener- Specified by:
isRecoveryListener
in interfaceRecoveryEnvironmentBeanMBean
- Returns:
- true for network recovery, false for local JVM only use.
-
setRecoveryListener
public void setRecoveryListener(boolean recoveryListener) Sets if the recovery system should listen on a network socket or not.- Parameters:
recoveryListener
- true for network use, false for local JVM only.
-
getRecoveryPort
public int getRecoveryPort()Returns the network port number on which the recovery listener should bind. Default: 0 Equivalent deprecated property: com.arjuna.ats.arjuna.recovery.recoveryPort- Specified by:
getRecoveryPort
in interfaceRecoveryEnvironmentBeanMBean
- Returns:
- the port number for recovery listener.
-
setRecoveryPort
public void setRecoveryPort(int recoveryPort) Sets the network port number on which the recovery listener should bind.- Parameters:
recoveryPort
- the port number for the recovery listener.
-
getRecoveryAddress
Returns the hostname on which the recovery listener should bind. Default: "localhost" Equivalent deprecated property: com.arjuna.ats.arjuna.recovery.recoveryAddress- Specified by:
getRecoveryAddress
in interfaceRecoveryEnvironmentBeanMBean
- Returns:
- the hostname on which the recovery system will listen.
-
setRecoveryAddress
Sets the hostname on which the recovery listener should bind.- Parameters:
recoveryAddress
- the hostname on which the recovery system will listen.
-
setRecoveryInetAddress
Sets the InetAddress on which the recovery listener should bind. Mainly intended for use by strongly typed bean injection systems, this is a wrapper around the String form of the method.- Parameters:
inetAddress
- the address on which to bind the recovery listener.
-
getTransactionStatusManagerPort
public int getTransactionStatusManagerPort()Returns the network port number on which the transaction status manager should bind. Default: 0 Equivalent deprecated property: com.arjuna.ats.arjuna.recovery.transactionStatusManagerPort- Specified by:
getTransactionStatusManagerPort
in interfaceRecoveryEnvironmentBeanMBean
- Returns:
- the port number for the transaction status manager listener.
-
setTransactionStatusManagerPort
public void setTransactionStatusManagerPort(int transactionStatusManagerPort) Sets the network port number on which the transaction status manager should bind.- Parameters:
transactionStatusManagerPort
- the port number for the transaction status manager listener.
-
getTransactionStatusManagerAddress
Returns the hostname on which the transaction status manager should bind. Default: "localhost" Equivalent deprecated property: com.arjuna.ats.arjuna.recovery.transactionStatusManagerAddress- Specified by:
getTransactionStatusManagerAddress
in interfaceRecoveryEnvironmentBeanMBean
- Returns:
- the hostname on which the transaction status manager will listen.
-
setTransactionStatusManagerAddress
Sets the hostname on which the transaction status manager should bind.- Parameters:
transactionStatusManagerAddress
- the hostname on which the transaction status manager will listen.
-
setTransactionStatusManagerInetAddress
Sets the InetAddress on which the transaction status manager should bind. Mainly intended for use by strongly typed bean injection systems, this is a wrapper around the String form of the method.- Parameters:
inetAddress
- the address on which to bind the transaction status manager.
-
getExpiryScanInterval
public int getExpiryScanInterval()Returns the interval on which the ObjectStore will be scanned for expired items, in hours. Default: 12 hours Equivalent deprecated property: com.arjuna.ats.arjuna.recovery.expiryScanInterval- Specified by:
getExpiryScanInterval
in interfaceRecoveryEnvironmentBeanMBean
- Returns:
- the interval between ObjectStore expiry checks, in hours.
-
setExpiryScanInterval
public void setExpiryScanInterval(int expiryScanInterval) Sets the interval on which the ObjectStore will be scanned for expired items, in hours.- Parameters:
expiryScanInterval
- the interval between ObjectStore expiry checks, in hours.
-
getTransactionStatusManagerExpiryTime
public int getTransactionStatusManagerExpiryTime()Returns the time period after which items will be considered to have expired, in hours. Default: 12 hours Equivalent deprecated property: com.arjuna.ats.arjuna.recovery.transactionStatusManagerExpiryTime- Specified by:
getTransactionStatusManagerExpiryTime
in interfaceRecoveryEnvironmentBeanMBean
- Returns:
- the expiry timeout, in hours.
-
setTransactionStatusManagerExpiryTime
public void setTransactionStatusManagerExpiryTime(int transactionStatusManagerExpiryTime) Sets the time period after which items will be considered to have expired, in hours.- Parameters:
transactionStatusManagerExpiryTime
- the expiry timeout, in hours.
-
getExpiryScannerClassNames
Returns a list of names of classes that implement ExpiryScanner. The returned list is a copy. May return an empty list, will not return null. Default: empty list. Equivalent deprecated property prefix: com.arjuna.ats.arjuna.recovery.expiryScanner- Specified by:
getExpiryScannerClassNames
in interfaceRecoveryEnvironmentBeanMBean
- Returns:
- a list of ExpiryScanner implementation class names.
-
setExpiryScannerClassNames
Sets the expiry scanners. List elements should be names of classes that implement ExpiryScanner. The provided list will be copied, not retained.- Parameters:
expiryScannerClassNames
- a list of ExpiryScanner implementation class names.
-
getExpiryScanners
Returns the set of ExpiryScanner instances. The returned list is a copy. May return an empty list, will not return null. If there is no pre-instantiated instance set and classloading or instantiation of one or more elements fails, this method will log an appropriate warning and return a non-null set with fewer elements.- Returns:
- the set of ExpiryScanner instances.
-
setExpiryScanners
Sets the instances of ExpiryScanner. The provided list will be copied, not retained.- Parameters:
expiryScanners
- the set of ExpiryScanner instances.
-
getRecoveryModuleClassNames
Returns a list of names of classes that implement RecoveryModule. The returned list is a copy. May return an empty list, will not return null. Default: empty list. Equivalent deprecated property prefix:- Specified by:
getRecoveryModuleClassNames
in interfaceRecoveryEnvironmentBeanMBean
- Returns:
- a list of RecoveryModule implementation class names.
-
setRecoveryModuleClassNames
Sets the recovery modules. List elements should be names of classes that implement RecoveryModule. The provided list will be copied, not retained.- Parameters:
recoveryModuleClassNames
- a list of RecoveryModule implementation class names.
-
getRecoveryModules
Returns the set of RecoveryModule instances. The returned list is a copy. May return an empty list, will not return null. If there is no pre-instantiated instance set and classloading or instantiation of one or more elements fails, this method will log an appropriate warning and return a non-null set with fewer elements.- Returns:
- the set of RecoveryModule instances.
-
setRecoveryModules
Sets the instances of RecoveryModule. The provided list will be copied, not retained.- Parameters:
recoveryModules
- the set of RecoveryModule instances.
-
getRecoveryActivatorClassNames
Returns a list of names of classes that implement RecoveryActivator. The returned list is a copy. May return an empty list, will not return null. Default: empty list. Equivalent deprecated property prefix:- Specified by:
getRecoveryActivatorClassNames
in interfaceRecoveryEnvironmentBeanMBean
- Returns:
- a list of RecoveryActivator implementation class names.
-
setRecoveryActivatorClassNames
Sets the recovery activators. List elements should be names of classes that implement RecoveryActivator. The provided list will be copied, not retained.- Parameters:
recoveryActivatorClassNames
- a list of RecoveryActivator implementation class names.
-
getRecoveryActivators
Returns the set of RecoveryActivator instances. The returned list is a copy. May return an empty list, will not return null. If there is no pre-instantiated instance set and classloading or instantiation of one or more elements fails, this method will log an appropriate warning and return a non-null set with fewer elements.- Returns:
- the set of RecoveryActivator instances.
-
setRecoveryActivators
Sets the instances of RecoveryActivator. The provided list will be copied, not retained.- Parameters:
recoveryActivators
- the set of RecoveryActivator instances.
-
isTimeoutSocket
public boolean isTimeoutSocket()Returns true if SO_TIMEOUT should be set on Listener socket instances. Default: false Equivalent deprecated property: com.arjuna.ats.internal.arjuna.recovery.listener.timeoutsocket- Specified by:
isTimeoutSocket
in interfaceRecoveryEnvironmentBeanMBean
- Returns:
- true if SO_TIMEOUT should be used, false if not.
-
setTimeoutSocket
public void setTimeoutSocket(boolean timeoutSocket) Sets the socket timeout behaviour of the Listener instances.- Parameters:
timeoutSocket
- true to enable timeouts, false to disable.
-
isWaitForWorkLeftToDo
public boolean isWaitForWorkLeftToDo()This method gives information about the behaviour of
RecoveryManager
when suspending.The current list of Narayana-provided RecoveryModules that support this feature is:
- com.arjuna.ats.internal.arjuna.recovery.AtomicActionRecoveryModule
- Specified by:
isWaitForWorkLeftToDo
in interfaceRecoveryEnvironmentBeanMBean
- Returns:
- true if
RecoveryManager
should wait that allRecoveryModule
overridingRecoveryModule.hasWorkLeftToDo()
recover all their transactions before shutting down; false otherwise.
-
setWaitForWorkLeftToDo
public void setWaitForWorkLeftToDo(boolean waitForWorkLeftToDo) Configure the suspension ofRecoveryManager
- Parameters:
waitForWorkLeftToDo
- true ifRecoveryManager
should wait that allRecoveryModule
overridingRecoveryModule.hasWorkLeftToDo()
recover all their transactions before shutting down; false otherwise.
-