Package com.arjuna.ats.arjuna.common
Class CoreEnvironmentBean
- java.lang.Object
-
- com.arjuna.ats.arjuna.common.CoreEnvironmentBean
-
- All Implemented Interfaces:
CoreEnvironmentBeanMBean
public class CoreEnvironmentBean extends Object implements CoreEnvironmentBeanMBean
A JavaBean containing assorted configuration properties for the core transaction system.- Author:
- Jonathan Halliday (jonathan.halliday@redhat.com)
-
-
Field Summary
Fields Modifier and Type Field Description static intNODE_NAME_SIZE
-
Constructor Summary
Constructors Constructor Description CoreEnvironmentBean()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetBuildId()StringgetBuildVersion()StringgetNodeIdentifier()Returns the Node Identifier.intgetPid()Returns the process id to use if ManualProcessId is selected.ProcessgetProcessImplementation()Returns an instance of a class implementing com.arjuna.ats.arjuna.utils.Process.StringgetProcessImplementationClassName()Returns the class name of the Process implementation to use.intgetSocketProcessIdMaxPorts()Returns the maximum number of ports to search when looking for one that is free.intgetSocketProcessIdPort()Returns the port number for the Socket based process id implementation.intgetTimeoutFactor()StringgetVarDir()Returns the 'var' directory path.booleanisAllowMultipleLastResources()Returns if multiple last (i.e.booleanisDisableMultipleLastResourcesWarning()Returns if the per-transaction warning on enlistment of multiple last resources is disabled or not.voidsetAllowMultipleLastResources(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.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)voidsetVarDir(String varDir)Sets the 'var' directory path
-
-
-
Field Detail
-
NODE_NAME_SIZE
public static final int NODE_NAME_SIZE
- See Also:
- Constant Field Values
-
-
Method Detail
-
getVarDir
public String 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
public void setVarDir(String varDir)
Sets the 'var' directory path- Parameters:
varDir- the path to the 'var' directory.
-
getNodeIdentifier
public String getNodeIdentifier()
Returns the Node Identifier. Default: null Equivalent deprecated property: com.arjuna.ats.arjuna.nodeIdentifier- Specified by:
getNodeIdentifierin interfaceCoreEnvironmentBeanMBean- Returns:
- the Node Identifier.
-
setNodeIdentifier
public void setNodeIdentifier(String nodeIdentifier) throws CoreEnvironmentBeanException
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
public String 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
public void setProcessImplementationClassName(String processImplementationClassName)
Sets the class name of the Process implementation to use.- Parameters:
processImplementationClassName- the name of a class implementing Process.
-
getProcessImplementation
public 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
public void setProcessImplementation(Process instance)
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
public String getBuildVersion()
- Specified by:
getBuildVersionin interfaceCoreEnvironmentBeanMBean- Returns:
- the version control tag of the source used, or "unknown"
-
getBuildId
public String getBuildId()
- Specified by:
getBuildIdin interfaceCoreEnvironmentBeanMBean- Returns:
- the build identification line indicating the os name and version and build date
-
-