[jboss-svn-commits] JBL Code SVN: r17616 - in labs/jbosstm/trunk/ArjunaJTS/jtax/classes/com/arjuna/ats/internal/jta/transaction/jts: jca and 1 other directories.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Tue Jan 8 06:01:25 EST 2008


Author: jhalliday
Date: 2008-01-08 06:01:25 -0500 (Tue, 08 Jan 2008)
New Revision: 17616

Modified:
   labs/jbosstm/trunk/ArjunaJTS/jtax/classes/com/arjuna/ats/internal/jta/transaction/jts/TransactionImple.java
   labs/jbosstm/trunk/ArjunaJTS/jtax/classes/com/arjuna/ats/internal/jta/transaction/jts/jca/TxWorkManager.java
   labs/jbosstm/trunk/ArjunaJTS/jtax/classes/com/arjuna/ats/internal/jta/transaction/jts/subordinate/TransactionImple.java
Log:
Changes to logging so that internationalized messages from another bundle are located correctly. See http://jira.jboss.com/jira/browse/JBTM-320


Modified: labs/jbosstm/trunk/ArjunaJTS/jtax/classes/com/arjuna/ats/internal/jta/transaction/jts/TransactionImple.java
===================================================================
--- labs/jbosstm/trunk/ArjunaJTS/jtax/classes/com/arjuna/ats/internal/jta/transaction/jts/TransactionImple.java	2008-01-08 09:55:49 UTC (rev 17615)
+++ labs/jbosstm/trunk/ArjunaJTS/jtax/classes/com/arjuna/ats/internal/jta/transaction/jts/TransactionImple.java	2008-01-08 11:01:25 UTC (rev 17616)
@@ -380,7 +380,7 @@
 
 			if (endSuspendedFailed)
 				throw new IllegalStateException(
-						jtaLogger.logMesg.getString("com.arjuna.ats.internal.jta.transaction.jts.endsuspendfailed2"));
+						jtaLogger.loggerI18N.getString("com.arjuna.ats.internal.jta.transaction.jts.endsuspendfailed2"));
 		}
 		else
 			throw new IllegalStateException(

Modified: labs/jbosstm/trunk/ArjunaJTS/jtax/classes/com/arjuna/ats/internal/jta/transaction/jts/jca/TxWorkManager.java
===================================================================
--- labs/jbosstm/trunk/ArjunaJTS/jtax/classes/com/arjuna/ats/internal/jta/transaction/jts/jca/TxWorkManager.java	2008-01-08 09:55:49 UTC (rev 17615)
+++ labs/jbosstm/trunk/ArjunaJTS/jtax/classes/com/arjuna/ats/internal/jta/transaction/jts/jca/TxWorkManager.java	2008-01-08 11:01:25 UTC (rev 17616)
@@ -1,20 +1,20 @@
 /*
  * JBoss, Home of Professional Open Source
  * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. 
- * See the copyright.txt in the distribution for a full listing 
+ * as indicated by the @author tags.
+ * See the copyright.txt in the distribution for a full listing
  * of individual contributors.
  * This copyrighted material is made available to anyone wishing to use,
  * modify, copy, or redistribute it subject to the terms and conditions
  * of the GNU General Public License, v. 2.0.
- * This program is distributed in the hope that it will be useful, but WITHOUT A 
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A 
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
  * PARTICULAR PURPOSE.  See the GNU General Public License for more details.
  * You should have received a copy of the GNU General Public License,
  * v. 2.0 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
  * MA  02110-1301, USA.
- * 
+ *
  * (C) 2005-2006,
  * @author JBoss Inc.
  */
@@ -50,25 +50,25 @@
 	 * JCA only allows one. Might not be worth the hassle of maintaining this
 	 * support.
 	 */
-	
+
 	/**
 	 *
 	 * Add the specified work unit to the specified transaction.
-	 * 
+	 *
 	 * @param work The work to associate with the transaction.
 	 * @param tx The transaction to have associated with the work.
-	 * 
+	 *
 	 * @throws WorkCompletedException thrown if there is already work
 	 * associated with the transaction.
-	 * 
+	 *
 	 * @message com.arjuna.ats.internal.jta.transaction.jts.jca.busy [message
 	 *          com.arjuna.ats.internal.jta.transaction.jts.jca.busy] Work already active!
 	 */
-	
+
 	public static void addWork (Work work, TransactionImple tx) throws WorkCompletedException
 	{
 		Stack workers;
-		
+
 		synchronized (_transactions)
 		{
 			workers = (Stack) _transactions.get(tx);
@@ -76,43 +76,43 @@
 			if (workers == null)
 			{
 				workers = new Stack();
-				
+
 				_transactions.put(tx, workers);
 			}
 			else
-				throw new WorkCompletedException(jtaLogger.logMesg.getString("com.arjuna.ats.internal.jta.transaction.jts.jca.busy"), WorkException.TX_CONCURRENT_WORK_DISALLOWED);
+				throw new WorkCompletedException(jtaLogger.loggerI18N.getString("com.arjuna.ats.internal.jta.transaction.jts.jca.busy"), WorkException.TX_CONCURRENT_WORK_DISALLOWED);
 		}
-		
+
 		synchronized (workers)
 		{
 			workers.push(work);
-		}		
+		}
 	}
 
 	/**
 	 * Remove the specified unit of work from the transaction.
-	 * 
+	 *
 	 * @param work the work to remove.
 	 * @param tx the transaction the work should be disassociated from.
 	 */
