Package com.arjuna.ats.arjuna.common
Class CoreEnvironmentBean
java.lang.Object
com.arjuna.ats.arjuna.common.CoreEnvironmentBean
- All Implemented Interfaces:
CoreEnvironmentBeanMBean
A JavaBean containing assorted configuration properties for the core transaction system.
- Author:
- Jonathan Halliday (jonathan.halliday@redhat.com)
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the Node Identifier.intgetPid()Returns the process id to use if ManualProcessId is selected.Returns an instance of a class implementing com.arjuna.ats.arjuna.utils.Process.Returns the class name of the Process implementation to use.intReturns the maximum number of ports to search when looking for one that is free.intReturns the port number for the Socket based process id implementation.intReturns the 'var' directory path.booleanReturns if multiple last (i.e.booleanReturns if the per-transaction warning on enlistment of multiple last resources is disabled or not.booleanvoidsetAllowMultipleLastResources(boolean allowMultipleLastResources) Sets if multiple last (i.e.voidsetDisableMultipleLastResourcesWarning(boolean disableMultipleLastResourcesWarning) Sets if the per-transaction warning on enlistment of multiple last resource is disabled or not.voidsetLogAndRethrow(boolean logAndRethrow) Due to historical reasons some exceptions (a small number) are logged just before the exception is thrown.voidsetNodeIdentifier(String nodeIdentifier) Sets the node identifier.voidsetPid(int pid) Sets the process id to use if ManualProcessId is selected.voidsetProcessImplementation(Process instance) Sets the instance of com.arjuna.ats.arjuna.utils.ProcessvoidsetProcessImplementationClassName(String processImplementationClassName) Sets the class name of the Process implementation to use.voidsetSocketProcessIdMaxPorts(int socketProcessIdMaxPorts) Sets the maximum number of ports the socket process id implemention will try when searching to find one that is free.voidsetSocketProcessIdPort(int socketProcessIdPort) Sets the port on which the socket based process id implementation will listen.voidsetTimeoutFactor(int timeoutFactor) voidSets the 'var' directory path
-
Field Details
-
NODE_NAME_SIZE
public static final int NODE_NAME_SIZE- See Also:
-
-
Constructor Details
-
CoreEnvironmentBean
public CoreEnvironmentBean()
-
-
Method Details
-
getVarDir
Returns the 'var' directory path. Default: {user.dir}/var/tmp Equivalent deprecated property: com.arjuna.ats.arjuna.common.varDir- Specified by:
getVarDirin interfaceCoreEnvironmentBeanMBean- Returns:
- the 'var' directory name.
-
setVarDir
Sets the 'var' directory path- Parameters:
varDir- the path to the 'var' directory.
-
getNodeIdentifier
Returns the Node Identifier. Default: null Equivalent deprecated property: com.arjuna.ats.arjuna.nodeIdentifier- Specified by:
getNodeIdentifierin interfaceCoreEnvironmentBeanMBean- Returns:
- the Node Identifier.
-
setNodeIdentifier
Sets the node identifier. Should be uniq amongst all instances that share resource managers or an objectstore.- Parameters:
nodeIdentifier- the Node Identifier.- Throws:
CoreEnvironmentBeanException- if node identifier is null or too long.
-
getSocketProcessIdPort
public int getSocketProcessIdPort()Returns the port number for the Socket based process id implementation. Default: 0 (use any free port) Equivalent deprecated property: com.arjuna.ats.internal.arjuna.utils.SocketProcessIdPort- Specified by:
getSocketProcessIdPortin interfaceCoreEnvironmentBeanMBean- Returns:
- the port number.
-
setSocketProcessIdPort
public void setSocketProcessIdPort(int socketProcessIdPort) Sets the port on which the socket based process id implementation will listen. Should be uniq amongst all instances on the same host. A value of 0 will result in a random port.- Parameters:
socketProcessIdPort- the port number to bind to.
-
getTimeoutFactor
public int getTimeoutFactor() -
setTimeoutFactor
public void setTimeoutFactor(int timeoutFactor) -
getSocketProcessIdMaxPorts
public int getSocketProcessIdMaxPorts()Returns the maximum number of ports to search when looking for one that is free. Default: 1 Equivalent deprecated property: com.arjuna.ats.internal.arjuna.utils.SocketProcessIdMaxPorts- Specified by:
getSocketProcessIdMaxPortsin interfaceCoreEnvironmentBeanMBean- Returns:
- the maximum number of ports to try.
-
setSocketProcessIdMaxPorts
public void setSocketProcessIdMaxPorts(int socketProcessIdMaxPorts) Sets the maximum number of ports the socket process id implemention will try when searching to find one that is free.- Parameters:
socketProcessIdMaxPorts- the maximum number of ports to try.
-
getProcessImplementationClassName
Returns the class name of the Process implementation to use. Default: "com.arjuna.ats.internal.arjuna.utils.SocketProcessId" Equivalent deprecated property: com.arjuna.ats.internal.arjuna.utils.processImplementation- Specified by:
getProcessImplementationClassNamein interfaceCoreEnvironmentBeanMBean- Returns:
- the name of a class implementing Process.
-
setProcessImplementationClassName
Sets the class name of the Process implementation to use.- Parameters:
processImplementationClassName- the name of a class implementing Process.
-
getProcessImplementation
Returns an instance of a class implementing com.arjuna.ats.arjuna.utils.Process. If there is no pre-instantiated instance set and classloading or instantiation fails, this method will log an appropriate warning and return null, not throw an exception.- Returns:
- a Process implementation instance, or null.
-
setProcessImplementation
Sets the instance of com.arjuna.ats.arjuna.utils.Process- Parameters:
instance- an Object that implements Process, or null.
-
getPid
public int getPid()Returns the process id to use if ManualProcessId is selected. Should be uniq across all instances on the same host. Default: -1 (invalid, must be changed if used) Equivalent deprecated property: com.arjuna.ats.internal.arjuna.utils.pid- Specified by:
getPidin interfaceCoreEnvironmentBeanMBean- Returns:
- the process id to use.
-
setPid
public void setPid(int pid) Sets the process id to use if ManualProcessId is selected. Should be on the range 1-65535 and uniq across all instances on the same host.- Parameters:
pid- the process id to use.
-
isAllowMultipleLastResources
public boolean isAllowMultipleLastResources()Returns if multiple last (i.e. one-phase) resources are allowed in the same transaction or not. Default: false Equivalent deprecated property: com.arjuna.ats.arjuna.allowMultipleLastResources- Specified by:
isAllowMultipleLastResourcesin interfaceCoreEnvironmentBeanMBean- Returns:
- true if multiple last resources are permitted, false otherwise.
-
setAllowMultipleLastResources
public void setAllowMultipleLastResources(boolean allowMultipleLastResources) Sets if multiple last (i.e. one-phase) resources are allowed in the same transaction or not. Caution: setting a value of true weakens transactional (ACID) guarantees and is not recommended.- Parameters:
allowMultipleLastResources- true if multiple 1PC resource should be permitted, false otherwise.
-
isDisableMultipleLastResourcesWarning
public boolean isDisableMultipleLastResourcesWarning()Returns if the per-transaction warning on enlistment of multiple last resources is disabled or not. Default: false. Equivalent deprecated property: com.arjuna.ats.arjuna.disableMultipleLastResourcesWarning- Specified by:
isDisableMultipleLastResourcesWarningin interfaceCoreEnvironmentBeanMBean- Returns:
- true if warning is disabled, false otherwise.
-
setDisableMultipleLastResourcesWarning
public void setDisableMultipleLastResourcesWarning(boolean disableMultipleLastResourcesWarning) Sets if the per-transaction warning on enlistment of multiple last resource is disabled or not.- Parameters:
disableMultipleLastResourcesWarning- true to disable the warning, false otherwise.
-
getBuildVersion
- Specified by:
getBuildVersionin interfaceCoreEnvironmentBeanMBean- Returns:
- the version control tag of the source used, or "unknown"
-
getBuildId
- Specified by:
getBuildIdin interfaceCoreEnvironmentBeanMBean- Returns:
- the build identification line indicating the os name and version and build date
-
setLogAndRethrow
public void setLogAndRethrow(boolean logAndRethrow) Due to historical reasons some exceptions (a small number) are logged just before the exception is thrown. Such behavior is considered to be an antipattern. To avoid this behaviour call this setter with the value false (the default is true). Note that there are only a few places in the code where this antipattern is followed. The behaviour is now configurable because some of the log messages contain more information than is available in the exception or the caller that receives the exception does not log the problem, or the problem is reported by an internal thread, or the problem is on the server side of a client server interaction.- Parameters:
logAndRethrow- when false avoid, where possible, the log and rethrow antipattern
-
isLogAndRethrow
public boolean isLogAndRethrow()
-