[jboss-svn-commits] JBL Code SVN: r23242 - in labs/jbosstm/trunk: ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/utils and 4 other directories.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Wed Oct 1 10:32:26 EDT 2008
Author: mark.little at jboss.com
Date: 2008-10-01 10:32:26 -0400 (Wed, 01 Oct 2008)
New Revision: 23242
Modified:
labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/common/Environment.java
labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/utils/Process.java
labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/utils/Utility.java
labs/jbosstm/trunk/ArjunaJTA/jta/classes/com/arjuna/ats/internal/jta/transaction/arjunacore/TransactionImple.java
labs/jbosstm/trunk/ArjunaJTA/jta/classes/com/arjuna/ats/internal/jta/transaction/arjunacore/subordinate/TransactionImple.java
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/subordinate/TransactionImple.java
Log:
https://jira.jboss.org/jira/browse/JBTM-406
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-10-01 11:32:22 UTC (rev 23241)
+++ labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/common/Environment.java 2008-10-01 14:32:26 UTC (rev 23242)
@@ -145,6 +145,7 @@
public static final String TRANSACTION_STATUS_MANAGER_ADDRESS = "com.arjuna.ats.arjuna.recovery.transactionStatusManagerAddress";
public static final String SOCKET_PROCESS_ID_PORT= "com.arjuna.ats.internal.arjuna.utils.SocketProcessIdPort";
public static final String SOCKET_PROCESS_ID_MAX_PORTS= "com.arjuna.ats.internal.arjuna.utils.SocketProcessIdMaxPorts";
+ public static final String PROCESS_IMPLEMENTATION = "com.arjuna.ats.internal.arjuna.utils.processImplementation";
/**
* Constant that holds the name of the environment property
Modified: labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/utils/Process.java
===================================================================
--- labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/utils/Process.java 2008-10-01 11:32:22 UTC (rev 23241)
+++ labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/utils/Process.java 2008-10-01 14:32:26 UTC (rev 23242)
@@ -31,19 +31,6 @@
package com.arjuna.ats.arjuna.utils;
-import com.arjuna.ats.arjuna.common.*;
-import com.arjuna.common.util.propertyservice.PropertyManager;
-import java.util.Properties;
-import java.io.*;
-import java.net.InetAddress;
-
-import com.arjuna.ats.arjuna.exceptions.FatalError;
-import java.net.UnknownHostException;
-import java.lang.NumberFormatException;
-import java.lang.StringIndexOutOfBoundsException;
-import java.io.IOException;
-import java.io.FileNotFoundException;
-
/**
* Provides a configurable way to get a unique process id.
*
Modified: labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/utils/Utility.java
===================================================================
--- labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/utils/Utility.java 2008-10-01 11:32:22 UTC (rev 23241)
+++ labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/utils/Utility.java 2008-10-01 14:32:26 UTC (rev 23242)
@@ -42,12 +42,12 @@
import java.lang.NumberFormatException;
/**
- * Various useful functions that we wrap in a single class.
- * Some of these functions are needed simply for backwards
- * compatibility with older versions of Java.
- *
+ * Various useful functions that we wrap in a single class. Some of these
+ * functions are needed simply for backwards compatibility with older versions
+ * of Java.
+ *
* @author Mark Little (mark at arjuna.com)
- * @version $Id: Utility.java 2342 2006-03-30 13:06:17Z $
+ * @version $Id: Utility.java 2342 2006-03-30 13:06:17Z $
* @since JTS 1.0.
*/
@@ -58,146 +58,161 @@
* Convert integer to hex String.
*/
-public static String intToHexString (int number) throws NumberFormatException
+ public static String intToHexString (int number)
+ throws NumberFormatException
{
- return Integer.toString(number, 16);
+ return Integer.toString(number, 16);
}
/**
- * Convert a hex String to an integer.
- *
- * Be careful of -1. Java IO is really bad!
+ * Convert a hex String to an integer. Be careful of -1. Java IO is really
+ * bad!
*/
-public static int hexStringToInt (String s) throws NumberFormatException
+ public static int hexStringToInt (String s) throws NumberFormatException
{
- boolean isNeg;
- String toUse = s;
+ boolean isNeg;
+ String toUse = s;
- if (s.startsWith(Utility.hexStart))
- toUse = s.substring(Utility.hexStart.length());
+ if (s.startsWith(Utility.hexStart))
+ toUse = s.substring(Utility.hexStart.length());
- String lastString = toUse.substring(toUse.length()-1);
+ String lastString = toUse.substring(toUse.length() - 1);
- if (toUse.substring(0, 1).equals("-")) {
- toUse = "-0" + toUse.substring(1, toUse.length() - 1);
- isNeg = true;
- } else {
- toUse = "0" + toUse.substring(0, toUse.length() - 1);
- isNeg = false;
- }
+ if (toUse.substring(0, 1).equals("-"))
+ {
+ toUse = "-0" + toUse.substring(1, toUse.length() - 1);
+ isNeg = true;
+ }
+ else
+ {
+ toUse = "0" + toUse.substring(0, toUse.length() - 1);
+ isNeg = false;
+ }
- Integer i = Integer.valueOf(toUse, 16);
+ Integer i = Integer.valueOf(toUse, 16);
- int val = i.intValue();
+ int val = i.intValue();
- val = val << 4;
+ val = val << 4;
- if (isNeg) {
- val -= Integer.valueOf(lastString, 16).intValue();
- } else {
- val += Integer.valueOf(lastString, 16).intValue();
- }
+ if (isNeg)
+ {
+ val -= Integer.valueOf(lastString, 16).intValue();
+ }
+ else
+ {
+ val += Integer.valueOf(lastString, 16).intValue();
+ }
- return val;
+ return val;
}
/**
* Convert a long to a hex String.
*/
-public static String longToHexString (long number) throws NumberFormatException
+ public static String longToHexString (long number)
+ throws NumberFormatException
{
- return Long.toString(number, 16);
+ return Long.toString(number, 16);
}
/**
* Convert a hex String to a long.
*/
-public static long hexStringToLong (String s) throws NumberFormatException
+ public static long hexStringToLong (String s) throws NumberFormatException
{
- boolean isNeg;
- String toUse = s;
+ boolean isNeg;
+ String toUse = s;
- if (s.startsWith(Utility.hexStart))
- toUse = s.substring(Utility.hexStart.length());
+ if (s.startsWith(Utility.hexStart))
+ toUse = s.substring(Utility.hexStart.length());
- String lastString = toUse.substring(toUse.length()-1);
+ String lastString = toUse.substring(toUse.length() - 1);
- if (toUse.substring(0, 1).equals("-")) {
- toUse = "-0" + toUse.substring(1, toUse.length() - 1);
- isNeg = true;
- } else {
- toUse = "0" + toUse.substring(0, toUse.length() - 1);
- isNeg = false;
- }
+ if (toUse.substring(0, 1).equals("-"))
+ {
+ toUse = "-0" + toUse.substring(1, toUse.length() - 1);
+ isNeg = true;
+ }
+ else
+ {
+ toUse = "0" + toUse.substring(0, toUse.length() - 1);
+ isNeg = false;
+ }
- Long i = Long.valueOf(toUse, 16);
+ Long i = Long.valueOf(toUse, 16);
- long val = i.longValue();
+ long val = i.longValue();
- val = val << 4;
+ val = val << 4;
- if (isNeg) {
- val -= Long.valueOf(lastString, 16).longValue();
- } else {
- val += Long.valueOf(lastString, 16).longValue();
- }
+ if (isNeg)
+ {
+ val -= Long.valueOf(lastString, 16).longValue();
+ }
+ else
+ {
+ val += Long.valueOf(lastString, 16).longValue();
+ }
- return val;
+ return val;
}
/**
- * @return an integer representing the ip address of the local
- * machine. Essentially the bytes of the InetAddress are shuffled
- * into the integer.
- *
- * This was once part of the Uid class but has been separated for
- * general availability.
- *
+ * @return an integer representing the ip address of the local machine.
+ * Essentially the bytes of the InetAddress are shuffled into the
+ * integer. This was once part of the Uid class but has been
+ * separated for general availability.
* @since JTS 2.1.
*/
-public static synchronized int hostInetAddr () throws UnknownHostException
+ public static synchronized int hostInetAddr () throws UnknownHostException
{
- /*
- * Calculate only once.
- */
+ /*
+ * Calculate only once.
+ */
- if (myAddr == 0)
- {
- InetAddress addr = InetAddress.getLocalHost();
- byte[] b = addr.getAddress();
+ if (myAddr == 0)
+ {
+ InetAddress addr = InetAddress.getLocalHost();
+ byte[] b = addr.getAddress();
- for (int i = 0; i < b.length; i++)
- {
- /*
- * Convert signed byte into unsigned.
- */
+ for (int i = 0; i < b.length; i++)
+ {
+ /*
+ * Convert signed byte into unsigned.
+ */
- int l = 0x7f & b[i];
+ int l = 0x7f & b[i];
- l += (0x80 & b[i]);
+ l += (0x80 & b[i]);
- myAddr = (myAddr << 8) | l;
- }
- }
+ myAddr = (myAddr << 8) | l;
+ }
+ }
- return myAddr;
+ return myAddr;
}
/**
* Convert a host name into an InetAddress object
- *
- * @param host if empty or null then the loopback address is used
- * @param messageKey message key to a report warning if host is unknown
+ *
+ * @param host
+ * if empty or null then the loopback address is used
+ * @param messageKey
+ * message key to a report warning if host is unknown
* @return an InetAddress structure corresponding the desired host name
- * @throws UnknownHostException if the hostname cannot be found
+ * @throws UnknownHostException
+ * if the hostname cannot be found
*/
- public static InetAddress hostNameToInetAddress(String host, String messageKey) throws UnknownHostException
+ public static InetAddress hostNameToInetAddress (String host,
+ String messageKey) throws UnknownHostException
{
- try {
+ try
+ {
if (host == null || host.length() == 0)
return InetAddress.getLocalHost();
else
@@ -209,7 +224,7 @@
* The hostname is unknown
*/
if (tsLogger.arjLoggerI18N.isWarnEnabled() && messageKey != null)
- tsLogger.arjLoggerI18N.warn(messageKey,ex);
+ tsLogger.arjLoggerI18N.warn(messageKey, ex);
throw ex;
}
@@ -217,16 +232,25 @@
/**
* Lookup and valid a port number.
- *
- * @param intProperty property name of an integer valued property
- * @param defValue a value to return if intProperty is invalid. If a null value is used and intProperty is invalid then @com.arjuna.ats.arjuna.exceptions.FatalError
- * is thrown
- * @param warnMsgKey message key to report a warning if property values is invalid
- * @param minValue minimum value for the integer propertry
- * @param maxValue maximum value for the integer propertry
- * @return the integer value of property or the default value if the property does not represent an integer
+ *
+ * @param intProperty
+ * property name of an integer valued property
+ * @param defValue
+ * a value to return if intProperty is invalid. If a null value
+ * is used and intProperty is invalid then
+ * @com.arjuna.ats.arjuna.exceptions.FatalError is thrown
+ * @param warnMsgKey
+ * message key to report a warning if property values is invalid
+ * @param minValue
+ * minimum value for the integer propertry
+ * @param maxValue
+ * maximum value for the integer propertry
+ * @return the integer value of property or the default value if the
+ * property does not represent an integer
*/
- public static Integer lookupBoundedIntegerProperty(PropertyManager pm, String intProperty, Integer defValue, String warnMsgKey, int minValue, int maxValue)
+ public static Integer lookupBoundedIntegerProperty (PropertyManager pm,
+ String intProperty, Integer defValue, String warnMsgKey,
+ int minValue, int maxValue)
{
String intStr = pm.getProperty(intProperty);
@@ -243,9 +267,11 @@
if (i < minValue || i > maxValue)
{
// the value is an invalid number
- if (warnMsgKey != null && tsLogger.arjLoggerI18N.isWarnEnabled())
+ if (warnMsgKey != null
+ && tsLogger.arjLoggerI18N.isWarnEnabled())
{
- tsLogger.arjLoggerI18N.warn(warnMsgKey, new Object[]{intStr});
+ tsLogger.arjLoggerI18N.warn(warnMsgKey, new Object[]
+ { intStr });
}
}
else
@@ -257,93 +283,98 @@
{
// the value is not a number
if (warnMsgKey != null && tsLogger.arjLoggerI18N.isWarnEnabled())
- tsLogger.arjLoggerI18N.warn(warnMsgKey,ex);
+ tsLogger.arjLoggerI18N.warn(warnMsgKey, ex);
}
return defValue;
}
/**
- * @return the process id. This had better be unique between processes
- * on the same machine. If not we're in trouble!
- *
+ * @return the process id. This had better be unique between processes on
+ * the same machine. If not we're in trouble!
* @since JTS 2.1.
*/
-public static final int getpid ()
+ public static final int getpid ()
{
- Process handle = getProcess();
+ Process handle = getProcess();
- return ((handle == null) ? -1 : handle.getpid());
+ return ((handle == null) ? -1 : handle.getpid());
}
/**
* @return a Uid representing this process.
- *
* @since JTS 2.1.
*/
-public static final synchronized Uid getProcessUid ()
+ public static final synchronized Uid getProcessUid ()
{
- if (processUid == null)
- processUid = new Uid();
+ if (processUid == null)
+ processUid = new Uid();
- return processUid;
+ return processUid;
}
-public static final boolean isWindows ()
+ public static final boolean isWindows ()
{
- String os = arjPropertyManager.propertyManager.getProperty("os.name");
+ String os = arjPropertyManager.propertyManager.getProperty("os.name");
- if (("WIN32".equals(os)) || (os.indexOf("Windows") != -1))
- return true;
- else
- return false;
+ if (("WIN32".equals(os)) || (os.indexOf("Windows") != -1))
+ return true;
+ else
+ return false;
}
-public static final void setProcess (Process p)
+ public static final void setProcess (Process p)
{
- processHandle = p;
+ processHandle = p;
}
/**
- * @message com.arjuna.ats.arjuna.utils.Utility_1 [com.arjuna.ats.arjuna.utils.Utility_1] - Utility.getDefaultProcess - failed with
+ * @message com.arjuna.ats.arjuna.utils.Utility_1
+ * [com.arjuna.ats.arjuna.utils.Utility_1] -
+ * Utility.getDefaultProcess - failed with
*/
-public static final Process getDefaultProcess ()
+ public static final Process getDefaultProcess ()
{
- try
- {
- Class c = Thread.currentThread().getContextClassLoader().loadClass(defaultProcessId);
+ try
+ {
+ Class c = Thread.currentThread().getContextClassLoader().loadClass(
+ arjPropertyManager.getPropertyManager().getProperty(Environment.PROCESS_IMPLEMENTATION, defaultProcessId));
- return (Process) c.newInstance();
- }
- catch (Exception e)
- {
- tsLogger.arjLoggerI18N.warn("Utility_1", e);
+ return (Process) c.newInstance();
+ }
+ catch (Exception e)
+ {
+ tsLogger.arjLoggerI18N.warn("Utility_1", e);
- return null;
- }
+ return null;
+ }
}
-private static final Process getProcess ()
+ private static final Process getProcess ()
{
- if (processHandle == null)
- {
- processHandle = getDefaultProcess();
- }
+ if (processHandle == null)
+ {
+ processHandle = getDefaultProcess();
+ }
- return processHandle;
+ return processHandle;
}
-private static int myAddr = 0;
-private static Uid processUid = null;
-private static Process processHandle = null;
+ private static int myAddr = 0;
-private static final String hexStart = "0x";
-private static final String defaultProcessId = "com.arjuna.ats.internal.arjuna.utils.SocketProcessId";
+ private static Uid processUid = null;
+ private static Process processHandle = null;
+
+ private static final String hexStart = "0x";
+
+ private static final String defaultProcessId = "com.arjuna.ats.internal.arjuna.utils.SocketProcessId";
+
/**
- * The maximum queue length for incoming connection indications (a request to connect)
+ * The maximum queue length for incoming connection indications (a request
+ * to connect)
*/
public static final int BACKLOG = 50;
@@ -352,4 +383,3 @@
*/
public static final int MAX_PORT = 65535;
}
-
Modified: labs/jbosstm/trunk/ArjunaJTA/jta/classes/com/arjuna/ats/internal/jta/transaction/arjunacore/TransactionImple.java
===================================================================
--- labs/jbosstm/trunk/ArjunaJTA/jta/classes/com/arjuna/ats/internal/jta/transaction/arjunacore/TransactionImple.java 2008-10-01 11:32:22 UTC (rev 23241)
+++ labs/jbosstm/trunk/ArjunaJTA/jta/classes/com/arjuna/ats/internal/jta/transaction/arjunacore/TransactionImple.java 2008-10-01 14:32:26 UTC (rev 23242)
@@ -41,6 +41,8 @@
import com.arjuna.ats.jta.common.Configuration;
import com.arjuna.ats.jta.common.Environment;
import com.arjuna.ats.jta.common.jtaPropertyManager;
+import com.arjuna.ats.jta.exceptions.InactiveTransactionException;
+import com.arjuna.ats.jta.exceptions.InvalidTerminationStateException;
import com.arjuna.ats.jta.resources.LastResourceCommitOptimisation;
import com.arjuna.ats.jta.utils.XAHelper;
import com.arjuna.ats.jta.xa.XidImple;
@@ -1401,14 +1403,12 @@
case ActionStatus.ABORTED:
case ActionStatus.ABORTING:
_theTransaction.abort(); // assure thread disassociation
- throw new IllegalStateException(
+ throw new InactiveTransactionException(
jtaLogger.logMesg.getString("com.arjuna.ats.internal.jta.transaction.arjunacore.inactive"));
case ActionStatus.COMMITTED:
case ActionStatus.COMMITTING: // in case of async commit
_theTransaction.commit(true); // assure thread disassociation
- throw new IllegalStateException(
- jtaLogger.logMesg.getString("com.arjuna.ats.internal.jta.transaction.arjunacore.inactive"));
}
switch (_theTransaction.commit(true))
@@ -1429,7 +1429,7 @@
}
throw rollbackException;
default:
- throw new IllegalStateException(
+ throw new InvalidTerminationStateException(
jtaLogger.logMesg.getString("com.arjuna.ats.internal.jta.transaction.arjunacore.invalidstate"));
}
}
@@ -1488,7 +1488,7 @@
case ActionStatus.ABORTING: // in case of async rollback
break;
default:
- throw new IllegalStateException(
+ throw new InactiveTransactionException(
jtaLogger.logMesg.getString("com.arjuna.ats.internal.jta.transaction.arjunacore.rollbackstatus")
+ ActionStatus.stringForm(outcome));
}
Modified: labs/jbosstm/trunk/ArjunaJTA/jta/classes/com/arjuna/ats/internal/jta/transaction/arjunacore/subordinate/TransactionImple.java
===================================================================
--- labs/jbosstm/trunk/ArjunaJTA/jta/classes/com/arjuna/ats/internal/jta/transaction/arjunacore/subordinate/TransactionImple.java 2008-10-01 11:32:22 UTC (rev 23241)
+++ labs/jbosstm/trunk/ArjunaJTA/jta/classes/com/arjuna/ats/internal/jta/transaction/arjunacore/subordinate/TransactionImple.java 2008-10-01 14:32:26 UTC (rev 23242)
@@ -37,6 +37,8 @@
import com.arjuna.common.util.logging.*;
import com.arjuna.ats.internal.jta.transaction.arjunacore.AtomicAction;
+import com.arjuna.ats.jta.exceptions.InvalidTerminationStateException;
+import com.arjuna.ats.jta.exceptions.UnexpectedConditionException;
import com.arjuna.ats.jta.logging.*;
import java.lang.IllegalStateException;
@@ -46,6 +48,8 @@
import javax.transaction.HeuristicRollbackException;
import javax.transaction.SystemException;
+// https://jira.jboss.org/jira/browse/JBTM-384
+
/**
* @message com.arjuna.ats.internal.jta.transaction.arjunacore.subordinate.invalidstate
* [com.arjuna.ats.internal.jta.transaction.arjunacore.subordinate.invalidstate]
@@ -122,7 +126,7 @@
public void rollback () throws java.lang.IllegalStateException,
java.lang.SecurityException, javax.transaction.SystemException
{
- throw new IllegalStateException(
+ throw new InvalidTerminationStateException(
jtaLogger.logMesg.getString("com.arjuna.ats.internal.jta.transaction.arjunacore.subordinate.invalidstate"));
}
@@ -159,7 +163,7 @@
public void doCommit () throws IllegalStateException,
HeuristicMixedException, HeuristicRollbackException,
- SystemException
+ javax.transaction.SystemException
{
try
{
@@ -196,7 +200,7 @@
{
ex.printStackTrace();
- throw new IllegalStateException();
+ throw new UnexpectedConditionException(ex.toString());
}
}
@@ -238,7 +242,7 @@
{
ex.printStackTrace();
- throw new IllegalStateException();
+ throw new UnexpectedConditionException(ex.toString());
}
}
@@ -261,7 +265,7 @@
}
public void doOnePhaseCommit () throws IllegalStateException,
- javax.transaction.HeuristicRollbackException
+ javax.transaction.HeuristicRollbackException, javax.transaction.SystemException
{
try
{
@@ -286,14 +290,14 @@
default:
throw new javax.transaction.HeuristicRollbackException();
case ActionStatus.INVALID:
- throw new IllegalStateException();
+ throw new InvalidTerminationStateException();
}
}
catch (ClassCastException ex)
{
ex.printStackTrace();
- throw new IllegalStateException();
+ throw new UnexpectedConditionException(ex.toString());
}
}
@@ -320,7 +324,7 @@
* jtaLogger.logMesg.getString("com.arjuna.ats.internal.jta.transaction.jts.subordinate.invalidstate"));
*/
- throw new IllegalStateException();
+ throw new InvalidTerminationStateException();
}
protected void rollbackAndDisassociate ()
@@ -332,7 +336,7 @@
* jtaLogger.logMesg.getString("com.arjuna.ats.internal.jta.transaction.jts.subordinate.invalidstate"));
*/
- throw new IllegalStateException();
+ throw new InvalidTerminationStateException();
}
/**
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-10-01 11:32:22 UTC (rev 23241)
+++ labs/jbosstm/trunk/ArjunaJTS/jtax/classes/com/arjuna/ats/internal/jta/transaction/jts/TransactionImple.java 2008-10-01 14:32:26 UTC (rev 23242)
@@ -52,6 +52,8 @@
import com.arjuna.ats.jta.xa.*;
import com.arjuna.ats.jta.common.Configuration;
import com.arjuna.ats.jta.common.Environment;
+import com.arjuna.ats.jta.exceptions.InactiveTransactionException;
+import com.arjuna.ats.jta.exceptions.InvalidTerminationStateException;
import com.arjuna.ats.jta.logging.*;
import com.arjuna.ats.jts.common.jtsPropertyManager;
@@ -268,7 +270,7 @@
}
catch (org.omg.CosTransactions.WrongTransaction wt)
{
- throw new IllegalStateException(
+ throw new InactiveTransactionException(
jtaLogger.loggerI18N.getString("com.arjuna.ats.internal.jta.transaction.jts.wrongstatetx"));
}
catch (org.omg.CosTransactions.NoTransaction e1)
@@ -294,7 +296,7 @@
}
catch (INVALID_TRANSACTION e6)
{
- throw new IllegalStateException(
+ throw new InactiveTransactionException(
jtaLogger.loggerI18N.getString("com.arjuna.ats.internal.jta.transaction.jts.invalidtx2"));
}
catch (org.omg.CORBA.SystemException e7)
@@ -353,7 +355,7 @@
}
catch (org.omg.CosTransactions.WrongTransaction e1)
{
- throw new IllegalStateException(
+ throw new InactiveTransactionException(
jtaLogger.loggerI18N.getString("com.arjuna.ats.internal.jta.transaction.jts.wrongstatetx"));
}
catch (org.omg.CORBA.NO_PERMISSION e2)
@@ -362,7 +364,7 @@
}
catch (INVALID_TRANSACTION e3)
{
- throw new IllegalStateException(
+ throw new InactiveTransactionException(
jtaLogger.loggerI18N.getString("com.arjuna.ats.internal.jta.transaction.jts.invalidtx2"));
}
catch (NoTransaction e4)
@@ -380,7 +382,7 @@
}
if (endSuspendedFailed)
- throw new IllegalStateException(
+ throw new InvalidTerminationStateException (
jtaLogger.loggerI18N.getString("com.arjuna.ats.internal.jta.transaction.jts.endsuspendfailed2"));
}
else
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-10-01 11:32:22 UTC (rev 23241)
+++ labs/jbosstm/trunk/ArjunaJTS/jtax/classes/com/arjuna/ats/internal/jta/transaction/jts/subordinate/TransactionImple.java 2008-10-01 14:32:26 UTC (rev 23242)
@@ -37,6 +37,9 @@
import com.arjuna.common.util.logging.*;
import com.arjuna.ats.internal.jta.transaction.jts.AtomicTransaction;
+import com.arjuna.ats.jta.exceptions.InactiveTransactionException;
+import com.arjuna.ats.jta.exceptions.InvalidTerminationStateException;
+import com.arjuna.ats.jta.exceptions.UnexpectedConditionException;
import com.arjuna.ats.jta.logging.*;
import java.lang.IllegalStateException;
@@ -108,7 +111,7 @@
* jtaLogger.loggerI18N.getString("com.arjuna.ats.internal.jta.transaction.jts.subordinate.invalidstate"));
*/
- throw new IllegalStateException();
+ throw new InvalidTerminationStateException();
}
/**
@@ -124,7 +127,7 @@
* jtaLogger.loggerI18N.getString("com.arjuna.ats.internal.jta.transaction.jts.subordinate.invalidstate"));
*/
- throw new IllegalStateException();
+ throw new InvalidTerminationStateException();
}
/**
@@ -225,7 +228,7 @@
{
ex.printStackTrace();
- throw new IllegalStateException();
+ throw new UnexpectedConditionException(ex.toString());
}
finally
{
@@ -283,7 +286,7 @@
{
ex.printStackTrace();
- throw new IllegalStateException();
+ throw new UnexpectedConditionException(ex.toString());
}
finally
{
@@ -301,7 +304,7 @@
*/
public void doOnePhaseCommit () throws IllegalStateException,
- javax.transaction.HeuristicRollbackException
+ javax.transaction.HeuristicRollbackException, javax.transaction.SystemException
{
try
{
@@ -335,7 +338,7 @@
default:
throw new javax.transaction.HeuristicRollbackException();
case ActionStatus.INVALID:
- throw new IllegalStateException();
+ throw new InvalidTerminationStateException();
}
}
catch (ClassCastException ex)
@@ -392,7 +395,7 @@
* jtaLogger.loggerI18N.getString("com.arjuna.ats.internal.jta.transaction.jts.subordinate.invalidstate"));
*/
- throw new IllegalStateException();
+ throw new InactiveTransactionException();
}
protected void rollbackAndDisassociate ()
@@ -404,7 +407,7 @@
* jtaLogger.loggerI18N.getString("com.arjuna.ats.internal.jta.transaction.jts.subordinate.invalidstate"));
*/
- throw new IllegalStateException();
+ throw new InactiveTransactionException();
}
}
More information about the jboss-svn-commits
mailing list