-	
+
 	public static void removeWork (Work work, TransactionImple tx)
 	{
 		Stack workers;
-		
+
 		synchronized (_transactions)
 		{
 			workers = (Stack) _transactions.get(tx);
 		}
-		
+
 		if (workers != null)
 		{
 			synchronized (workers)
 			{
 				// TODO what if it wasn't registered?
-				
+
 				workers.remove(work);
-				
+
 				if (workers.empty())
 				{
 					synchronized (_transactions)
@@ -130,40 +130,40 @@
 
 	/**
 	 * Does the transaction have any work associated with it?
-	 * 
+	 *
 	 * @param tx the transaction to check.
-	 * 
+	 *
 	 * @return <code>true</code> if there is work associated with the transaction,
 	 * <code>false</code> otherwise.
 	 */
-	
+
 	public static boolean hasWork (TransactionImple tx)
 	{
 		synchronized (_transactions)
 		{
 			Stack workers = (Stack) _transactions.get(tx);
-			
+
 			return (boolean) (workers != null);
 		}
 	}
 
 	/**
 	 * Get the work currently associated with the transaction.
-	 * 
+	 *
 	 * @param tx the transaction.
-	 * 
+	 *
 	 * @return the work, or <code>null</code> if there is none.
 	 */
-	
+
 	public static Work getWork (TransactionImple tx)
 	{
 		Stack workers;
-		
+
 		synchronized (_transactions)
 		{
 			workers = (Stack) _transactions.get(tx);
 		}
-		
+
 		if (workers != null)
 		{
 			synchronized (workers)
@@ -175,7 +175,7 @@
 
 		return null;
 	}
-	
+
 	private static HashMap _transactions = new HashMap();
-	
+
 }

Modified: labs/jbosstm/trunk/ArjunaJTS/jtax/classes/com/arjuna/ats/internal/jta/transaction/jts/subordinate/TransactionImple.java
===================================================================
--- labs/jbosstm/trunk/ArjunaJTS/jtax/classes/com/arjuna/ats/internal/jta/transaction/jts/subordinate/TransactionImple.java	2008-01-08 09:55:49 UTC (rev 17615)
+++ labs/jbosstm/trunk/ArjunaJTS/jtax/classes/com/arjuna/ats/internal/jta/transaction/jts/subordinate/TransactionImple.java	2008-01-08 11:01:25 UTC (rev 17616)
@@ -1,20 +1,20 @@
 /*
  * JBoss, Home of Professional Open Source
  * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. 
- * See the copyright.txt in the distribution for a full listing 
+ * as indicated by the @author tags.
+ * See the copyright.txt in the distribution for a full listing
  * of individual contributors.
  * This copyrighted material is made available to anyone wishing to use,
  * modify, copy, or redistribute it subject to the terms and conditions
  * of the GNU General Public License, v. 2.0.
- * This program is distributed in the hope that it will be useful, but WITHOUT A 
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A 
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
  * PARTICULAR PURPOSE.  See the GNU General Public License for more details.
  * You should have received a copy of the GNU General Public License,
  * v. 2.0 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
  * MA  02110-1301, USA.
- * 
+ *
  * (C) 2005-2006,
  * @author JBoss Inc.
  */
@@ -105,7 +105,7 @@
 	{
 		/*
 		 * throw new IllegalStateException(
-		 * jtaLogger.logMesg.getString("com.arjuna.ats.internal.jta.transaction.jts.subordinate.invalidstate"));
+		 * jtaLogger.loggerI18N.getString("com.arjuna.ats.internal.jta.transaction.jts.subordinate.invalidstate"));
 		 */
 
 		throw new IllegalStateException();
@@ -121,7 +121,7 @@
 	{
 		/*
 		 * throw new IllegalStateException(
-		 * jtaLogger.logMesg.getString("com.arjuna.ats.internal.jta.transaction.jts.subordinate.invalidstate"));
+		 * jtaLogger.loggerI18N.getString("com.arjuna.ats.internal.jta.transaction.jts.subordinate.invalidstate"));
 		 */
 
 		throw new IllegalStateException();
@@ -130,12 +130,12 @@
 	/**
 	 * Drive the subordinate transaction through the prepare phase. Any
 	 * enlisted participants will also be prepared as a result.
-	 * 
+	 *
 	 * @return a TwoPhaseOutcome representing the result.
-	 * 
+	 *
 	 * @throws SystemException thrown if any error occurs.
 	 */
-	
+
 	public int doPrepare () throws SystemException
 	{
 		try
@@ -153,9 +153,9 @@
 					// shouldn't happen! ignore because prepare will fail next anyway.
 				}
 			}
-			
+
 			int res = subAct.doPrepare();
-			
+
 			switch (res)
 			{
 			case TwoPhaseOutcome.PREPARE_READONLY:
@@ -173,7 +173,7 @@
 		catch (Exception ex)
 		{
 			ex.printStackTrace();
-			
+
 			throw new SystemException();
 		}
 	}
@@ -181,7 +181,7 @@
 	/**
 	 * Drive the subordinate transaction to commit. It must have previously
 	 * been prepared.
-	 * 
+	 *
 	 * @throws IllegalStateException thrown if the transaction has not been prepared
 	 * or is unknown.
 	 * @throws HeuristicMixedException thrown if a heuristic mixed outcome occurs
@@ -189,7 +189,7 @@
 	 * @throws HeuristicRollbackException thrown if the transaction rolled back.
 	 * @throws SystemException thrown if some other error occurs.
 	 */
-	
+
 	public void doCommit () throws IllegalStateException,
 			HeuristicMixedException, HeuristicRollbackException,
 			SystemException
@@ -199,7 +199,7 @@
 			SubordinateAtomicTransaction subAct = (SubordinateAtomicTransaction) super._theTransaction;
 
 			int res = subAct.doCommit();
-			
+
 			switch (res)
 			{
 			case ActionStatus.COMMITTED:
@@ -216,7 +216,7 @@
 				throw new HeuristicMixedException();
 			case ActionStatus.INVALID:
 				throw new IllegalStateException();
-			default:			
+			default:
 				throw new HeuristicMixedException(); // not sure what happened,
 			// so err on the safe side!
 			}
@@ -236,7 +236,7 @@
 	/**
 	 * Drive the subordinate transaction to roll back. It need not have been previously
 	 * prepared.
-	 * 
+	 *
 	 * @throws IllegalStateException thrown if the transaction is not known by the
 	 * system or has been previously terminated.
 	 * @throws HeuristicMixedException thrown if a heuristic mixed outcome occurs
@@ -246,7 +246,7 @@
 	 * happen if it was previously prepared).
 	 * @throws SystemException thrown if any other error occurs.
 	 */
-	
+
 	public void doRollback () throws IllegalStateException,
 			HeuristicMixedException, HeuristicCommitException, SystemException
 	{
@@ -261,9 +261,9 @@
 					jtaLogger.loggerI18N.warn("com.arjuna.ats.internal.jta.transaction.arjunacore.endsuspendfailed1");
 				}
 			}
-			
+
 			int res = subAct.doRollback();
-			
+
 			switch (res)
 			{
 			case ActionStatus.ABORTED:
@@ -275,7 +275,7 @@
 			case ActionStatus.H_HAZARD:
 			case ActionStatus.H_MIXED:
 				throw new HeuristicMixedException();
-			default:			
+			default:
 				throw new HeuristicMixedException();
 			}
 		}
@@ -294,12 +294,12 @@
 	/**
 	 * Drive the transaction to commit. It should not have been previously
 	 * prepared and will be the only resource in the global transaction.
-	 * 
+	 *
 	 * @throws IllegalStateException if the transaction has already terminated
 	 * @throws javax.transaction.HeuristicRollbackException thrown if the transaction
 	 * rolls back.
 	 */
-	
+
 	public void doOnePhaseCommit () throws IllegalStateException,
 			javax.transaction.HeuristicRollbackException
 	{
@@ -318,7 +318,7 @@
         				// shouldn't happen! ignore because commit will fail next anyway.
         			}
 			}
-			
+
 			int status = subAct.doOnePhaseCommit();
 
 			TransactionImple.removeTransaction(this);
@@ -345,14 +345,14 @@
 			throw new IllegalStateException();
 		}
 	}
