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.byte[]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.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(byte[] nodeIdentifierBytes) Sets the node identifier bytes and must be unique amongst all instances that share resource managers or an objectstore.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.This config setting has the side effect of setting the node identifier bytes by extracting the bytes from the passed in String using the UTF_8 character set (if you need to control the length of the byte array please use the
methoddirectly).- Parameters:
nodeIdentifier- the Node Identifier.- Throws:
CoreEnvironmentBeanException- if node identifier is null or too long.
-
getNodeIdentifierBytes
public byte[] getNodeIdentifierBytes() -
setNodeIdentifier
Sets the node identifier bytes and must be unique amongst all instances that share resource managers or an objectstore. This method is subtly different from the other form because it does not use any character encoding (such encodings can change the length of a Java String). The byte array is restricted to 28 bytes - the length restriction is required because these bytes are encoded into other structures which have limited sizes.This config setting has the side effect of setting the node identifier String (by encoding the passed in bytes with the UTF_8 character set) and if the length of the resulting String is greater than
NODE_NAME_SIZEthen a CoreEnvironmentBeanException is thrown.- Parameters:
nodeIdentifierBytes- the bytes for 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
-