[jboss-svn-commits] JBL Code SVN: r24324 - in labs/jbosstm/trunk: ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/coordinator and 6 other directories.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Tue Dec 9 13:40:45 EST 2008


Author: mark.little at jboss.com
Date: 2008-12-09 13:40:44 -0500 (Tue, 09 Dec 2008)
New Revision: 24324

Modified:
   labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/common/Environment.java
   labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/coordinator/TxControl.java
   labs/jbosstm/trunk/ArjunaCore/docs/user_guide/ProgrammersGuide.odt
   labs/jbosstm/trunk/ArjunaJTA/docs/user_guide/ProgrammersGuide.odt
   labs/jbosstm/trunk/ArjunaJTA/jta/classes/com/arjuna/ats/internal/jta/transaction/arjunacore/BaseTransaction.java
   labs/jbosstm/trunk/ArjunaJTS/docs/user_guide/ProgrammersGuide.odt
   labs/jbosstm/trunk/ArjunaJTS/jts/classes/com/arjuna/ats/internal/jts/orbspecific/CurrentImple.java
   labs/jbosstm/trunk/ArjunaJTS/jts/classes/com/arjuna/ats/internal/jts/orbspecific/TransactionFactoryImple.java
   labs/jbosstm/trunk/ArjunaJTS/jts/classes/com/arjuna/ats/jts/common/Environment.java
Log:
https://jira.jboss.org/jira/browse/JBTM-103

Modified: labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/common/Environment.java
===================================================================
--- labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/common/Environment.java	2008-12-09 17:59:50 UTC (rev 24323)
+++ labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/common/Environment.java	2008-12-09 18:40:44 UTC (rev 24324)
@@ -108,6 +108,8 @@
     public static final String OBJECTSTORE_TYPE = "com.arjuna.ats.arjuna.objectstore.objectStoreType";
     public static final String HASHED_DIRECTORIES = "com.arjuna.ats.arjuna.objectstore.hashedDirectories";
     public static final String TRANSACTION_LOG = "com.arjuna.ats.arjuna.coordinator.transactionLog";
+    public static final String TRANSACTION_LOG_REMOVAL_MARKER = "com.arjuna.ats.arjuna.coordinator.transactionLog.removalMarker";
+    public static final String TRANSACTION_LOG_SIZE = "com.arjuna.ats.arjuna.coordinator.transactionLog.size";
     public static final String TRANSACTION_LOG_WRITE_OPTIMISATION = "com.arjuna.ats.arjuna.coordinator.transactionLog.writeOptimisation";
     public static final String TRANSACTION_SYNC = "com.arjuna.ats.arjuna.objectstore.transactionSync";
     public static final String READONLY_OPTIMISATION = "com.arjuna.ats.arjuna.coordinator.readonlyOptimisation";