-	
+
 	/**
 	 * Called to tell the transaction to forget any heuristics.
-	 * 
+	 *
 	 * @throws IllegalStateException thrown if the transaction cannot
 	 * be found.
 	 */
-	
+
 	public void doForget () throws IllegalStateException
 	{
 		try
@@ -379,7 +379,7 @@
 					+ super._theTransaction.get_uid() + " >";
 		}
 	}
-	
+
 	protected void commitAndDisassociate ()
 			throws javax.transaction.RollbackException,
 			javax.transaction.HeuristicMixedException,
@@ -389,7 +389,7 @@
 	{
 		/*
 		 * throw new IllegalStateException(
-		 * jtaLogger.logMesg.getString("com.arjuna.ats.internal.jta.transaction.jts.subordinate.invalidstate"));
+		 * jtaLogger.loggerI18N.getString("com.arjuna.ats.internal.jta.transaction.jts.subordinate.invalidstate"));
 		 */
 
 		throw new IllegalStateException();
@@ -401,7 +401,7 @@
 	{
 		/*
 		 * throw new IllegalStateException(
-		 * jtaLogger.logMesg.getString("com.arjuna.ats.internal.jta.transaction.jts.subordinate.invalidstate"));
+		 * jtaLogger.loggerI18N.getString("com.arjuna.ats.internal.jta.transaction.jts.subordinate.invalidstate"));
 		 */
 
 		throw new IllegalStateException();




More information about the jboss-svn-commits mailing list