[jboss-svn-commits] JBL Code SVN: r28784 - in labs/jbosstm/trunk: ArjunaCore/arjuna/tests/classes/com/hp/mwtests/ts/arjuna/common and 17 other directories.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Tue Aug 4 05:30:37 EDT 2009
Author: jhalliday
Date: 2009-08-04 05:30:36 -0400 (Tue, 04 Aug 2009)
New Revision: 28784
Modified:
labs/jbosstm/trunk/ArjunaCore/arjuna/tests/classes/com/hp/mwtests/ts/arjuna/common/BeanPopulatorTest.java
labs/jbosstm/trunk/ArjunaCore/jbossts-properties-arjunacore.xml
labs/jbosstm/trunk/ArjunaCore/txoj/tests/classes/com/hp/mwtests/ts/txoj/basic/BeanPopulatorTest.java
labs/jbosstm/trunk/ArjunaJTA/jbossts-properties-arjunajta.xml
labs/jbosstm/trunk/ArjunaJTA/jdbc/tests/classes/com/hp/mwtests/ts/jdbc/basic/BeanPopulatorTest.java
labs/jbosstm/trunk/ArjunaJTA/jta/tests/classes/com/hp/mwtests/ts/jta/basic/BeanPopulatorTest.java
labs/jbosstm/trunk/ArjunaJTS/jbossts-properties-arjunajts.xml
labs/jbosstm/trunk/ArjunaJTS/jts/classes/com/arjuna/ats/internal/jts/OTSImpleManager.java
labs/jbosstm/trunk/ArjunaJTS/jts/classes/com/arjuna/ats/internal/jts/context/ContextPropagationManager.java
labs/jbosstm/trunk/ArjunaJTS/jts/classes/com/arjuna/ats/internal/jts/orbspecific/TransactionFactoryImple.java
labs/jbosstm/trunk/ArjunaJTS/jts/classes/com/arjuna/ats/internal/jts/orbspecific/coordinator/ArjunaTransactionImple.java
labs/jbosstm/trunk/ArjunaJTS/jts/classes/com/arjuna/ats/internal/jts/orbspecific/interposition/coordinator/ServerTransaction.java
labs/jbosstm/trunk/ArjunaJTS/jts/classes/com/arjuna/ats/internal/jts/orbspecific/jacorb/recoverycoordinators/JacOrbRCServiceInit.java
labs/jbosstm/trunk/ArjunaJTS/jts/classes/com/arjuna/ats/jts/common/InterceptorInfo.java
labs/jbosstm/trunk/ArjunaJTS/jts/classes/com/arjuna/ats/jts/common/JTSEnvironmentBean.java
labs/jbosstm/trunk/ArjunaJTS/jts/classes/com/arjuna/ats/jts/common/jtsPropertyManager.java
labs/jbosstm/trunk/ArjunaJTS/jts/tests/classes/com/hp/mwtests/ts/jts/BeanPopulatorTest.java
labs/jbosstm/trunk/ArjunaJTS/jts/tests/classes/com/hp/mwtests/ts/jts/local/timeout/DefaultTimeout.java
labs/jbosstm/trunk/ArjunaJTS/orbportability/tests/classes/com/hp/mwtests/orbportability/initialisation/BeanPopulatorTest.java
labs/jbosstm/trunk/common/classes/com/arjuna/common/internal/util/propertyservice/BeanPopulator.java
labs/jbosstm/trunk/common/tests/com/arjuna/common/tests/simple/EnvironmentBeanTest.java
Log:
Further beanification of the config. JBTM-596
Modified: labs/jbosstm/trunk/ArjunaCore/arjuna/tests/classes/com/hp/mwtests/ts/arjuna/common/BeanPopulatorTest.java
===================================================================
--- labs/jbosstm/trunk/ArjunaCore/arjuna/tests/classes/com/hp/mwtests/ts/arjuna/common/BeanPopulatorTest.java 2009-08-04 09:13:43 UTC (rev 28783)
+++ labs/jbosstm/trunk/ArjunaCore/arjuna/tests/classes/com/hp/mwtests/ts/arjuna/common/BeanPopulatorTest.java 2009-08-04 09:30:36 UTC (rev 28784)
@@ -57,6 +57,6 @@
Set<String> expectedKeys = new HashSet<String>();
expectedKeys.addAll( DummyPropertyManager.extractKeys(Environment.class));
- assertEquals(expectedKeys, testManager.usedKeys);
+ assertTrue( testManager.usedKeys.containsAll(expectedKeys) );
}
}
Modified: labs/jbosstm/trunk/ArjunaCore/jbossts-properties-arjunacore.xml
===================================================================
--- labs/jbosstm/trunk/ArjunaCore/jbossts-properties-arjunacore.xml 2009-08-04 09:13:43 UTC (rev 28783)
+++ labs/jbosstm/trunk/ArjunaCore/jbossts-properties-arjunacore.xml 2009-08-04 09:30:36 UTC (rev 28784)
@@ -50,25 +50,19 @@
-->
-
+
<!-- (default is YES) -->
- <entry key="com.arjuna.ats.arjuna.coordinator.commitOnePhase">YES</entry>
+ <entry key="CoordinatorEnvironmentBean.commitOnePhase">YES</entry>
- <!-- (default is defaultStore) -->
- <entry key="com.arjuna.ats.arjuna.objectstore.localOSRoot">defaultStore</entry>
-
<!-- default is under user.home - must be writeable!) -->
- <entry key="com.arjuna.ats.arjuna.objectstore.objectStoreDir">PutObjectStoreDirHere</entry>
+ <entry key="ObjectStoreEnvironmentBean.objectStoreDir">PutObjectStoreDirHere</entry>
<!-- (default is ON) -->
- <entry key="com.arjuna.ats.arjuna.objectstore.transactionSync">ON</entry>
+ <entry key="ObjectStoreEnvironmentBean.transactionSync">ON</entry>
<!-- (Must be unique across all Arjuna instances.) -->
- <entry key="com.arjuna.ats.arjuna.xa.nodeIdentifier">1</entry>
+ <entry key="CoreEnvironmentBean.nodeIdentifier">1</entry>
- <!-- Which Xid types to recover -->
- <entry key="com.arjuna.ats.jta.xaRecoveryNode">1</entry>
-
<!--
Base port number for determining a unique number to associate with an instance of the transaction service
(which is needed in order to support multiple instances on the same machine).
@@ -78,12 +72,10 @@
com.arjuna.ats.internal.arjuna.utils.SocketProcessIdMaxPorts property) have been tried or until the port number
reaches the maximum possible port number.
-->
- <entry key="com.arjuna.ats.internal.arjuna.utils.SocketProcessIdPort">0</entry>
+ <entry key="CoreEnvironmentBean.socketProcessIdPort">0</entry>
+
-
-
-
<!--
Periodic recovery modules to use. Invoked in sort-order of names.
Check http://www.jboss.org/community/docs/DOC-10788 for more information
@@ -108,22 +100,22 @@
The address and port number on which the recovery manager listens
If running within an AS then the address the AS is bound to (jboss.bind.address) takes precedence
-->
- <entry key="com.arjuna.ats.arjuna.recovery.recoveryPort">4712</entry>
+ <entry key="RecoveryEnvironmentBean.recoveryPort">4712</entry>
- <entry key="com.arjuna.ats.arjuna.recovery.recoveryAddress"></entry>
+ <entry key="RecoveryEnvironmentBean.recoveryAddress"></entry>
<!--
Use this to fix the port on which the TransactionStatusManager listens,
The default behaviour is to use any free port.
-->
- <entry key="com.arjuna.ats.arjuna.recovery.transactionStatusManagerPort">0</entry>
+ <entry key="RecoveryEnvironmentBean.transactionStatusManagerPort">0</entry>
<!--
Use this to fix the address on which the TransactionStatusManager binds,
The default behaviour is to use the loopback address (ie localhost).
If running within an AS then the address the AS is bound to (jboss.bind.address) takes precedence
-->
- <entry key="com.arjuna.ats.arjuna.recovery.transactionStatusManagerAddress"></entry>
+ <entry key="RecoveryEnvironmentBean.transactionStatusManagerAddress"></entry>
<!--
For cases where the recovery manager is in process with the transaction manager and nothing else uses
@@ -131,6 +123,7 @@
Caution: use of this property can allow multiple recovery processes to run on the same ObjectStore
if you are not careful. That in turn can lead to incorrect transaction processing. Use with care.
-->
- <entry key="com.arjuna.ats.arjuna.recovery.recoveryListener">YES</entry>
+ <entry key="RecoveryEnvironmentBean.recoveryListener">YES</entry>
+
</properties>
Modified: labs/jbosstm/trunk/ArjunaCore/txoj/tests/classes/com/hp/mwtests/ts/txoj/basic/BeanPopulatorTest.java
===================================================================
--- labs/jbosstm/trunk/ArjunaCore/txoj/tests/classes/com/hp/mwtests/ts/txoj/basic/BeanPopulatorTest.java 2009-08-04 09:13:43 UTC (rev 28783)
+++ labs/jbosstm/trunk/ArjunaCore/txoj/tests/classes/com/hp/mwtests/ts/txoj/basic/BeanPopulatorTest.java 2009-08-04 09:30:36 UTC (rev 28784)
@@ -21,7 +21,8 @@
package com.hp.mwtests.ts.txoj.basic;
import org.junit.Test;
-import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.*;
+
import com.arjuna.common.tests.simple.DummyPropertyManager;
import com.arjuna.common.internal.util.propertyservice.BeanPopulator;
import com.arjuna.ats.txoj.common.TxojEnvironmentBean;
@@ -51,6 +52,6 @@
Set<String> expectedKeys = new HashSet<String>();
expectedKeys.addAll( DummyPropertyManager.extractKeys(Environment.class));
- assertEquals(expectedKeys, testManager.usedKeys);
+ assertTrue( testManager.usedKeys.containsAll(expectedKeys) );
}
}
Modified: labs/jbosstm/trunk/ArjunaJTA/jbossts-properties-arjunajta.xml
===================================================================
--- labs/jbosstm/trunk/ArjunaJTA/jbossts-properties-arjunajta.xml 2009-08-04 09:13:43 UTC (rev 28783)
+++ labs/jbosstm/trunk/ArjunaJTA/jbossts-properties-arjunajta.xml 2009-08-04 09:30:36 UTC (rev 28784)
@@ -52,19 +52,16 @@
<!-- (default is YES) -->
- <entry key="com.arjuna.ats.arjuna.coordinator.commitOnePhase">YES</entry>
+ <entry key="CoordinatorEnvironmentBean.commitOnePhase">YES</entry>
- <!-- (default is defaultStore) -->
- <entry key="com.arjuna.ats.arjuna.objectstore.localOSRoot">defaultStore</entry>
-
<!-- default is under user.home - must be writeable!) -->
- <entry key="com.arjuna.ats.arjuna.objectstore.objectStoreDir">PutObjectStoreDirHere</entry>
+ <entry key="ObjectStoreEnvironmentBean.objectStoreDir">PutObjectStoreDirHere</entry>
<!-- (default is ON) -->
- <entry key="com.arjuna.ats.arjuna.objectstore.transactionSync">ON</entry>
+ <entry key="ObjectStoreEnvironmentBean.transactionSync">ON</entry>
<!-- (Must be unique across all Arjuna instances.) -->
- <entry key="com.arjuna.ats.arjuna.xa.nodeIdentifier">1</entry>
+ <entry key="CoreEnvironmentBean.nodeIdentifier">1</entry>
<!-- Which Xid types to recover -->
<entry key="com.arjuna.ats.jta.xaRecoveryNode">1</entry>
@@ -78,7 +75,7 @@
com.arjuna.ats.internal.arjuna.utils.SocketProcessIdMaxPorts property) have been tried or until the port number
reaches the maximum possible port number.
-->
- <entry key="com.arjuna.ats.internal.arjuna.utils.SocketProcessIdPort">0</entry>
+ <entry key="CoreEnvironmentBean.socketProcessIdPort">0</entry>
@@ -110,22 +107,22 @@
The address and port number on which the recovery manager listens
If running within an AS then the address the AS is bound to (jboss.bind.address) takes precedence
-->
- <entry key="com.arjuna.ats.arjuna.recovery.recoveryPort">4712</entry>
+ <entry key="RecoveryEnvironmentBean.recoveryPort">4712</entry>
- <entry key="com.arjuna.ats.arjuna.recovery.recoveryAddress"></entry>
+ <entry key="RecoveryEnvironmentBean.recoveryAddress"></entry>
<!--
Use this to fix the port on which the TransactionStatusManager listens,
The default behaviour is to use any free port.
-->
- <entry key="com.arjuna.ats.arjuna.recovery.transactionStatusManagerPort">0</entry>
+ <entry key="RecoveryEnvironmentBean.transactionStatusManagerPort">0</entry>
<!--
Use this to fix the address on which the TransactionStatusManager binds,
The default behaviour is to use the loopback address (ie localhost).
If running within an AS then the address the AS is bound to (jboss.bind.address) takes precedence
-->
- <entry key="com.arjuna.ats.arjuna.recovery.transactionStatusManagerAddress"></entry>
+ <entry key="RecoveryEnvironmentBean.transactionStatusManagerAddress"></entry>
<!--
For cases where the recovery manager is in process with the transaction manager and nothing else uses
@@ -133,14 +130,6 @@
Caution: use of this property can allow multiple recovery processes to run on the same ObjectStore
if you are not careful. That in turn can lead to incorrect transaction processing. Use with care.
-->
- <entry key="com.arjuna.ats.arjuna.recovery.recoveryListener">YES</entry>
+ <entry key="RecoveryEnvironmentBean.recoveryListener">YES</entry>
-
-
- <entry key="com.arjuna.ats.jta.supportSubtransactions">NO</entry>
-
- <entry key="com.arjuna.ats.jta.jtaTMImplementation">com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionManagerImple</entry>
-
- <entry key="com.arjuna.ats.jta.jtaUTImplementation">com.arjuna.ats.internal.jta.transaction.arjunacore.UserTransactionImple</entry>
-
</properties>
Modified: labs/jbosstm/trunk/ArjunaJTA/jdbc/tests/classes/com/hp/mwtests/ts/jdbc/basic/BeanPopulatorTest.java
===================================================================
--- labs/jbosstm/trunk/ArjunaJTA/jdbc/tests/classes/com/hp/mwtests/ts/jdbc/basic/BeanPopulatorTest.java 2009-08-04 09:13:43 UTC (rev 28783)
+++ labs/jbosstm/trunk/ArjunaJTA/jdbc/tests/classes/com/hp/mwtests/ts/jdbc/basic/BeanPopulatorTest.java 2009-08-04 09:30:36 UTC (rev 28784)
@@ -21,7 +21,8 @@
package com.hp.mwtests.ts.jdbc.basic;
import org.junit.Test;
-import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.*;
+
import com.arjuna.common.tests.simple.DummyPropertyManager;
import com.arjuna.common.internal.util.propertyservice.BeanPopulator;
import com.arjuna.ats.jdbc.common.Environment;
@@ -51,6 +52,6 @@
Set<String> expectedKeys = new HashSet<String>();
expectedKeys.addAll( DummyPropertyManager.extractKeys(Environment.class));
- assertEquals(expectedKeys, testManager.usedKeys);
+ assertTrue( testManager.usedKeys.containsAll(expectedKeys) );
}
}
Modified: labs/jbosstm/trunk/ArjunaJTA/jta/tests/classes/com/hp/mwtests/ts/jta/basic/BeanPopulatorTest.java
===================================================================
--- labs/jbosstm/trunk/ArjunaJTA/jta/tests/classes/com/hp/mwtests/ts/jta/basic/BeanPopulatorTest.java 2009-08-04 09:13:43 UTC (rev 28783)
+++ labs/jbosstm/trunk/ArjunaJTA/jta/tests/classes/com/hp/mwtests/ts/jta/basic/BeanPopulatorTest.java 2009-08-04 09:30:36 UTC (rev 28784)
@@ -52,6 +52,6 @@
Set<String> expectedKeys = new HashSet<String>();
expectedKeys.addAll( DummyPropertyManager.extractKeys(Environment.class));
- assertEquals(expectedKeys, testManager.usedKeys);
+ assertTrue( testManager.usedKeys.containsAll(expectedKeys) );
}
}
Modified: labs/jbosstm/trunk/ArjunaJTS/jbossts-properties-arjunajts.xml
===================================================================
--- labs/jbosstm/trunk/ArjunaJTS/jbossts-properties-arjunajts.xml 2009-08-04 09:13:43 UTC (rev 28783)
+++ labs/jbosstm/trunk/ArjunaJTS/jbossts-properties-arjunajts.xml 2009-08-04 09:30:36 UTC (rev 28784)
@@ -52,23 +52,20 @@
<!-- (default is YES) -->
- <entry key="com.arjuna.ats.arjuna.coordinator.commitOnePhase">YES</entry>
+ <entry key="CoordinatorEnvironmentBean.commitOnePhase">YES</entry>
- <!-- (default is defaultStore) -->
- <entry key="com.arjuna.ats.arjuna.objectstore.localOSRoot">defaultStore</entry>
-
<!-- default is under user.home - must be writeable!) -->
- <entry key="com.arjuna.ats.arjuna.objectstore.objectStoreDir">PutObjectStoreDirHere</entry>
+ <entry key="ObjectStoreEnvironmentBean.objectStoreDir">PutObjectStoreDirHere</entry>
<!-- (default is ON) -->
- <entry key="com.arjuna.ats.arjuna.objectstore.transactionSync">ON</entry>
+ <entry key="ObjectStoreEnvironmentBean.transactionSync">ON</entry>
<!-- (Must be unique across all Arjuna instances.) -->
- <entry key="com.arjuna.ats.arjuna.xa.nodeIdentifier">1</entry>
+ <entry key="CoreEnvironmentBean.nodeIdentifier">1</entry>
<!-- Which Xid types to recover -->
<entry key="com.arjuna.ats.jta.xaRecoveryNode">1</entry>
-
+
<!--
Base port number for determining a unique number to associate with an instance of the transaction service
(which is needed in order to support multiple instances on the same machine).
@@ -78,12 +75,11 @@
com.arjuna.ats.internal.arjuna.utils.SocketProcessIdMaxPorts property) have been tried or until the port number
reaches the maximum possible port number.
-->
- <entry key="com.arjuna.ats.internal.arjuna.utils.SocketProcessIdPort">0</entry>
+ <entry key="CoreEnvironmentBean.socketProcessIdPort">0</entry>
-
<!--
Periodic recovery modules to use. Invoked in sort-order of names.
Check http://www.jboss.org/community/docs/DOC-10788 for more information
@@ -117,26 +113,26 @@
be sure you know what you are doing and why! -->
<!-- entry key="com.arjuna.ats.arjuna.recovery.expiryScannerAtomicActionLog">com.arjuna.ats.internal.arjuna.recovery.AtomicActionExpiryScanner</entry> -->
- <!--
+ <!--
The address and port number on which the recovery manager listens
If running within an AS then the address the AS is bound to (jboss.bind.address) takes precedence
-->
- <entry key="com.arjuna.ats.arjuna.recovery.recoveryPort">4712</entry>
+ <entry key="RecoveryEnvironmentBean.recoveryPort">4712</entry>
- <entry key="com.arjuna.ats.arjuna.recovery.recoveryAddress"></entry>
+ <entry key="RecoveryEnvironmentBean.recoveryAddress"></entry>
<!--
Use this to fix the port on which the TransactionStatusManager listens,
The default behaviour is to use any free port.
-->
- <entry key="com.arjuna.ats.arjuna.recovery.transactionStatusManagerPort">0</entry>
+ <entry key="RecoveryEnvironmentBean.transactionStatusManagerPort">0</entry>
<!--
Use this to fix the address on which the TransactionStatusManager binds,
The default behaviour is to use the loopback address (ie localhost).
If running within an AS then the address the AS is bound to (jboss.bind.address) takes precedence
-->
- <entry key="com.arjuna.ats.arjuna.recovery.transactionStatusManagerAddress"></entry>
+ <entry key="RecoveryEnvironmentBean.transactionStatusManagerAddress"></entry>
<!--
For cases where the recovery manager is in process with the transaction manager and nothing else uses
@@ -144,21 +140,21 @@
Caution: use of this property can allow multiple recovery processes to run on the same ObjectStore
if you are not careful. That in turn can lead to incorrect transaction processing. Use with care.
-->
- <entry key="com.arjuna.ats.arjuna.recovery.recoveryListener">YES</entry>
+ <entry key="RecoveryEnvironmentBean.recoveryListener">YES</entry>
+
<!-- Recovery Activator to use. -->
<entry key="com.arjuna.ats.arjuna.recovery.recoveryActivator_1">com.arjuna.ats.internal.jts.orbspecific.recovery.RecoveryEnablement</entry>
-
- <entry key="com.arjuna.ats.jta.supportSubtransactions">NO</entry>
- <entry key="com.arjuna.ats.jta.jtaTMImplementation">com.arjuna.ats.internal.jta.transaction.jts.TransactionManagerImple</entry>
+ <entry key="JTAEnvironmentBean.jtaTMImplementation">com.arjuna.ats.internal.jta.transaction.jts.TransactionManagerImple</entry>
- <entry key="com.arjuna.ats.jta.jtaUTImplementation">com.arjuna.ats.internal.jta.transaction.jts.UserTransactionImple</entry>
+ <entry key="JTAEnvironmentBean.jtaUTImplementation">com.arjuna.ats.internal.jta.transaction.jts.UserTransactionImple</entry>
+ <entry key="JTAEnvironmentBean.jtaTSRImplementation">com.arjuna.ats.internal.jta.transaction.jts.TransactionSynchronizationRegistryImple</entry>
- <entry key="com.arjuna.orbportability.bindMechanism">CONFIGURATION_FILE</entry>
+ <entry key="OrbPortabilityEnvironmentBean.bindMechanism">CONFIGURATION_FILE</entry>
<!--
This class handles context propagation issues, and should never
@@ -192,13 +188,13 @@
<!--
This property controls the port on which the Recovery ORB listens
-->
- <entry key="com.arjuna.ats.jts.recoveryManagerPort">4711</entry>
+ <entry key="JTSEnvironmentBean.recoveryManagerPort">4711</entry>
<!--
This property controls the address on which the Recovery ORB binds - defaults to the loopback connection
If running within an AS then the address the AS is bound to (jboss.bind.address) takes precedence
-->
- <entry key="com.arjuna.ats.jts.recoveryManagerAddress"></entry>
+ <entry key="JTSEnvironmentBean.recoveryManagerAddress"></entry>
</properties>
Modified: labs/jbosstm/trunk/ArjunaJTS/jts/classes/com/arjuna/ats/internal/jts/OTSImpleManager.java
===================================================================
--- labs/jbosstm/trunk/ArjunaJTS/jts/classes/com/arjuna/ats/internal/jts/OTSImpleManager.java 2009-08-04 09:13:43 UTC (rev 28783)
+++ labs/jbosstm/trunk/ArjunaJTS/jts/classes/com/arjuna/ats/internal/jts/OTSImpleManager.java 2009-08-04 09:30:36 UTC (rev 28784)
@@ -196,12 +196,11 @@
* Only check once, when the factory is first created.
*/
- String transactionManager = jtsPropertyManager.getPropertyManager().getProperty(Environment.TRANSACTION_MANAGER, "NO");
int resolver = Services.CONFIGURATION_FILE;
boolean requireTransactionManager = false;
- if (transactionManager.compareTo("YES") == 0)
+ if (jtsPropertyManager.getJTSEnvironmentBean().isTransactionManager())
{
requireTransactionManager = true;
Modified: labs/jbosstm/trunk/ArjunaJTS/jts/classes/com/arjuna/ats/internal/jts/context/ContextPropagationManager.java
===================================================================
--- labs/jbosstm/trunk/ArjunaJTS/jts/classes/com/arjuna/ats/internal/jts/context/ContextPropagationManager.java 2009-08-04 09:13:43 UTC (rev 28783)
+++ labs/jbosstm/trunk/ArjunaJTS/jts/classes/com/arjuna/ats/internal/jts/context/ContextPropagationManager.java 2009-08-04 09:30:36 UTC (rev 28784)
@@ -54,7 +54,7 @@
public ContextPropagationManager ()
{
- String contextMode = jtsPropertyManager.getPropertyManager().getProperty(com.arjuna.ats.jts.common.Environment.CONTEXT_PROP_MODE);
+ String contextMode = jtsPropertyManager.getJTSEnvironmentBean().getContextPropMode();
boolean interposition = true;
if (contextMode != null)
Modified: labs/jbosstm/trunk/ArjunaJTS/jts/classes/com/arjuna/ats/internal/jts/orbspecific/TransactionFactoryImple.java
===================================================================
--- labs/jbosstm/trunk/ArjunaJTS/jts/classes/com/arjuna/ats/internal/jts/orbspecific/TransactionFactoryImple.java 2009-08-04 09:13:43 UTC (rev 28783)
+++ labs/jbosstm/trunk/ArjunaJTS/jts/classes/com/arjuna/ats/internal/jts/orbspecific/TransactionFactoryImple.java 2009-08-04 09:30:36 UTC (rev 28784)
@@ -912,27 +912,7 @@
static
{
- String timeout = jtsPropertyManager.getPropertyManager().getProperty(com.arjuna.ats.jts.common.Environment.DEFAULT_TIMEOUT);
-
- if (timeout != null)
- {
- try
- {
- Integer i = new Integer(timeout);
-
- TxControl.setDefaultTimeout(i.intValue());
- }
- catch (Exception e)
- {
- if (jtsLogger.loggerI18N.isWarnEnabled())
- {
- jtsLogger.loggerI18N.warn("com.arjuna.ats.internal.jts.orbspecific.tfitimeout", new Object[]
- { "TransactionFactoryImple", timeout, e });
- }
-
- throw new ExceptionInInitializerError(e);
- }
- }
+ TxControl.setDefaultTimeout(jtsPropertyManager.getJTSEnvironmentBean().getDefaultTimeout());
}
}
Modified: labs/jbosstm/trunk/ArjunaJTS/jts/classes/com/arjuna/ats/internal/jts/orbspecific/coordinator/ArjunaTransactionImple.java
===================================================================
--- labs/jbosstm/trunk/ArjunaJTS/jts/classes/com/arjuna/ats/internal/jts/orbspecific/coordinator/ArjunaTransactionImple.java 2009-08-04 09:13:43 UTC (rev 28783)
+++ labs/jbosstm/trunk/ArjunaJTS/jts/classes/com/arjuna/ats/internal/jts/orbspecific/coordinator/ArjunaTransactionImple.java 2009-08-04 09:30:36 UTC (rev 28784)
@@ -2362,7 +2362,7 @@
static
{
- String interpositionType = jtsPropertyManager.getPropertyManager().getProperty(com.arjuna.ats.jts.common.Environment.INTERPOSITION);
+ String interpositionType = jtsPropertyManager.getJTSEnvironmentBean().getInterposition();
if (interpositionType != null)
{
@@ -2380,45 +2380,11 @@
}
}
- String supportSubtran = jtsPropertyManager.getPropertyManager().getProperty(com.arjuna.ats.jts.common.Environment.SUPPORT_SUBTRANSACTIONS);
-
- if (supportSubtran != null)
- {
- if (supportSubtran.compareTo("NO") == 0)
- _subtran = false;
- }
-
- String syncOn = jtsPropertyManager.getPropertyManager().getProperty(com.arjuna.ats.jts.common.Environment.SUPPORT_ROLLBACK_SYNC);
-
- if (syncOn != null)
- {
- if (syncOn.compareTo("NO") == 0)
- _syncOn = false;
- }
-
- String checked = jtsPropertyManager.getPropertyManager().getProperty(com.arjuna.ats.jts.common.Environment.CHECKED_TRANSACTIONS);
-
- if (checked != null)
- {
- if (checked.compareTo("YES") == 0)
- _checkedTransactions = true;
- }
-
- String propTerm = jtsPropertyManager.getPropertyManager().getProperty(com.arjuna.ats.jts.common.Environment.PROPAGATE_TERMINATOR);
-
- if (propTerm != null)
- {
- if (propTerm.compareTo("YES") == 0)
- _propagateTerminator = true;
- }
-
- String propRemainingTimeout = jtsPropertyManager.getPropertyManager().getProperty(com.arjuna.ats.jts.common.Environment.OTS_1_0_TIMEOUT_PROPAGATION);
-
- if (propRemainingTimeout != null)
- {
- if (propTerm.compareTo("NO") == 0)
- _propagateRemainingTimeout = false;
- }
+ _subtran = jtsPropertyManager.getJTSEnvironmentBean().isSupportSubtransactions();
+ _syncOn = jtsPropertyManager.getJTSEnvironmentBean().isSupportRollbackSync();
+ _checkedTransactions = jtsPropertyManager.getJTSEnvironmentBean().isCheckedTransactions();
+ _propagateTerminator = jtsPropertyManager.getJTSEnvironmentBean().isPropagateTerminator();
+ _propagateRemainingTimeout = jtsPropertyManager.getJTSEnvironmentBean().isTimeoutPropagation();
}
public java.util.Map<Uid, String> getSynchronizations()
Modified: labs/jbosstm/trunk/ArjunaJTS/jts/classes/com/arjuna/ats/internal/jts/orbspecific/interposition/coordinator/ServerTransaction.java
===================================================================
--- labs/jbosstm/trunk/ArjunaJTS/jts/classes/com/arjuna/ats/internal/jts/orbspecific/interposition/coordinator/ServerTransaction.java 2009-08-04 09:13:43 UTC (rev 28783)
+++ labs/jbosstm/trunk/ArjunaJTS/jts/classes/com/arjuna/ats/internal/jts/orbspecific/interposition/coordinator/ServerTransaction.java 2009-08-04 09:30:36 UTC (rev 28784)
@@ -707,13 +707,7 @@
static
{
- String inter = jtsPropertyManager.getPropertyManager().getProperty(com.arjuna.ats.jts.common.Environment.SUPPORT_INTERPOSED_SYNCHRONIZATION);
-
- if (inter != null)
- {
- if (inter.compareTo("YES") == 0)
- _interposedSynch = true;
- }
+ _interposedSynch = jtsPropertyManager.getJTSEnvironmentBean().isSupportInterposedSynchronization();
}
}
Modified: labs/jbosstm/trunk/ArjunaJTS/jts/classes/com/arjuna/ats/internal/jts/orbspecific/jacorb/recoverycoordinators/JacOrbRCServiceInit.java
===================================================================
--- labs/jbosstm/trunk/ArjunaJTS/jts/classes/com/arjuna/ats/internal/jts/orbspecific/jacorb/recoverycoordinators/JacOrbRCServiceInit.java 2009-08-04 09:13:43 UTC (rev 28783)
+++ labs/jbosstm/trunk/ArjunaJTS/jts/classes/com/arjuna/ats/internal/jts/orbspecific/jacorb/recoverycoordinators/JacOrbRCServiceInit.java 2009-08-04 09:30:36 UTC (rev 28784)
@@ -116,8 +116,8 @@
{
_orb = com.arjuna.orbportability.internal.InternalORB.getInstance("RecoveryServer");
String[] params = null;
- String recoveryManagerPort = jtsPropertyManager.getPropertyManager().getProperty(com.arjuna.ats.jts.common.Environment.RECOVERY_MANAGER_ORB_PORT, "4711");
- String recoveryManagerAddr = jtsPropertyManager.getPropertyManager().getProperty(com.arjuna.ats.jts.common.Environment.RECOVERY_MANAGER_ADDRESS);
+ String recoveryManagerPort = ""+jtsPropertyManager.getJTSEnvironmentBean().getRecoveryManagerPort();
+ String recoveryManagerAddr = jtsPropertyManager.getJTSEnvironmentBean().getRecoveryManagerAddress();
if (recoveryManagerAddr == null)
recoveryManagerAddr = "";
Modified: labs/jbosstm/trunk/ArjunaJTS/jts/classes/com/arjuna/ats/jts/common/InterceptorInfo.java
===================================================================
--- labs/jbosstm/trunk/ArjunaJTS/jts/classes/com/arjuna/ats/jts/common/InterceptorInfo.java 2009-08-04 09:13:43 UTC (rev 28783)
+++ labs/jbosstm/trunk/ArjunaJTS/jts/classes/com/arjuna/ats/jts/common/InterceptorInfo.java 2009-08-04 09:30:36 UTC (rev 28784)
@@ -44,25 +44,8 @@
static
{
- boolean otsNeedTranContext = Defaults.needTransactionContext ;
- boolean otsAlwaysPropagate = Defaults.alwaysPropagateContext ;
-
- final String needTranContextValue = jtsPropertyManager.getPropertyManager().getProperty(Environment.NEED_TRAN_CONTEXT) ;
-
- if (needTranContextValue != null)
- {
- otsNeedTranContext = "YES".equals(needTranContextValue) ;
- }
-
- final String alwaysPropagate = jtsPropertyManager.getPropertyManager().getProperty(Environment.ALWAYS_PROPAGATE_CONTEXT) ;
-
- if (alwaysPropagate != null)
- {
- otsAlwaysPropagate = "YES".equals(alwaysPropagate) ;
- }
-
- OTS_NEED_TRAN_CONTEXT = otsNeedTranContext ;
- OTS_ALWAYS_PROPAGATE = otsAlwaysPropagate ;
+ OTS_NEED_TRAN_CONTEXT = jtsPropertyManager.getJTSEnvironmentBean().isNeedTranContext();
+ OTS_ALWAYS_PROPAGATE = jtsPropertyManager.getJTSEnvironmentBean().isAlwaysPropagateContext();
}
/**
Modified: labs/jbosstm/trunk/ArjunaJTS/jts/classes/com/arjuna/ats/jts/common/JTSEnvironmentBean.java
===================================================================
--- labs/jbosstm/trunk/ArjunaJTS/jts/classes/com/arjuna/ats/jts/common/JTSEnvironmentBean.java 2009-08-04 09:13:43 UTC (rev 28783)
+++ labs/jbosstm/trunk/ArjunaJTS/jts/classes/com/arjuna/ats/jts/common/JTSEnvironmentBean.java 2009-08-04 09:30:36 UTC (rev 28784)
@@ -49,7 +49,7 @@
private String recoveryManagerAddress = "";
@FullPropertyName(name = "com.arjuna.ats.jts.ots_1_0.timeoutPropagation")
- private String timeoutPropagation;
+ private boolean timeoutPropagation;
// public static final String PROPERTIES_FILE = "com.arjuna.ats.jts.common.propertiesFile";
@@ -207,12 +207,12 @@
}
// public static final String OTS_1_0_TIMEOUT_PROPAGATION = "com.arjuna.ats.jts.ots_1_0.timeoutPropagation";
- public String getTimeoutPropagation()
+ public boolean isTimeoutPropagation()
{
return timeoutPropagation;
}
- public void setTimeoutPropagation(String timeoutPropagation)
+ public void setTimeoutPropagation(boolean timeoutPropagation)
{
this.timeoutPropagation = timeoutPropagation;
}
Modified: labs/jbosstm/trunk/ArjunaJTS/jts/classes/com/arjuna/ats/jts/common/jtsPropertyManager.java
===================================================================
--- labs/jbosstm/trunk/ArjunaJTS/jts/classes/com/arjuna/ats/jts/common/jtsPropertyManager.java 2009-08-04 09:13:43 UTC (rev 28783)
+++ labs/jbosstm/trunk/ArjunaJTS/jts/classes/com/arjuna/ats/jts/common/jtsPropertyManager.java 2009-08-04 09:30:36 UTC (rev 28784)
@@ -33,7 +33,10 @@
import com.arjuna.common.util.propertyservice.PropertyManager;
import com.arjuna.common.util.propertyservice.PropertyManagerFactory;
+import com.arjuna.common.internal.util.propertyservice.BeanPopulator;
+import java.util.concurrent.atomic.AtomicBoolean;
+
/**
* Property manager wrapper for the JTS module.
*/
@@ -44,4 +47,24 @@
{
return PropertyManagerFactory.getPropertyManagerForModule("jts", Environment.PROPERTIES_FILE);
}
+
+
+ public static JTSEnvironmentBean getJTSEnvironmentBean()
+ {
+ synchronized (jtsEnvironmentBeanInit) {
+ if(!jtsEnvironmentBeanInit.get()) {
+ try {
+ BeanPopulator.configureFromPropertyManager(jtsEnvironmentBean, getPropertyManager());
+ jtsEnvironmentBeanInit.set(true);
+ } catch(Exception e) {
+ throw new RuntimeException(e);
+ }
+ }
+ }
+
+ return jtsEnvironmentBean;
+ }
+
+ private static final AtomicBoolean jtsEnvironmentBeanInit = new AtomicBoolean(false);
+ private static final JTSEnvironmentBean jtsEnvironmentBean = new JTSEnvironmentBean();
}
Modified: labs/jbosstm/trunk/ArjunaJTS/jts/tests/classes/com/hp/mwtests/ts/jts/BeanPopulatorTest.java
===================================================================
--- labs/jbosstm/trunk/ArjunaJTS/jts/tests/classes/com/hp/mwtests/ts/jts/BeanPopulatorTest.java 2009-08-04 09:13:43 UTC (rev 28783)
+++ labs/jbosstm/trunk/ArjunaJTS/jts/tests/classes/com/hp/mwtests/ts/jts/BeanPopulatorTest.java 2009-08-04 09:30:36 UTC (rev 28784)
@@ -52,6 +52,6 @@
Set<String> expectedKeys = new HashSet<String>();
expectedKeys.addAll( DummyPropertyManager.extractKeys(Environment.class));
- assertEquals(expectedKeys, testManager.usedKeys);
+ assertTrue( testManager.usedKeys.containsAll(expectedKeys) );
}
}
Modified: labs/jbosstm/trunk/ArjunaJTS/jts/tests/classes/com/hp/mwtests/ts/jts/local/timeout/DefaultTimeout.java
===================================================================
--- labs/jbosstm/trunk/ArjunaJTS/jts/tests/classes/com/hp/mwtests/ts/jts/local/timeout/DefaultTimeout.java 2009-08-04 09:13:43 UTC (rev 28783)
+++ labs/jbosstm/trunk/ArjunaJTS/jts/tests/classes/com/hp/mwtests/ts/jts/local/timeout/DefaultTimeout.java 2009-08-04 09:30:36 UTC (rev 28784)
@@ -62,26 +62,8 @@
ORBManager.setORB(myORB);
ORBManager.setPOA(myOA);
- String timeout = jtsPropertyManager.getPropertyManager().getProperty(Environment.DEFAULT_TIMEOUT);
- int sleepTime = 0;
-
- if (timeout != null)
- {
- try
- {
- Integer i = new Integer(timeout);
-
- sleepTime = i.intValue();
- }
- catch (Exception e)
- {
- System.err.println("Invalid default transaction timeout "+timeout);
- System.err.println("Caught exception: "+e);
-
- System.exit(0);
- }
- }
-
+ int sleepTime = jtsPropertyManager.getJTSEnvironmentBean().getDefaultTimeout();
+
System.out.println("Thread "+Thread.currentThread()+" starting transaction.");
OTSManager.get_current().begin();
Modified: labs/jbosstm/trunk/ArjunaJTS/orbportability/tests/classes/com/hp/mwtests/orbportability/initialisation/BeanPopulatorTest.java
===================================================================
--- labs/jbosstm/trunk/ArjunaJTS/orbportability/tests/classes/com/hp/mwtests/orbportability/initialisation/BeanPopulatorTest.java 2009-08-04 09:13:43 UTC (rev 28783)
+++ labs/jbosstm/trunk/ArjunaJTS/orbportability/tests/classes/com/hp/mwtests/orbportability/initialisation/BeanPopulatorTest.java 2009-08-04 09:30:36 UTC (rev 28784)
@@ -52,6 +52,6 @@
Set<String> expectedKeys = new HashSet<String>();
expectedKeys.addAll( DummyPropertyManager.extractKeys(Environment.class));
- assertEquals(expectedKeys, testManager.usedKeys);
+ assertTrue( testManager.usedKeys.containsAll(expectedKeys) );
}
}
Modified: labs/jbosstm/trunk/common/classes/com/arjuna/common/internal/util/propertyservice/BeanPopulator.java
===================================================================
--- labs/jbosstm/trunk/common/classes/com/arjuna/common/internal/util/propertyservice/BeanPopulator.java 2009-08-04 09:13:43 UTC (rev 28783)
+++ labs/jbosstm/trunk/common/classes/com/arjuna/common/internal/util/propertyservice/BeanPopulator.java 2009-08-04 09:30:36 UTC (rev 28784)
@@ -41,9 +41,12 @@
*
* The algorithm is as follows: for each field in the bean, which must have a getter and setter method
* matching according to the JavaBeans naming conventions, determine the corresponding property key.
- * The key name is constructed by taking the bean classes' PropertyPrefix annotation value and adding to it the
- * name of the field, except in cases where the field has a FullPropertyName annotation, in which case
- * its value is used instead. This allows for the convention that all properties in a given bean will share
+ *
+ * Several key names are tried, with the first match being used: The FQN of the bean followed by the field name,
+ * the short name of the bean followed by the field name, and finally the bean classes' PropertyPrefix annotation
+ * value followed by the name of the field, the last being except in cases where the field has a FullPropertyName
+ * annotation, in which case its value is used instead.
+ * This allows for the convention that all properties in a given bean will share
* the same prefix e.g. com.arjuna.ats.arjuna.foo. whilst still allowing for changing of the property
* name in cases where this makes for more readable code.
* Obtain the value of the property from the PropertyManager and if it's not null, type convert it to match
@@ -84,15 +87,33 @@
getter = bean.getClass().getMethod(getterMethodName, new Class[] {});
}
- String propertyFileKey = prefix+field.getName();
+ //////////////////
- if(field.isAnnotationPresent(FullPropertyName.class)) {
- FullPropertyName fullPropertyName = field.getAnnotation(FullPropertyName.class);
- propertyFileKey = fullPropertyName.name();
+ String propertyFileKey = null;
+ String valueFromPropertyManager = null;
+
+ if(valueFromPropertyManager == null) {
+ propertyFileKey = bean.getClass().getCanonicalName()+"."+field.getName();
+ valueFromPropertyManager = propertyManager.getProperty(propertyFileKey);
}
- String valueFromPropertyManager = propertyManager.getProperty(propertyFileKey);
+ if(valueFromPropertyManager == null) {
+ propertyFileKey = bean.getClass().getSimpleName()+"."+field.getName();
+ valueFromPropertyManager = propertyManager.getProperty(propertyFileKey);
+ }
+ if (valueFromPropertyManager == null) {
+ propertyFileKey = prefix+field.getName();
+
+ if(field.isAnnotationPresent(FullPropertyName.class)) {
+ FullPropertyName fullPropertyName = field.getAnnotation(FullPropertyName.class);
+ propertyFileKey = fullPropertyName.name();
+ }
+
+ valueFromPropertyManager = propertyManager.getProperty(propertyFileKey);
+ }
+
+
if(valueFromPropertyManager != null) {
Object valueFromBean = getter.invoke(bean, new Object[] {});
Modified: labs/jbosstm/trunk/common/tests/com/arjuna/common/tests/simple/EnvironmentBeanTest.java
===================================================================
--- labs/jbosstm/trunk/common/tests/com/arjuna/common/tests/simple/EnvironmentBeanTest.java 2009-08-04 09:13:43 UTC (rev 28783)
+++ labs/jbosstm/trunk/common/tests/com/arjuna/common/tests/simple/EnvironmentBeanTest.java 2009-08-04 09:30:36 UTC (rev 28784)
@@ -44,6 +44,6 @@
BeanPopulator.configureFromPropertyManager(testBean, testManager);
Set<String> expectedKeys = testBean.getProperties().stringPropertyNames();
- assertEquals(expectedKeys, testManager.usedKeys);
+ assertTrue( testManager.usedKeys.containsAll(expectedKeys) );
}
}
More information about the jboss-svn-commits
mailing list