Modified: labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/coordinator/TxControl.java
===================================================================
--- labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/coordinator/TxControl.java	2008-12-09 17:59:50 UTC (rev 24323)
+++ labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/coordinator/TxControl.java	2008-12-09 18:40:44 UTC (rev 24324)
@@ -61,12 +61,22 @@
 
 public class TxControl
 {
-
+    /**
+     * If a timeout is not associated with a transaction when it is created then
+     * this value will be used. A value of 0 means that the transaction will
+     * never time out.
+     */
 	public static final int getDefaultTimeout()
 	{
 		return _defaultTimeout;
 	}
 
+	/**
+	 * Set the timeout to be associated with a newly created transaction if there is no
+	 * other timeout to be used.
+	 * 
+	 * @param timeout
+	 */
 	public static final void setDefaultTimeout(int timeout)
 	{
 		_defaultTimeout = timeout;
@@ -100,6 +110,59 @@
 	}
 
 	/**
+         * By default we should use the same store as the coordinator. However, there
+         * may be some ObjectStore implementations that preclude this and in which
+         * case we will default to the basic action store since performance is not
+         * an issue.
+         * 
+         * @return the <code>ObjectStore</code> implementation which the
+         * recovery manager uses.
+         * 
+         * @see com.arjuna.ats.arjuna.objectstore.ObjectStore
+         */
+        
+        public static final ObjectStore getRecoveryStore ()
+        {
+            if (TxControl.actionStoreType == null)
+            {
+                    String useLog = arjPropertyManager.propertyManager.getProperty(
+                                    Environment.TRANSACTION_LOG, "OFF");
+
+                    if (useLog.equals("ON"))
+                            TxControl.actionStoreType = new ClassName(ArjunaNames
+                                            .Implementation_ObjectStore_ActionLogStore());
+                    else
+                            TxControl.actionStoreType = new ClassName(
+                                            arjPropertyManager.propertyManager
+                                                            .getProperty(
+                                                                            Environment.ACTION_STORE,
+                                                                            ArjunaNames
+                                                                                            .Implementation_ObjectStore_defaultActionStore()
+                                                                                            .stringForm()));
+
+                    String sharedLog = arjPropertyManager.propertyManager.getProperty(
+                                    Environment.SHARED_TRANSACTION_LOG, "NO");
+
+                    if (sharedLog.equals("YES"))
+                            sharedTransactionLog = true;
+            }
+
+            ClassName recoveryType = TxControl.actionStoreType;
+            
+            if (TxControl.actionStoreType.equals(ArjunaNames.Implementation_ObjectStore_ActionLogStore()))
+                recoveryType = ArjunaNames.Implementation_ObjectStore_defaultActionStore();
+            
+            /*
+             * Defaults to ObjectStore.OS_UNSHARED
+             */
+
+            if (sharedTransactionLog)
+                    return new ObjectStore(recoveryType, ObjectStore.OS_SHARED);
+            else
+                    return new ObjectStore(recoveryType);
+        }
+        
+	/**
 	 * @return the <code>ObjectStore</code> implementation which the
 	 *         transaction coordinator will use.
 	 * @see com.arjuna.ats.arjuna.objectstore.ObjectStore

Modified: labs/jbosstm/trunk/ArjunaCore/docs/user_guide/ProgrammersGuide.odt
===================================================================
(Binary files differ)

Modified: labs/jbosstm/trunk/ArjunaJTA/docs/user_guide/ProgrammersGuide.odt
===================================================================
(Binary files differ)

Modified: labs/jbosstm/trunk/ArjunaJTA/jta/classes/com/arjuna/ats/internal/jta/transaction/arjunacore/BaseTransaction.java
===================================================================
--- labs/jbosstm/trunk/ArjunaJTA/jta/classes/com/arjuna/ats/internal/jta/transaction/arjunacore/BaseTransaction.java	2008-12-09 17:59:50 UTC (rev 24323)
+++ labs/jbosstm/trunk/ArjunaJTA/jta/classes/com/arjuna/ats/internal/jta/transaction/arjunacore/BaseTransaction.java	2008-12-09 18:40:44 UTC (rev 24324)
@@ -31,6 +31,7 @@
 
 package com.arjuna.ats.internal.jta.transaction.arjunacore;
 
+import com.arjuna.ats.arjuna.coordinator.TxControl;
 import com.arjuna.ats.arjuna.utils.ThreadUtil;
 import com.arjuna.ats.jta.common.*;
 import com.arjuna.ats.jta.logging.*;
@@ -92,6 +93,8 @@
 		{
 			v = value.intValue();
 		}
+		else
+		    v = TxControl.getDefaultTimeout();
 
 		// TODO set default timeout
 

Modified: labs/jbosstm/trunk/ArjunaJTS/docs/user_guide/ProgrammersGuide.odt
===================================================================
(Binary files differ)

Modified: labs/jbosstm/trunk/ArjunaJTS/jts/classes/com/arjuna/ats/internal/jts/orbspecific/CurrentImple.java
===================================================================
--- labs/jbosstm/trunk/ArjunaJTS/jts/classes/com/arjuna/ats/internal/jts/orbspecific/CurrentImple.java	2008-12-09 17:59:50 UTC (rev 24323)
+++ labs/jbosstm/trunk/ArjunaJTS/jts/classes/com/arjuna/ats/internal/jts/orbspecific/CurrentImple.java	2008-12-09 18:40:44 UTC (rev 24324)
@@ -54,13 +54,13 @@
 import com.arjuna.ats.arjuna.common.*;
 import com.arjuna.ats.arjuna.coordinator.BasicAction;
 import com.arjuna.ats.arjuna.coordinator.CheckedAction;
+import com.arjuna.ats.arjuna.coordinator.TxControl;
 
 import com.arjuna.common.util.logging.*;
 
 import java.io.PrintStream;
 import java.util.*;
 import java.lang.Object;
-import org.omg.CORBA.CompletionStatus;
 import org.omg.CORBA.*;
 
 import org.omg.CosTransactions.SubtransactionsUnavailable;
@@ -480,6 +480,8 @@
 		{
 			v = value.intValue();
 		}
+		else
+		    v = TxControl.getDefaultTimeout();
 
 		if (jtsLogger.logger.isDebugEnabled())
 		{

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	2008-12-09 17:59:50 UTC (rev 24323)
+++ labs/jbosstm/trunk/ArjunaJTS/jts/classes/com/arjuna/ats/internal/jts/orbspecific/TransactionFactoryImple.java	2008-12-09 18:40:44 UTC (rev 24324)
@@ -50,6 +50,7 @@
 import com.arjuna.ats.arjuna.coordinator.ActionStatus;
 import com.arjuna.ats.arjuna.coordinator.TransactionReaper;
 import com.arjuna.ats.arjuna.coordinator.ActionManager;
+import com.arjuna.ats.arjuna.coordinator.TxControl;
 import com.arjuna.ats.arjuna.common.*;
 import com.arjuna.ats.arjuna.state.*;
 
@@ -165,7 +166,7 @@
 			int theTimeout = time_out;
 
 			if (theTimeout == 0)
-				theTimeout = TransactionFactoryImple._defaultTimeout;
+			    theTimeout = TxControl.getDefaultTimeout();
 
 			if (theTimeout > 0)
 			{
@@ -663,7 +664,7 @@
 		else
 			info.reaperTimeout = (int) reaper.checkingPeriod();
 
-		info.defaultTimeout = TransactionFactoryImple._defaultTimeout;
+		info.defaultTimeout = TxControl.getDefaultTimeout();
 
 		return info;
 	}
@@ -904,8 +905,6 @@
 
 	private static FactoryList creators = new FactoryList();
 
-	private static int _defaultTimeout = 0;
-
 	/**
 	 * @message com.arjuna.ats.internal.jts.orbspecific.tfitimeout {0} - invalid
 	 *          default transaction timeout {1}. Caught exception: {2}
@@ -921,7 +920,7 @@
 			{
 				Integer i = new Integer(timeout);
 
-				TransactionFactoryImple._defaultTimeout = i.intValue();
+				TxControl.setDefaultTimeout(i.intValue());
 			}
 			catch (Exception e)
 			{

Modified: labs/jbosstm/trunk/ArjunaJTS/jts/classes/com/arjuna/ats/jts/common/Environment.java
===================================================================
--- labs/jbosstm/trunk/ArjunaJTS/jts/classes/com/arjuna/ats/jts/common/Environment.java	2008-12-09 17:59:50 UTC (rev 24323)
+++ labs/jbosstm/trunk/ArjunaJTS/jts/classes/com/arjuna/ats/jts/common/Environment.java	2008-12-09 18:40:44 UTC (rev 24324)
@@ -52,7 +52,7 @@
     public static final String SUPPORT_SUBTRANSACTIONS = "com.arjuna.ats.jts.supportSubtransactions";
     public static final String SUPPORT_ROLLBACK_SYNC = "com.arjuna.ats.jts.supportRollbackSync";
     public static final String SUPPORT_INTERPOSED_SYNCHRONIZATION = "com.arjuna.ats.jts.supportInterposedSynchronization";
-    public static final String DEFAULT_TIMEOUT = "com.arjuna.ats.jts.defaultTimeout";
+    public static final String DEFAULT_TIMEOUT = "com.arjuna.ats.jts.defaultTimeout"; // deprecated
     public static final String PROPAGATE_TERMINATOR = "com.arjuna.ats.jts.propagateTerminator";
     public static final String CONTEXT_PROP_MODE = "com.arjuna.ats.jts.contextPropMode";
     public static final String RECOVERY_MANAGER_ORB_PORT = "com.arjuna.ats.jts.recoveryManagerPort";




More information about the jboss-svn-commits mailing list