JBoss.orgCommunity Documentation
Each module of the system contains a
class., which provides static getter methods for one or more
module
propertyManager
classes. An example is
name
EnvironmentBeancom.arjuna.ats.arjuna.commmon.arjPropertyManager
. These environment beans are standard
JavaBean containing properties for each configuration option in the system. Typical usage is of the form:
int defaultTimeout =
arjPropertyManager.getCoordinatorEnvironmentBean().getDefaultTimeout();
These beans are singletons, instantiated upon first access, using the following algorithm.
Procedure 6.1. Algorithm for environment bean instantiation
The properties are loaded and populated from a properties file named and located as follows:
If the properties file name property is set, its value is used as the file name.
If not, the default file name is used.
The file thus named is searched for by, in order
absolute path
user.dir
user.home
java.home
directories contained on the classpath
a default file embedded in the product .jar file.
The file is treated as being of standard java.util.Properties xml format and loaded accordingly. The entry
names are of the form EnvironmentBeanClass.propertyName:<entry
key="CoordinatorEnvironmentBean.commitOnePhase">YES</entry>
. Valid values for Boolean
properties are case-insensitive, and may be one of:
NO
YES
FALSE
TRUE
OFF
ON
In the case of properties that take multiple values, they are white-space-delimited.
Example 6.1. Example Environment Bean
<entry key="RecoveryEnvironmentBean.recoveryModuleClassNames">
com.arjuna.ats.internal.arjuna.recovery.AtomicActionRecoveryModule
com.arjuna.ats.internal.txoj.recovery.TORecoveryModule
</entry>
After the file is loaded, it is cached and is not re-read until the JVM is restarted. Changes to the properties file require a restart in order to take effect.
After the properties are loaded, the EnvironmentBean is then inspected and, for each field, if the properties
contains a matching key in the search order as follows, the setter
method for that field is invoked with the
value from the properties, or the system properties if different.
Fully.Qualified.NameEnvironmentBean.propertyName
NameEnvironmentBean.propertyName (this is the preferred form used in the properties file)
the old com.arjuna... properties key (deprecated, for backwards compatibility only).
The bean is then returned to the caller, which may further override values by calling setter methods.
The implementation reads most bean properties only once, as the consuming component or class is instantiated. This
usually happens the first time a transaction is run. As a result, calling setter
methods
to change the value of bean properties while the system is running typically has no effect, unless it is done
prior to any use of the transaction system. Altered bean properties are not persisted back to the properties file.
You can configure the system using a bean wiring system such as JBoss Microcontainer or Spring. Take care when instantiating beans, to obtain the singleton via the static getter (factory) method on the module property manager. Using a new bean instantiated with the default constructor is ineffective, since it is not possible to pass this configured bean back to the property management system.
The canonical reference for configuration options is the Javadoc of the various
EnvironmentBean
classes, For ArjunaCore these are:
com.arjuna.common.internal.util.logging.LoggingEnvironmentBean.java
com.arjuna.common.internal.util.logging.basic.BasicLogEnvironmentBean.java
com.arjuna.ats.txoj.common.TxojEnvironmentBean.java
com.arjuna.ats.arjuna.common.CoordinatorEnvironmentBean.java
com.arjuna.ats.arjuna.common.ObjectStoreEnvironmentBean.java
com.arjuna.ats.arjuna.common.RecoveryEnvironmentBean.java
com.arjuna.ats.arjuna.common.CoreEnvironmentBean.java
The canonical reference for configuration options is the javadoc of the various EnvironmentBean classes. For JBossJTA, these classes are the ones provided by ArjunaCore, as well as:
com.arjuna.ats.jdbc.common.JDBCEnvironmentBean.java
com.arjuna.ats.jta.common.JTAEnvironmentBean.java
The canonical reference for configuration options is the javadoc of the various
EnvironmentBean
classes, For ArjunaJTS these are the ones
provided by ArjunaCore, as well as:
com.arjuna.orbportability.common.OrbPortabilityEnvironmentBean.java
com.arjuna.ats.jts.common.JTSEnvironmentBean.java