[jboss-svn-commits] JBL Code SVN: r30687 - in labs/jbosstm/trunk: ArjunaJTA/jta/classes/com/arjuna/ats/jta/exceptions and 1 other directories.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Tue Dec 15 15:40:11 EST 2009
Author: mark.little at jboss.com
Date: 2009-12-15 15:40:10 -0500 (Tue, 15 Dec 2009)
New Revision: 30687
Added:
labs/jbosstm/trunk/ArjunaJTA/jta/classes/com/arjuna/ats/jta/exceptions/RollbackException.java
Modified:
labs/jbosstm/trunk/ArjunaJTA/jta/classes/com/arjuna/ats/internal/jta/transaction/arjunacore/TransactionSynchronizationRegistryImple.java
labs/jbosstm/trunk/ArjunaJTS/jtax/classes/com/arjuna/ats/internal/jta/transaction/jts/TransactionSynchronizationRegistryImple.java
Log:
https://jira.jboss.org/jira/browse/JBTM-664
Modified: labs/jbosstm/trunk/ArjunaJTA/jta/classes/com/arjuna/ats/internal/jta/transaction/arjunacore/TransactionSynchronizationRegistryImple.java
===================================================================
--- labs/jbosstm/trunk/ArjunaJTA/jta/classes/com/arjuna/ats/internal/jta/transaction/arjunacore/TransactionSynchronizationRegistryImple.java 2009-12-15 18:49:59 UTC (rev 30686)
+++ labs/jbosstm/trunk/ArjunaJTA/jta/classes/com/arjuna/ats/internal/jta/transaction/arjunacore/TransactionSynchronizationRegistryImple.java 2009-12-15 20:40:10 UTC (rev 30687)
@@ -29,224 +29,226 @@
import javax.transaction.*;
import java.io.Serializable;
-
+
/**
* Implementation of the TransactionSynchronizationRegistry interface, in line with the JTA 1.1 specification.
*
* @author jonathan.halliday at jboss.com
*/
public class TransactionSynchronizationRegistryImple implements TransactionSynchronizationRegistry, Serializable {
- // This Imple is stateless and just delegates the work down to the transaction maanger.
+ // This Imple is stateless and just delegates the work down to the transaction manager.
// It's Serilizable so it can be shoved into the app server JNDI.
/*
- * http://java.sun.com/javaee/5/docs/api/javax/transaction/TransactionSynchronizationRegistry.html
- * http://jcp.org/aboutJava/communityprocess/maintenance/jsr907/907ChangeLog.html
- */
+ * http://java.sun.com/javaee/5/docs/api/javax/transaction/TransactionSynchronizationRegistry.html
+ * http://jcp.org/aboutJava/communityprocess/maintenance/jsr907/907ChangeLog.html
+ */
- // Return an opaque object to represent the transaction bound to the current thread at the time this method is called.
- /**
- * @message com.arjuna.ats.internal.jta.transaction.arjunacore.systemexception
- * [com.arjuna.ats.internal.jta.transaction.arjunacore.systemexception]
- * The transaction implementation threw a SystemException
- */
- public Object getTransactionKey()
- {
- if (jtaLogger.logger.isDebugEnabled())
- {
- jtaLogger.logger.debug(DebugLevel.FUNCTIONS,
- VisibilityLevel.VIS_PUBLIC,
- com.arjuna.ats.jta.logging.FacilityCode.FAC_JTA,
- "TransactionSynchronizationRegistryImple.getTransactionKey");
- }
+ private static final long serialVersionUID = 1L;
- javax.transaction.TransactionManager tm = com.arjuna.ats.jta.TransactionManager.transactionManager();
- TransactionImple transactionImple = null;
- try
- {
- transactionImple = (TransactionImple)tm.getTransaction();
- }
- catch (SystemException e)
- {
- throw new RuntimeException(jtaLogger.logMesg.getString("com.arjuna.ats.internal.jta.transaction.arjunacore.systemexception"), e);
- }
+ // Return an opaque object to represent the transaction bound to the current thread at the time this method is called.
+ /**
+ * @message com.arjuna.ats.internal.jta.transaction.arjunacore.systemexception
+ * [com.arjuna.ats.internal.jta.transaction.arjunacore.systemexception]
+ * The transaction implementation threw a SystemException
+ */
+ public Object getTransactionKey()
+ {
+ if (jtaLogger.logger.isDebugEnabled())
+ {
+ jtaLogger.logger.debug(DebugLevel.FUNCTIONS,
+ VisibilityLevel.VIS_PUBLIC,
+ com.arjuna.ats.jta.logging.FacilityCode.FAC_JTA,
+ "TransactionSynchronizationRegistryImple.getTransactionKey");
+ }
- if (transactionImple == null) {
- return null;
- } else {
- return transactionImple.get_uid();
- }
- }
+ javax.transaction.TransactionManager tm = com.arjuna.ats.jta.TransactionManager.transactionManager();
+ TransactionImple transactionImple = null;
+ try
+ {
+ transactionImple = (TransactionImple)tm.getTransaction();
+ }
+ catch (SystemException e)
+ {
+ throw new RuntimeException(jtaLogger.logMesg.getString("com.arjuna.ats.internal.jta.transaction.arjunacore.systemexception"), e);
+ }
- // Add or replace an object in the Map of resources being managed for the transaction bound to the current thread at the time this method is called.
- public void putResource(Object key, Object value)
- {
- if (jtaLogger.logger.isDebugEnabled())
- {
- jtaLogger.logger.debug(DebugLevel.FUNCTIONS,
- VisibilityLevel.VIS_PUBLIC,
- com.arjuna.ats.jta.logging.FacilityCode.FAC_JTA,
- "TransactionSynchronizationRegistryImple.putResource");
- }
+ if (transactionImple == null) {
+ return null;
+ } else {
+ return transactionImple.get_uid();
+ }
+ }
- if(key == null)
- {
- throw new NullPointerException();
- }
+ // Add or replace an object in the Map of resources being managed for the transaction bound to the current thread at the time this method is called.
+ public void putResource(Object key, Object value)
+ {
+ if (jtaLogger.logger.isDebugEnabled())
+ {
+ jtaLogger.logger.debug(DebugLevel.FUNCTIONS,
+ VisibilityLevel.VIS_PUBLIC,
+ com.arjuna.ats.jta.logging.FacilityCode.FAC_JTA,
+ "TransactionSynchronizationRegistryImple.putResource");
+ }
- TransactionImple transactionImple = getTransactionImple();
- transactionImple.putTxLocalResource(key, value);
- }
+ if(key == null)
+ {
+ throw new NullPointerException();
+ }
- // Get an object from the Map of resources being managed for the transaction bound to the current thread at the time this method is called.
- public Object getResource(Object key)
- {
- if (jtaLogger.logger.isDebugEnabled())
- {
- jtaLogger.logger.debug(DebugLevel.FUNCTIONS,
- VisibilityLevel.VIS_PUBLIC,
- com.arjuna.ats.jta.logging.FacilityCode.FAC_JTA,
- "TransactionSynchronizationRegistryImple.getResource");
- }
+ TransactionImple transactionImple = getTransactionImple();
+ transactionImple.putTxLocalResource(key, value);
+ }
- if(key == null)
- {
- throw new NullPointerException();
- }
+ // Get an object from the Map of resources being managed for the transaction bound to the current thread at the time this method is called.
+ public Object getResource(Object key)
+ {
+ if (jtaLogger.logger.isDebugEnabled())
+ {
+ jtaLogger.logger.debug(DebugLevel.FUNCTIONS,
+ VisibilityLevel.VIS_PUBLIC,
+ com.arjuna.ats.jta.logging.FacilityCode.FAC_JTA,
+ "TransactionSynchronizationRegistryImple.getResource");
+ }
- TransactionImple transactionImple = getTransactionImple();
- return transactionImple.getTxLocalResource(key);
- }
+ if(key == null)
+ {
+ throw new NullPointerException();
+ }
- // Register a Synchronization instance with special ordering semantics.
- /**
- * @message com.arjuna.ats.internal.jta.transaction.arjunacore.syncrollbackexception
- * [com.arjuna.ats.internal.jta.transaction.arjunacore.syncrollbackexception]
- * The transaction implementation threw a RollbackException
- */
- public void registerInterposedSynchronization(Synchronization synchronization)
- {
- if (jtaLogger.logger.isDebugEnabled())
- {
- jtaLogger.logger.debug(DebugLevel.FUNCTIONS,
- VisibilityLevel.VIS_PUBLIC,
- com.arjuna.ats.jta.logging.FacilityCode.FAC_JTA,
- "TransactionSynchronizationRegistryImple.registerInterposedSynchronization");
- }
+ TransactionImple transactionImple = getTransactionImple();
+ return transactionImple.getTxLocalResource(key);
+ }
- TransactionImple transactionImple = getTransactionImple();
+ // Register a Synchronization instance with special ordering semantics.
+ /**
+ * @message com.arjuna.ats.internal.jta.transaction.arjunacore.syncrollbackexception
+ * [com.arjuna.ats.internal.jta.transaction.arjunacore.syncrollbackexception]
+ * The transaction implementation threw a RollbackException
+ */
+ public void registerInterposedSynchronization(Synchronization synchronization)
+ {
+ if (jtaLogger.logger.isDebugEnabled())
+ {
+ jtaLogger.logger.debug(DebugLevel.FUNCTIONS,
+ VisibilityLevel.VIS_PUBLIC,
+ com.arjuna.ats.jta.logging.FacilityCode.FAC_JTA,
+ "TransactionSynchronizationRegistryImple.registerInterposedSynchronization");
+ }
- try
- {
- transactionImple.registerSynchronizationImple(new SynchronizationImple(synchronization, true));
- }
- catch (RollbackException e)
- {
- throw new RuntimeException(jtaLogger.logMesg.getString("com.arjuna.ats.internal.jta.transaction.arjunacore.syncrollbackexception"), e);
- }
- catch (SystemException e)
- {
- throw new RuntimeException(jtaLogger.logMesg.getString("com.arjuna.ats.internal.jta.transaction.arjunacore.systemexception"), e);
- }
- }
+ TransactionImple transactionImple = getTransactionImple();
- // Return the status of the transaction bound to the current thread at the time this method is called.
- public int getTransactionStatus()
- {
- if (jtaLogger.logger.isDebugEnabled())
- {
- jtaLogger.logger.debug(DebugLevel.FUNCTIONS,
- VisibilityLevel.VIS_PUBLIC,
- com.arjuna.ats.jta.logging.FacilityCode.FAC_JTA,
- "TransactionSynchronizationRegistryImple.getTransactionStatus");
- }
+ try
+ {
+ transactionImple.registerSynchronizationImple(new SynchronizationImple(synchronization, true));
+ }
+ catch (RollbackException e)
+ {
+ throw new com.arjuna.ats.jta.exceptions.RollbackException(jtaLogger.logMesg.getString("com.arjuna.ats.internal.jta.transaction.arjunacore.syncrollbackexception"), e);
+ }
+ catch (SystemException e)
+ {
+ throw new RuntimeException(jtaLogger.logMesg.getString("com.arjuna.ats.internal.jta.transaction.arjunacore.systemexception"), e);
+ }
+ }
- javax.transaction.TransactionManager tm = com.arjuna.ats.jta.TransactionManager.transactionManager();
- try
- {
- return tm.getStatus();
- }
- catch(SystemException e)
- {
- throw new RuntimeException(jtaLogger.logMesg.getString("com.arjuna.ats.internal.jta.transaction.arjunacore.systemexception"), e);
- }
+ // Return the status of the transaction bound to the current thread at the time this method is called.
+ public int getTransactionStatus()
+ {
+ if (jtaLogger.logger.isDebugEnabled())
+ {
+ jtaLogger.logger.debug(DebugLevel.FUNCTIONS,
+ VisibilityLevel.VIS_PUBLIC,
+ com.arjuna.ats.jta.logging.FacilityCode.FAC_JTA,
+ "TransactionSynchronizationRegistryImple.getTransactionStatus");
+ }
- }
+ javax.transaction.TransactionManager tm = com.arjuna.ats.jta.TransactionManager.transactionManager();
+ try
+ {
+ return tm.getStatus();
+ }
+ catch(SystemException e)
+ {
+ throw new RuntimeException(jtaLogger.logMesg.getString("com.arjuna.ats.internal.jta.transaction.arjunacore.systemexception"), e);
+ }
- // Set the rollbackOnly status of the transaction bound to the current thread at the time this method is called.
- public void setRollbackOnly()
- {
- if (jtaLogger.logger.isDebugEnabled())
- {
- jtaLogger.logger.debug(DebugLevel.FUNCTIONS,
- VisibilityLevel.VIS_PUBLIC,
- com.arjuna.ats.jta.logging.FacilityCode.FAC_JTA,
- "TransactionSynchronizationRegistryImple.setRollbackOnly");
- }
+ }
- javax.transaction.TransactionManager tm = com.arjuna.ats.jta.TransactionManager.transactionManager();
- try
- {
- Transaction transaction = tm.getTransaction();
+ // Set the rollbackOnly status of the transaction bound to the current thread at the time this method is called.
+ public void setRollbackOnly()
+ {
+ if (jtaLogger.logger.isDebugEnabled())
+ {
+ jtaLogger.logger.debug(DebugLevel.FUNCTIONS,
+ VisibilityLevel.VIS_PUBLIC,
+ com.arjuna.ats.jta.logging.FacilityCode.FAC_JTA,
+ "TransactionSynchronizationRegistryImple.setRollbackOnly");
+ }
- if(transaction == null)
- {
- throw new IllegalStateException();
- }
+ javax.transaction.TransactionManager tm = com.arjuna.ats.jta.TransactionManager.transactionManager();
+ try
+ {
+ Transaction transaction = tm.getTransaction();
- tm.setRollbackOnly();
- }
- catch (SystemException e)
- {
- throw new RuntimeException(jtaLogger.logMesg.getString("com.arjuna.ats.internal.jta.transaction.arjunacore.systemexception"), e);
- }
- }
+ if(transaction == null)
+ {
+ throw new IllegalStateException();
+ }
- // Get the rollbackOnly status of the transaction bound to the current thread at the time this method is called.
- public boolean getRollbackOnly()
- {
- if (jtaLogger.logger.isDebugEnabled())
- {
- jtaLogger.logger.debug(DebugLevel.FUNCTIONS,
- VisibilityLevel.VIS_PUBLIC,
- com.arjuna.ats.jta.logging.FacilityCode.FAC_JTA,
- "TransactionSynchronizationRegistryImple.getRollbackOnly");
- }
+ tm.setRollbackOnly();
+ }
+ catch (SystemException e)
+ {
+ throw new RuntimeException(jtaLogger.logMesg.getString("com.arjuna.ats.internal.jta.transaction.arjunacore.systemexception"), e);
+ }
+ }
- TransactionImple transactionImple = getTransactionImple();
+ // Get the rollbackOnly status of the transaction bound to the current thread at the time this method is called.
+ public boolean getRollbackOnly()
+ {
+ if (jtaLogger.logger.isDebugEnabled())
+ {
+ jtaLogger.logger.debug(DebugLevel.FUNCTIONS,
+ VisibilityLevel.VIS_PUBLIC,
+ com.arjuna.ats.jta.logging.FacilityCode.FAC_JTA,
+ "TransactionSynchronizationRegistryImple.getRollbackOnly");
+ }
- if(transactionImple == null) {
- throw new IllegalStateException();
- }
+ TransactionImple transactionImple = getTransactionImple();
- try
- {
- return (transactionImple.getStatus() == Status.STATUS_MARKED_ROLLBACK);
- }
- catch (SystemException e)
- {
- throw new RuntimeException(jtaLogger.logMesg.getString("com.arjuna.ats.internal.jta.transaction.arjunacore.systemexception"), e);
- }
- }
+ if(transactionImple == null) {
+ throw new IllegalStateException();
+ }
- private TransactionImple getTransactionImple() throws IllegalStateException
- {
- javax.transaction.TransactionManager tm = com.arjuna.ats.jta.TransactionManager.transactionManager();
- TransactionImple transactionImple = null;
- try
- {
- transactionImple = (TransactionImple)tm.getTransaction();
- }
- catch (SystemException e)
- {
- throw new RuntimeException(jtaLogger.logMesg.getString("com.arjuna.ats.internal.jta.transaction.arjunacore.systemexception"), e);
- }
+ try
+ {
+ return (transactionImple.getStatus() == Status.STATUS_MARKED_ROLLBACK);
+ }
+ catch (SystemException e)
+ {
+ throw new RuntimeException(jtaLogger.logMesg.getString("com.arjuna.ats.internal.jta.transaction.arjunacore.systemexception"), e);
+ }
+ }
- if(transactionImple == null)
- {
- throw new IllegalStateException();
- }
+ private TransactionImple getTransactionImple() throws IllegalStateException
+ {
+ javax.transaction.TransactionManager tm = com.arjuna.ats.jta.TransactionManager.transactionManager();
+ TransactionImple transactionImple = null;
+ try
+ {
+ transactionImple = (TransactionImple)tm.getTransaction();
+ }
+ catch (SystemException e)
+ {
+ throw new RuntimeException(jtaLogger.logMesg.getString("com.arjuna.ats.internal.jta.transaction.arjunacore.systemexception"), e);
+ }
- return transactionImple;
- }
+ if(transactionImple == null)
+ {
+ throw new IllegalStateException();
+ }
+
+ return transactionImple;
+ }
}
Added: labs/jbosstm/trunk/ArjunaJTA/jta/classes/com/arjuna/ats/jta/exceptions/RollbackException.java
===================================================================
--- labs/jbosstm/trunk/ArjunaJTA/jta/classes/com/arjuna/ats/jta/exceptions/RollbackException.java (rev 0)
+++ labs/jbosstm/trunk/ArjunaJTA/jta/classes/com/arjuna/ats/jta/exceptions/RollbackException.java 2009-12-15 20:40:10 UTC (rev 30687)
@@ -0,0 +1,113 @@
+/*
+ * 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 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 Lesser General Public License, v. 2.1.
+ * 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 Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (C) 1998, 1999, 2000,
+ *
+ * Arjuna Solutions Limited,
+ * Newcastle upon Tyne,
+ * Tyne and Wear,
+ * UK.
+ *
+ * $Id: NotImplementedException.java 2342 2006-03-30 13:06:17Z $
+ */
+
+package com.arjuna.ats.jta.exceptions;
+
+/**
+ * Thrown by TransactionSynchronizationRegistry implementation if the
+ * transaction has rolled back. We have to do this because JTA 1.1 took the
+ * decision to hide or ignore one of the exceptions that registerSynchronization
+ * may otherwise throw!
+ *
+ * @author Mark Little (mark at arjuna.com)
+ * @version $Id: NotImplementedException.java 2342 2006-03-30 13:06:17Z $
+ * @since JTS 1.2.4.
+ */
+
+public class RollbackException extends IllegalStateException
+{
+ static final long serialVersionUID = -2708657802308998286L;
+
+ /**
+ * Constructs a new exception with <code>null</code> as its detail message.
+ * The cause is not initialized, and may subsequently be initialized by a
+ * call to {@link #initCause}.
+ */
+ public RollbackException()
+ {
+ super();
+ }
+
+ /**
+ * Constructs a new exception with the specified detail message. The cause
+ * is not initialized, and may subsequently be initialized by a call to
+ * {@link #initCause}.
+ *
+ * @param message
+ * the detail message. The detail message is saved for later
+ * retrieval by the {@link #getMessage()} method.
+ */
+ public RollbackException(String message)
+ {
+ super(message);
+ }
+
+ /**
+ * Constructs a new exception with the specified detail message and cause.
+ * <p>
+ * Note that the detail message associated with <code>cause</code> is
+ * <i>not</i> automatically incorporated in this exception's detail message.
+ *
+ * @param message
+ * the detail message (which is saved for later retrieval by the
+ * {@link #getMessage()} method).
+ * @param cause
+ * the cause (which is saved for later retrieval by the
+ * {@link #getCause()} method). (A <tt>null</tt> value is
+ * permitted, and indicates that the cause is nonexistent or
+ * unknown.)
+ * @since 1.4
+ */
+ public RollbackException(String message, Throwable cause)
+ {
+ super(message, cause);
+ }
+
+ /**
+ * Constructs a new exception with the specified cause and a detail message
+ * of <tt>(cause==null ? null : cause.toString())</tt> (which typically
+ * contains the class and detail message of <tt>cause</tt>). This
+ * constructor is useful for exceptions that are little more than wrappers
+ * for other throwables (for example,
+ * {@link java.security.PrivilegedActionException}).
+ *
+ * @param cause
+ * the cause (which is saved for later retrieval by the
+ * {@link #getCause()} method). (A <tt>null</tt> value is
+ * permitted, and indicates that the cause is nonexistent or
+ * unknown.)
+ * @since 1.4
+ */
+ public RollbackException(Throwable cause)
+ {
+ super(cause);
+ }
+}
Modified: labs/jbosstm/trunk/ArjunaJTS/jtax/classes/com/arjuna/ats/internal/jta/transaction/jts/TransactionSynchronizationRegistryImple.java
===================================================================
--- labs/jbosstm/trunk/ArjunaJTS/jtax/classes/com/arjuna/ats/internal/jta/transaction/jts/TransactionSynchronizationRegistryImple.java 2009-12-15 18:49:59 UTC (rev 30686)
+++ labs/jbosstm/trunk/ArjunaJTS/jtax/classes/com/arjuna/ats/internal/jta/transaction/jts/TransactionSynchronizationRegistryImple.java 2009-12-15 20:40:10 UTC (rev 30687)
@@ -41,214 +41,216 @@
// It's Serilizable so it can be shoved into the app server JNDI.
/*
- * http://java.sun.com/javaee/5/docs/api/javax/transaction/TransactionSynchronizationRegistry.html
- * http://jcp.org/aboutJava/communityprocess/maintenance/jsr907/907ChangeLog.html
- */
+ * http://java.sun.com/javaee/5/docs/api/javax/transaction/TransactionSynchronizationRegistry.html
+ * http://jcp.org/aboutJava/communityprocess/maintenance/jsr907/907ChangeLog.html
+ */
- // Return an opaque object to represent the transaction bound to the current thread at the time this method is called.
+ // Return an opaque object to represent the transaction bound to the current thread at the time this method is called.
+ private static final long serialVersionUID = 1L;
+
/**
- * @message com.arjuna.ats.internal.jta.transaction.jts.systemexception
- * [com.arjuna.ats.internal.jta.transaction.jts.systemexception]
- * The transaction implementation threw a SystemException
- */
- public Object getTransactionKey()
- {
- if (jtaLogger.logger.isDebugEnabled())
- {
- jtaLogger.logger.debug(DebugLevel.FUNCTIONS,
- VisibilityLevel.VIS_PUBLIC,
- com.arjuna.ats.jta.logging.FacilityCode.FAC_JTA,
- "TransactionSynchronizationRegistryImple.getTransactionKey");
- }
+ * @message com.arjuna.ats.internal.jta.transaction.jts.systemexception
+ * [com.arjuna.ats.internal.jta.transaction.jts.systemexception]
+ * The transaction implementation threw a SystemException
+ */
+ public Object getTransactionKey()
+ {
+ if (jtaLogger.logger.isDebugEnabled())
+ {
+ jtaLogger.logger.debug(DebugLevel.FUNCTIONS,
+ VisibilityLevel.VIS_PUBLIC,
+ com.arjuna.ats.jta.logging.FacilityCode.FAC_JTA,
+ "TransactionSynchronizationRegistryImple.getTransactionKey");
+ }
javax.transaction.TransactionManager tm = com.arjuna.ats.jta.TransactionManager.transactionManager();
- TransactionImple transactionImple = null;
- try
- {
- transactionImple = (TransactionImple)tm.getTransaction();
+ TransactionImple transactionImple = null;
+ try
+ {
+ transactionImple = (TransactionImple)tm.getTransaction();
}
- catch (SystemException e)
- {
- throw new RuntimeException(jtaLogger.loggerI18N.getString("com.arjuna.ats.internal.jta.transaction.jts.systemexception"), e);
- }
+ catch (SystemException e)
+ {
+ throw new RuntimeException(jtaLogger.loggerI18N.getString("com.arjuna.ats.internal.jta.transaction.jts.systemexception"), e);
+ }
- if (transactionImple == null) {
- return null;
- } else {
- return transactionImple.get_uid();
- }
- }
+ if (transactionImple == null) {
+ return null;
+ } else {
+ return transactionImple.get_uid();
+ }
+ }
- // Add or replace an object in the Map of resources being managed for the transaction bound to the current thread at the time this method is called.
- public void putResource(Object key, Object value)
- {
- if (jtaLogger.logger.isDebugEnabled())
- {
- jtaLogger.logger.debug(DebugLevel.FUNCTIONS,
- VisibilityLevel.VIS_PUBLIC,
- com.arjuna.ats.jta.logging.FacilityCode.FAC_JTA,
- "TransactionSynchronizationRegistryImple.putResource");
- }
+ // Add or replace an object in the Map of resources being managed for the transaction bound to the current thread at the time this method is called.
+ public void putResource(Object key, Object value)
+ {
+ if (jtaLogger.logger.isDebugEnabled())
+ {
+ jtaLogger.logger.debug(DebugLevel.FUNCTIONS,
+ VisibilityLevel.VIS_PUBLIC,
+ com.arjuna.ats.jta.logging.FacilityCode.FAC_JTA,
+ "TransactionSynchronizationRegistryImple.putResource");
+ }
- if(key == null)
- {
- throw new NullPointerException();
- }
+ if(key == null)
+ {
+ throw new NullPointerException();
+ }
- TransactionImple transactionImple = getTransactionImple();
- transactionImple.putTxLocalResource(key, value);
- }
+ TransactionImple transactionImple = getTransactionImple();
+ transactionImple.putTxLocalResource(key, value);
+ }
- // Get an object from the Map of resources being managed for the transaction bound to the current thread at the time this method is called.
- public Object getResource(Object key)
- {
- if (jtaLogger.logger.isDebugEnabled())
- {
- jtaLogger.logger.debug(DebugLevel.FUNCTIONS,
- VisibilityLevel.VIS_PUBLIC,
- com.arjuna.ats.jta.logging.FacilityCode.FAC_JTA,
- "TransactionSynchronizationRegistryImple.getResource");
- }
+ // Get an object from the Map of resources being managed for the transaction bound to the current thread at the time this method is called.
+ public Object getResource(Object key)
+ {
+ if (jtaLogger.logger.isDebugEnabled())
+ {
+ jtaLogger.logger.debug(DebugLevel.FUNCTIONS,
+ VisibilityLevel.VIS_PUBLIC,
+ com.arjuna.ats.jta.logging.FacilityCode.FAC_JTA,
+ "TransactionSynchronizationRegistryImple.getResource");
+ }
- if(key == null)
- {
- throw new NullPointerException();
- }
+ if(key == null)
+ {
+ throw new NullPointerException();
+ }
- TransactionImple transactionImple = getTransactionImple();
- return transactionImple.getTxLocalResource(key);
- }
+ TransactionImple transactionImple = getTransactionImple();
+ return transactionImple.getTxLocalResource(key);
+ }
- // Register a Synchronization instance with special ordering semantics.
- /**
- * @message com.arjuna.ats.internal.jta.transaction.jts.syncrollbackexception
- * [ccom.arjuna.ats.internal.jta.transaction.jts.syncrollbackexception]
- * The transaction implementation threw a RollbackException
- */
- public void registerInterposedSynchronization(Synchronization synchronization)
- {
- if (jtaLogger.logger.isDebugEnabled())
- {
- jtaLogger.logger.debug(DebugLevel.FUNCTIONS,
- VisibilityLevel.VIS_PUBLIC,
- com.arjuna.ats.jta.logging.FacilityCode.FAC_JTA,
- "TransactionSynchronizationRegistryImple.registerInterposedSynchronization");
- }
+ // Register a Synchronization instance with special ordering semantics.
+ /**
+ * @message com.arjuna.ats.internal.jta.transaction.jts.syncrollbackexception
+ * [ccom.arjuna.ats.internal.jta.transaction.jts.syncrollbackexception]
+ * The transaction implementation threw a RollbackException
+ */
+ public void registerInterposedSynchronization(Synchronization synchronization)
+ {
+ if (jtaLogger.logger.isDebugEnabled())
+ {
+ jtaLogger.logger.debug(DebugLevel.FUNCTIONS,
+ VisibilityLevel.VIS_PUBLIC,
+ com.arjuna.ats.jta.logging.FacilityCode.FAC_JTA,
+ "TransactionSynchronizationRegistryImple.registerInterposedSynchronization");
+ }
- TransactionImple transactionImple = getTransactionImple();
+ TransactionImple transactionImple = getTransactionImple();
- try
- {
- transactionImple.registerSynchronizationImple(new JTAInterposedSynchronizationImple(synchronization));
- }
- catch (RollbackException e)
- {
- throw new RuntimeException(jtaLogger.loggerI18N.getString("com.arjuna.ats.internal.jta.transaction.jts.syncrollbackexception"), e);
- }
- catch (SystemException e)
- {
- throw new RuntimeException(jtaLogger.loggerI18N.getString("com.arjuna.ats.internal.jta.transaction.jts.systemexception"), e);
- }
- }
+ try
+ {
+ transactionImple.registerSynchronizationImple(new JTAInterposedSynchronizationImple(synchronization));
+ }
+ catch (RollbackException e)
+ {
+ throw new com.arjuna.ats.jta.exceptions.RollbackException(jtaLogger.loggerI18N.getString("com.arjuna.ats.internal.jta.transaction.jts.syncrollbackexception"), e);
+ }
+ catch (SystemException e)
+ {
+ throw new RuntimeException(jtaLogger.loggerI18N.getString("com.arjuna.ats.internal.jta.transaction.jts.systemexception"), e);
+ }
+ }
- // Return the status of the transaction bound to the current thread at the time this method is called.
- public int getTransactionStatus()
- {
- if (jtaLogger.logger.isDebugEnabled())
- {
- jtaLogger.logger.debug(DebugLevel.FUNCTIONS,
- VisibilityLevel.VIS_PUBLIC,
- com.arjuna.ats.jta.logging.FacilityCode.FAC_JTA,
- "TransactionSynchronizationRegistryImple.getTransactionStatus");
- }
+ // Return the status of the transaction bound to the current thread at the time this method is called.
+ public int getTransactionStatus()
+ {
+ if (jtaLogger.logger.isDebugEnabled())
+ {
+ jtaLogger.logger.debug(DebugLevel.FUNCTIONS,
+ VisibilityLevel.VIS_PUBLIC,
+ com.arjuna.ats.jta.logging.FacilityCode.FAC_JTA,
+ "TransactionSynchronizationRegistryImple.getTransactionStatus");
+ }
- javax.transaction.TransactionManager tm = com.arjuna.ats.jta.TransactionManager.transactionManager();
- try
- {
- return tm.getStatus();
- }
- catch(SystemException e)
- {
- throw new RuntimeException(jtaLogger.loggerI18N.getString("com.arjuna.ats.internal.jta.transaction.jts.systemexception"), e);
- }
+ javax.transaction.TransactionManager tm = com.arjuna.ats.jta.TransactionManager.transactionManager();
+ try
+ {
+ return tm.getStatus();
+ }
+ catch(SystemException e)
+ {
+ throw new RuntimeException(jtaLogger.loggerI18N.getString("com.arjuna.ats.internal.jta.transaction.jts.systemexception"), e);
+ }
- }
+ }
- // Set the rollbackOnly status of the transaction bound to the current thread at the time this method is called.
- public void setRollbackOnly()
- {
- if (jtaLogger.logger.isDebugEnabled())
- {
- jtaLogger.logger.debug(DebugLevel.FUNCTIONS,
- VisibilityLevel.VIS_PUBLIC,
- com.arjuna.ats.jta.logging.FacilityCode.FAC_JTA,
- "TransactionSynchronizationRegistryImple.setRollbackOnly");
- }
+ // Set the rollbackOnly status of the transaction bound to the current thread at the time this method is called.
+ public void setRollbackOnly()
+ {
+ if (jtaLogger.logger.isDebugEnabled())
+ {
+ jtaLogger.logger.debug(DebugLevel.FUNCTIONS,
+ VisibilityLevel.VIS_PUBLIC,
+ com.arjuna.ats.jta.logging.FacilityCode.FAC_JTA,
+ "TransactionSynchronizationRegistryImple.setRollbackOnly");
+ }
- javax.transaction.TransactionManager tm = com.arjuna.ats.jta.TransactionManager.transactionManager();
- try
- {
- Transaction transaction = tm.getTransaction();
+ javax.transaction.TransactionManager tm = com.arjuna.ats.jta.TransactionManager.transactionManager();
+ try
+ {
+ Transaction transaction = tm.getTransaction();
- if(transaction == null)
- {
- throw new IllegalStateException();
- }
+ if(transaction == null)
+ {
+ throw new IllegalStateException();
+ }
- tm.setRollbackOnly();
- }
- catch (SystemException e)
- {
- throw new RuntimeException(jtaLogger.loggerI18N.getString("com.arjuna.ats.internal.jta.transaction.jts.systemexception"), e);
- }
- }
+ tm.setRollbackOnly();
+ }
+ catch (SystemException e)
+ {
+ throw new RuntimeException(jtaLogger.loggerI18N.getString("com.arjuna.ats.internal.jta.transaction.jts.systemexception"), e);
+ }
+ }
- // Get the rollbackOnly status of the transaction bound to the current thread at the time this method is called.
- public boolean getRollbackOnly()
- {
- if (jtaLogger.logger.isDebugEnabled())
- {
- jtaLogger.logger.debug(DebugLevel.FUNCTIONS,
- VisibilityLevel.VIS_PUBLIC,
- com.arjuna.ats.jta.logging.FacilityCode.FAC_JTA,
- "TransactionSynchronizationRegistryImple.getRollbackOnly");
- }
+ // Get the rollbackOnly status of the transaction bound to the current thread at the time this method is called.
+ public boolean getRollbackOnly()
+ {
+ if (jtaLogger.logger.isDebugEnabled())
+ {
+ jtaLogger.logger.debug(DebugLevel.FUNCTIONS,
+ VisibilityLevel.VIS_PUBLIC,
+ com.arjuna.ats.jta.logging.FacilityCode.FAC_JTA,
+ "TransactionSynchronizationRegistryImple.getRollbackOnly");
+ }
- TransactionImple transactionImple = getTransactionImple();
+ TransactionImple transactionImple = getTransactionImple();
- if(transactionImple == null) {
- throw new IllegalStateException();
- }
+ if(transactionImple == null) {
+ throw new IllegalStateException();
+ }
- try
- {
- return (transactionImple.getStatus() == Status.STATUS_MARKED_ROLLBACK);
- }
- catch (SystemException e)
- {
- throw new RuntimeException(jtaLogger.loggerI18N.getString("com.arjuna.ats.internal.jta.transaction.jts.systemexception"), e);
- }
- }
+ try
+ {
+ return (transactionImple.getStatus() == Status.STATUS_MARKED_ROLLBACK);
+ }
+ catch (SystemException e)
+ {
+ throw new RuntimeException(jtaLogger.loggerI18N.getString("com.arjuna.ats.internal.jta.transaction.jts.systemexception"), e);
+ }
+ }
- private TransactionImple getTransactionImple() throws IllegalStateException
- {
- javax.transaction.TransactionManager tm = com.arjuna.ats.jta.TransactionManager.transactionManager();
- TransactionImple transactionImple = null;
- try
- {
- transactionImple = (TransactionImple)tm.getTransaction();
- }
- catch (SystemException e)
- {
- throw new RuntimeException(jtaLogger.loggerI18N.getString("com.arjuna.ats.internal.jta.transaction.jts.systemexception"), e);
- }
+ private TransactionImple getTransactionImple() throws IllegalStateException
+ {
+ javax.transaction.TransactionManager tm = com.arjuna.ats.jta.TransactionManager.transactionManager();
+ TransactionImple transactionImple = null;
+ try
+ {
+ transactionImple = (TransactionImple)tm.getTransaction();
+ }
+ catch (SystemException e)
+ {
+ throw new RuntimeException(jtaLogger.loggerI18N.getString("com.arjuna.ats.internal.jta.transaction.jts.systemexception"), e);
+ }
- if(transactionImple == null)
- {
- throw new IllegalStateException();
- }
+ if(transactionImple == null)
+ {
+ throw new IllegalStateException();
+ }
- return transactionImple;
- }
+ return transactionImple;
+ }
}
More information about the jboss-svn-commits
mailing list