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 Details

  • Constructor Details

    • CoreEnvironmentBean

      public CoreEnvironmentBean()
  • Method Details

    • 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:
      getVarDir in interface CoreEnvironmentBeanMBean
      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:
      getNodeIdentifier in interface CoreEnvironmentBeanMBean
      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:
      getSocketProcessIdPort in interface CoreEnvironmentBeanMBean
      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 interface CoreEnvironmentBeanMBean
      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:
      getProcessImplementationClassName in interface CoreEnvironmentBeanMBean
      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:
      getPid in interface CoreEnvironmentBeanMBean
      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 interface CoreEnvironmentBeanMBean
      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 interface CoreEnvironmentBeanMBean
      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:
      getBuildVersion in interface CoreEnvironmentBeanMBean
      Returns:
      the version control tag of the source used, or "unknown"
    • getBuildId

      public String getBuildId()
      Specified by:
      getBuildId in interface CoreEnvironmentBeanMBean
      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()