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.int
getPid()
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.int
Returns the maximum number of ports to search when looking for one that is free.int
Returns the port number for the Socket based process id implementation.int
Returns the 'var' directory path.boolean
Returns if multiple last (i.e.boolean
Returns if the per-transaction warning on enlistment of multiple last resources is disabled or not.void
setAllowMultipleLastResources
(boolean allowMultipleLastResources) Sets if multiple last (i.e.void
setDisableMultipleLastResourcesWarning
(boolean disableMultipleLastResourcesWarning) Sets if the per-transaction warning on enlistment of multiple last resource is disabled or not.void
setNodeIdentifier
(String nodeIdentifier) Sets the node identifier.void
setPid
(int pid) Sets the process id to use if ManualProcessId is selected.void
setProcessImplementation
(Process instance) Sets the instance of com.arjuna.ats.arjuna.utils.Processvoid
setProcessImplementationClassName
(String processImplementationClassName) Sets the class name of the Process implementation to use.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.void
setSocketProcessIdPort
(int socketProcessIdPort) Sets the port on which the socket based process id implementation will listen.void
setTimeoutFactor
(int timeoutFactor) void
Sets 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:
getVarDir
in 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:
getNodeIdentifier
in 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:
getSocketProcessIdPort
in 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:
getSocketProcessIdMaxPorts
in 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:
getProcessImplementationClassName
in 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:
getPid
in 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:
isAllowMultipleLastResources
in 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:
isDisableMultipleLastResourcesWarning
in 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:
getBuildVersion
in interfaceCoreEnvironmentBeanMBean
- Returns:
- the version control tag of the source used, or "unknown"
-
getBuildId
- Specified by:
getBuildId
in interfaceCoreEnvironmentBeanMBean
- Returns:
- the build identification line indicating the os name and version and build date
-