[jboss-cvs] JBossAS SVN: r61190 - in projects/javaee/trunk/transaction-api/src/main/javax/transaction: xa and 1 other directory.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Wed Mar 7 09:10:28 EST 2007
Author: wolfc
Date: 2007-03-07 09:10:28 -0500 (Wed, 07 Mar 2007)
New Revision: 61190
Added:
projects/javaee/trunk/transaction-api/src/main/javax/transaction/HeuristicCommitException.java
projects/javaee/trunk/transaction-api/src/main/javax/transaction/HeuristicMixedException.java
projects/javaee/trunk/transaction-api/src/main/javax/transaction/HeuristicRollbackException.java
projects/javaee/trunk/transaction-api/src/main/javax/transaction/InvalidTransactionException.java
projects/javaee/trunk/transaction-api/src/main/javax/transaction/NotSupportedException.java
projects/javaee/trunk/transaction-api/src/main/javax/transaction/RollbackException.java
projects/javaee/trunk/transaction-api/src/main/javax/transaction/Status.java
projects/javaee/trunk/transaction-api/src/main/javax/transaction/Synchronization.java
projects/javaee/trunk/transaction-api/src/main/javax/transaction/SystemException.java
projects/javaee/trunk/transaction-api/src/main/javax/transaction/Transaction.java
projects/javaee/trunk/transaction-api/src/main/javax/transaction/TransactionManager.java
projects/javaee/trunk/transaction-api/src/main/javax/transaction/TransactionRequiredException.java
projects/javaee/trunk/transaction-api/src/main/javax/transaction/TransactionRolledbackException.java
projects/javaee/trunk/transaction-api/src/main/javax/transaction/TransactionSynchronizationRegistry.java
projects/javaee/trunk/transaction-api/src/main/javax/transaction/UserTransaction.java
projects/javaee/trunk/transaction-api/src/main/javax/transaction/xa/
projects/javaee/trunk/transaction-api/src/main/javax/transaction/xa/XAException.java
projects/javaee/trunk/transaction-api/src/main/javax/transaction/xa/XAResource.java
projects/javaee/trunk/transaction-api/src/main/javax/transaction/xa/Xid.java
projects/javaee/trunk/transaction-api/src/main/javax/transaction/xa/package.html
Removed:
projects/javaee/trunk/transaction-api/src/main/javax/transaction/xa/XAException.java
projects/javaee/trunk/transaction-api/src/main/javax/transaction/xa/XAResource.java
projects/javaee/trunk/transaction-api/src/main/javax/transaction/xa/Xid.java
projects/javaee/trunk/transaction-api/src/main/javax/transaction/xa/package.html
Log:
JTA 1.0.1
Copied: projects/javaee/trunk/transaction-api/src/main/javax/transaction/HeuristicCommitException.java (from rev 61188, trunk/j2ee/src/main/javax/transaction/HeuristicCommitException.java)
===================================================================
--- projects/javaee/trunk/transaction-api/src/main/javax/transaction/HeuristicCommitException.java (rev 0)
+++ projects/javaee/trunk/transaction-api/src/main/javax/transaction/HeuristicCommitException.java 2007-03-07 14:10:28 UTC (rev 61190)
@@ -0,0 +1,56 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY 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 along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package javax.transaction;
+
+/**
+ * This exception is meant to be thrown by the rollback operation on
+ * a resource to report that a heuristic decision was made and that all
+ * relevant updates have been committed.
+ * <p>
+ * But though defined in JTA this exception is used nowhere in JTA, and
+ * it seems impossible to report a heuristic commit decision with the JTA
+ * API in a portable way.
+ *
+ * @version $Revision$
+ */
+public class HeuristicCommitException extends Exception
+{
+
+ /**
+ * Creates a new <code>HeuristicMixedException</code> without a
+ * detail message.
+ */
+ public HeuristicCommitException()
+ {
+ }
+
+ /**
+ * Constructs an <code>HeuristicCommitException</code> with the
+ * specified detail message.
+ *
+ * @param msg the detail message.
+ */
+ public HeuristicCommitException(String msg)
+ {
+ super(msg);
+ }
+}
Property changes on: projects/javaee/trunk/transaction-api/src/main/javax/transaction/HeuristicCommitException.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Copied: projects/javaee/trunk/transaction-api/src/main/javax/transaction/HeuristicMixedException.java (from rev 61188, trunk/j2ee/src/main/javax/transaction/HeuristicMixedException.java)
===================================================================
--- projects/javaee/trunk/transaction-api/src/main/javax/transaction/HeuristicMixedException.java (rev 0)
+++ projects/javaee/trunk/transaction-api/src/main/javax/transaction/HeuristicMixedException.java 2007-03-07 14:10:28 UTC (rev 61190)
@@ -0,0 +1,52 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY 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 along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package javax.transaction;
+
+/**
+ * This exception is thrown to report that a heuristic decision was made and
+ * that some some parts of the transaction have been committed while other
+ * parts have been rolled back.
+ *
+ * @version $Revision$
+ */
+public class HeuristicMixedException extends Exception
+{
+
+ /**
+ * Creates a new <code>HeuristicMixedException</code> without a
+ * detail message.
+ */
+ public HeuristicMixedException()
+ {
+ }
+
+ /**
+ * Constructs an <code>HeuristicMixedException</code> with the
+ * specified detail message.
+ *
+ * @param msg the detail message.
+ */
+ public HeuristicMixedException(String msg)
+ {
+ super(msg);
+ }
+}
Property changes on: projects/javaee/trunk/transaction-api/src/main/javax/transaction/HeuristicMixedException.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Copied: projects/javaee/trunk/transaction-api/src/main/javax/transaction/HeuristicRollbackException.java (from rev 61188, trunk/j2ee/src/main/javax/transaction/HeuristicRollbackException.java)
===================================================================
--- projects/javaee/trunk/transaction-api/src/main/javax/transaction/HeuristicRollbackException.java (rev 0)
+++ projects/javaee/trunk/transaction-api/src/main/javax/transaction/HeuristicRollbackException.java 2007-03-07 14:10:28 UTC (rev 61190)
@@ -0,0 +1,52 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY 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 along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package javax.transaction;
+
+/**
+ * This exception is thrown by the commit operation to report that a
+ * heuristic decision was made and that all relevant updates have been
+ * rolled back.
+ *
+ * @version $Revision$
+ */
+public class HeuristicRollbackException extends Exception
+{
+
+ /**
+ * Creates a new <code>HeuristicRollbackException</code> without a
+ * detail message.
+ */
+ public HeuristicRollbackException()
+ {
+ }
+
+ /**
+ * Constructs an <code>HeuristicRollbackException</code> with the
+ * specified detail message.
+ *
+ * @param msg the detail message.
+ */
+ public HeuristicRollbackException(String msg)
+ {
+ super(msg);
+ }
+}
Property changes on: projects/javaee/trunk/transaction-api/src/main/javax/transaction/HeuristicRollbackException.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Copied: projects/javaee/trunk/transaction-api/src/main/javax/transaction/InvalidTransactionException.java (from rev 61188, trunk/j2ee/src/main/javax/transaction/InvalidTransactionException.java)
===================================================================
--- projects/javaee/trunk/transaction-api/src/main/javax/transaction/InvalidTransactionException.java (rev 0)
+++ projects/javaee/trunk/transaction-api/src/main/javax/transaction/InvalidTransactionException.java 2007-03-07 14:10:28 UTC (rev 61190)
@@ -0,0 +1,57 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY 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 along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package javax.transaction;
+
+import java.rmi.RemoteException;
+
+/**
+ * This exception indicates an invalid transaction.
+ * <p>
+ * It is thrown from the {@link TransactionManager#resume(Transaction)}
+ * method if the argument is not a valid transaction.
+ * It may also be thrown from an EJB container invocation is the invocation
+ * request carries an invalid transaction propagation context.
+ *
+ * @version $Revision$
+ */
+public class InvalidTransactionException extends RemoteException
+{
+
+ /**
+ * Creates a new <code>InvalidTransactionException</code> without a
+ * detail message.
+ */
+ public InvalidTransactionException()
+ {
+ }
+
+ /**
+ * Constructs an <code>InvalidTransactionException</code> with the
+ * specified detail message.
+ *
+ * @param msg the detail message.
+ */
+ public InvalidTransactionException(String msg)
+ {
+ super(msg);
+ }
+}
Property changes on: projects/javaee/trunk/transaction-api/src/main/javax/transaction/InvalidTransactionException.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Copied: projects/javaee/trunk/transaction-api/src/main/javax/transaction/NotSupportedException.java (from rev 61188, trunk/j2ee/src/main/javax/transaction/NotSupportedException.java)
===================================================================
--- projects/javaee/trunk/transaction-api/src/main/javax/transaction/NotSupportedException.java (rev 0)
+++ projects/javaee/trunk/transaction-api/src/main/javax/transaction/NotSupportedException.java 2007-03-07 14:10:28 UTC (rev 61190)
@@ -0,0 +1,56 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY 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 along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package javax.transaction;
+
+/**
+ * The NotSupportedException exception indicates that an operation is not
+ * supported.
+ *
+ * For example, the {@link TransactionManager#begin()} and
+ * {@link UserTransaction#begin()} methods throw this exception if the
+ * calling thread is already associated with a transaction, and nested
+ * transactions are not supported.
+ *
+ * @version $Revision$
+ */
+public class NotSupportedException extends Exception
+{
+
+ /**
+ * Creates a new <code>NotSupportedException</code> without a
+ * detail message.
+ */
+ public NotSupportedException()
+ {
+ }
+
+ /**
+ * Constructs an <code>NotSupportedException</code> with the specified
+ * detail message.
+ *
+ * @param msg the detail message.
+ */
+ public NotSupportedException(String msg)
+ {
+ super(msg);
+ }
+}
Property changes on: projects/javaee/trunk/transaction-api/src/main/javax/transaction/NotSupportedException.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Copied: projects/javaee/trunk/transaction-api/src/main/javax/transaction/RollbackException.java (from rev 61188, trunk/j2ee/src/main/javax/transaction/RollbackException.java)
===================================================================
--- projects/javaee/trunk/transaction-api/src/main/javax/transaction/RollbackException.java (rev 0)
+++ projects/javaee/trunk/transaction-api/src/main/javax/transaction/RollbackException.java 2007-03-07 14:10:28 UTC (rev 61190)
@@ -0,0 +1,71 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY 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 along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package javax.transaction;
+
+/**
+ * The RollbackException exception indicates that either the transaction
+ * has been rolled back or an operation cannot complete because the
+ * transaction is marked for rollback only.
+ * <p>
+ * It is thrown under two circumstances:
+ * <ul>
+ * <li>
+ * At transaction commit time, if the transaction has been marked for
+ * rollback only. In this case, the <code>commit</code> method will roll
+ * back the transaction and throw this exception to indicate that the
+ * transaction could not be committed.
+ * </li>
+ * <li>
+ * At other times, if an operation cannot be completed because the
+ * transaction is marked for rollback only.
+ * The {@link Transaction#enlistResource(javax.transaction.xa.XAResource) enlistResource}
+ * and {@link Transaction#registerSynchronization(Synchronization) registerSynchronization}
+ * methods in the {@link Transaction} interface throw this exception to
+ * indicate that the operation cannot be completed because the transaction
+ * is marked for rollback only. In this case, the state of the transaction
+ * remains unchanged.
+ * </li>
+ * </ul>
+ *
+ * @version $Revision$
+ */
+public class RollbackException extends Exception
+{
+
+ /**
+ * Creates a new <code>RollbackException</code> without a detail message.
+ */
+ public RollbackException()
+ {
+ }
+
+ /**
+ * Constructs an <code>RollbackException</code> with the specified
+ * detail message.
+ *
+ * @param msg the detail message.
+ */
+ public RollbackException(String msg)
+ {
+ super(msg);
+ }
+}
Property changes on: projects/javaee/trunk/transaction-api/src/main/javax/transaction/RollbackException.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Copied: projects/javaee/trunk/transaction-api/src/main/javax/transaction/Status.java (from rev 61188, trunk/j2ee/src/main/javax/transaction/Status.java)
===================================================================
--- projects/javaee/trunk/transaction-api/src/main/javax/transaction/Status.java (rev 0)
+++ projects/javaee/trunk/transaction-api/src/main/javax/transaction/Status.java 2007-03-07 14:10:28 UTC (rev 61190)
@@ -0,0 +1,95 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY 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 along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package javax.transaction;
+
+/**
+ * The Status interface defines the constants for transaction status codes.
+ *
+ * @version $Revision$
+ */
+public interface Status
+{
+ /**
+ * Status code indicating an active transaction.
+ */
+ public static final int STATUS_ACTIVE = 0;
+
+ /**
+ * Status code indicating a transaction that has been marked for
+ * rollback only.
+ */
+ public static final int STATUS_MARKED_ROLLBACK = 1;
+
+ /**
+ * Status code indicating a transaction that has completed the first
+ * phase of the two-phase commit protocol, but not yet begun the
+ * second phase.
+ * Probably the transaction is waiting for instruction from a superior
+ * coordinator on how to proceed.
+ */
+ public static final int STATUS_PREPARED = 2;
+
+ /**
+ * Status code indicating a transaction that has been committed.
+ * Probably heuristics still exists, or the transaction would no
+ * longer exist.
+ */
+ public static final int STATUS_COMMITTED = 3;
+
+ /**
+ * Status code indicating a transaction that has been rolled back.
+ * Probably heuristics still exists, or the transaction would no
+ * longer exist.
+ */
+ public static final int STATUS_ROLLEDBACK = 4;
+
+ /**
+ * Status code indicating that the transaction status could not be
+ * determined.
+ */
+ public static final int STATUS_UNKNOWN = 5;
+
+ /**
+ * Status code indicating that no transaction exists.
+ */
+ public static final int STATUS_NO_TRANSACTION = 6;
+
+ /**
+ * Status code indicating a transaction that has begun the first
+ * phase of the two-phase commit protocol, not not yet completed
+ * this phase.
+ */
+ public static final int STATUS_PREPARING = 7;
+
+ /**
+ * Status code indicating a transaction that has begun the second
+ * phase of the two-phase commit protocol, but not yet completed
+ * this phase.
+ */
+ public static final int STATUS_COMMITTING = 8;
+
+ /**
+ * Status code indicating a transaction that is in the process of
+ * rolling back.
+ */
+ public static final int STATUS_ROLLING_BACK = 9;
+}
Property changes on: projects/javaee/trunk/transaction-api/src/main/javax/transaction/Status.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Copied: projects/javaee/trunk/transaction-api/src/main/javax/transaction/Synchronization.java (from rev 61188, trunk/j2ee/src/main/javax/transaction/Synchronization.java)
===================================================================
--- projects/javaee/trunk/transaction-api/src/main/javax/transaction/Synchronization.java (rev 0)
+++ projects/javaee/trunk/transaction-api/src/main/javax/transaction/Synchronization.java 2007-03-07 14:10:28 UTC (rev 61190)
@@ -0,0 +1,53 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY 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 along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package javax.transaction;
+
+/**
+ * This is the callback interface that has to be implemented by objects
+ * interested in receiving notification before and after a transaction
+ * commits or rolls back.
+ *
+ * An interested party can give an instance implementing this interface
+ * as an argument to the
+ * {@link Transaction#registerSynchronization(Synchronization) Transaction.registerSynchronization}
+ * method to receive callbacks before and after a transaction commits or
+ * rolls back.
+ *
+ * @version $Revision$
+ */
+public interface Synchronization
+{
+ /**
+ * This method is invoked before the start of the commit
+ * process. The method invocation is done in the context of the
+ * transaction that is about to be committed.
+ */
+ public void beforeCompletion();
+
+ /**
+ * This method is invoked after the transaction has committed or
+ * rolled back.
+ *
+ * @param status The status of the completed transaction.
+ */
+ public void afterCompletion(int status);
+}
Property changes on: projects/javaee/trunk/transaction-api/src/main/javax/transaction/Synchronization.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Copied: projects/javaee/trunk/transaction-api/src/main/javax/transaction/SystemException.java (from rev 61188, trunk/j2ee/src/main/javax/transaction/SystemException.java)
===================================================================
--- projects/javaee/trunk/transaction-api/src/main/javax/transaction/SystemException.java (rev 0)
+++ projects/javaee/trunk/transaction-api/src/main/javax/transaction/SystemException.java 2007-03-07 14:10:28 UTC (rev 61190)
@@ -0,0 +1,67 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY 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 along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package javax.transaction;
+
+/**
+ * This exception is thrown to indicate that the transaction manager has
+ * encountered an unexpected error condition that prevents future
+ * transaction services from proceeding.
+ *
+ * @version $Revision$
+ */
+public class SystemException extends Exception
+{
+ /**
+ * The error code of this exception. Values of this field are not
+ * specified by JTA.
+ */
+ public int errorCode;
+
+ /**
+ * Creates a new <code>SystemException</code> without a detail message.
+ */
+ public SystemException()
+ {
+ }
+
+ /**
+ * Constructs an <code>SystemException</code> with the specified
+ * detail message.
+ *
+ * @param msg the detail message.
+ */
+ public SystemException(String msg)
+ {
+ super(msg);
+ }
+
+ /**
+ * Constructs an <code>SystemException</code> with the specified
+ * detail message.
+ *
+ * @param errcode the error code for the exception
+ */
+ public SystemException(int errcode)
+ {
+ this.errorCode = errcode;
+ }
+}
Property changes on: projects/javaee/trunk/transaction-api/src/main/javax/transaction/SystemException.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Copied: projects/javaee/trunk/transaction-api/src/main/javax/transaction/Transaction.java (from rev 61188, trunk/j2ee/src/main/javax/transaction/Transaction.java)
===================================================================
--- projects/javaee/trunk/transaction-api/src/main/javax/transaction/Transaction.java (rev 0)
+++ projects/javaee/trunk/transaction-api/src/main/javax/transaction/Transaction.java 2007-03-07 14:10:28 UTC (rev 61190)
@@ -0,0 +1,138 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY 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 along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package javax.transaction;
+
+import java.lang.SecurityException;
+import javax.transaction.xa.XAResource;
+
+/**
+ * The Transaction interface allows operations to be performed on
+ * transactions.
+ *
+ * @version $Revision$
+ */
+public interface Transaction
+{
+ /**
+ * Attempt to commit this transaction.
+ *
+ * @throws RollbackException If the transaction was marked for rollback
+ * only, the transaction is rolled back and this exception is
+ * thrown.
+ * @throws SystemException If the transaction service fails in an
+ * unexpected way.
+ * @throws HeuristicMixedException If a heuristic decision was made and
+ * some some parts of the transaction have been committed while
+ * other parts have been rolled back.
+ * @throws HeuristicRollbackException If a heuristic decision to roll
+ * back the transaction was made.
+ * @throws SecurityException If the caller is not allowed to commit this
+ * transaction.
+ */
+ public void commit()
+ throws RollbackException, HeuristicMixedException,
+ HeuristicRollbackException, SecurityException, SystemException;
+
+ /**
+ * Rolls back this transaction.
+ *
+ * @throws IllegalStateException If the transaction is in a state
+ * where it cannot be rolled back. This could be because the
+ * transaction is no longer active, or because it is in the
+ * {@link Status#STATUS_PREPARED prepared state}.
+ * @throws SystemException If the transaction service fails in an
+ * unexpected way.
+ */
+ public void rollback()
+ throws IllegalStateException, SystemException;
+
+ /**
+ * Mark the transaction so that the only possible outcome is a rollback.
+ *
+ * @throws IllegalStateException If the transaction is not in an active
+ * state.
+ * @throws SystemException If the transaction service fails in an
+ * unexpected way.
+ */
+ public void setRollbackOnly()
+ throws IllegalStateException, SystemException;
+
+ /**
+ * Get the status of the transaction.
+ *
+ * @return The status of the transaction. This is one of the
+ * {@link Status} constants.
+ *
+ * @throws SystemException If the transaction service fails in an
+ * unexpected way.
+ */
+ public int getStatus() throws SystemException;
+
+ /**
+ * Enlist an XA resource with this transaction.
+ *
+ * @return <code>true</code> if the resource could be enlisted with
+ * this transaction, otherwise <code>false</code>.
+ *
+ * @throws RollbackException If the transaction is marked for rollback
+ * only.
+ * @throws IllegalStateException If the transaction is in a state
+ * where resources cannot be enlisted. This could be because the
+ * transaction is no longer active, or because it is in the
+ * {@link Status#STATUS_PREPARED prepared state}.
+ * @throws SystemException If the transaction service fails in an
+ * unexpected way.
+ */
+ public boolean enlistResource(XAResource xaRes)
+ throws RollbackException, IllegalStateException, SystemException;
+
+ /**
+ * Delist an XA resource from this transaction.
+ *
+ * @return <code>true</code> if the resource could be delisted from
+ * this transaction, otherwise <code>false</code>.
+ *
+ * @throws IllegalStateException If the transaction is in a state
+ * where resources cannot be delisted. This could be because the
+ * transaction is no longer active.
+ * @throws SystemException If the transaction service fails in an
+ * unexpected way.
+ */
+ public boolean delistResource(XAResource xaRes, int flag)
+ throws IllegalStateException, SystemException;
+
+ /**
+ * Register a {@link Synchronization} callback with this transaction.
+ *
+ * @throws RollbackException If the transaction is marked for rollback
+ * only.
+ * @throws IllegalStateException If the transaction is in a state
+ * where {@link Synchronization} callbacks cannot be registered.
+ * This could be because the transaction is no longer active,
+ * or because it is in the
+ * {@link Status#STATUS_PREPARED prepared state}.
+ * @throws SystemException If the transaction service fails in an
+ * unexpected way.
+ */
+ public void registerSynchronization(Synchronization sync)
+ throws RollbackException, IllegalStateException, SystemException;
+}
Property changes on: projects/javaee/trunk/transaction-api/src/main/javax/transaction/Transaction.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Copied: projects/javaee/trunk/transaction-api/src/main/javax/transaction/TransactionManager.java (from rev 61188, trunk/j2ee/src/main/javax/transaction/TransactionManager.java)
===================================================================
--- projects/javaee/trunk/transaction-api/src/main/javax/transaction/TransactionManager.java (rev 0)
+++ projects/javaee/trunk/transaction-api/src/main/javax/transaction/TransactionManager.java 2007-03-07 14:10:28 UTC (rev 61190)
@@ -0,0 +1,171 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY 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 along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package javax.transaction;
+
+/**
+ * The TransactionManager interface defines the methods that allow an
+ * application server to manage transactions on behalf of the applications.
+ * <p>
+ * User applications should not use this interface directly, but use
+ * {@link UserTransaction} insted if they need to do their own transaction
+ * management.
+ * <p>
+ * Internally, the transaction manager associates transactions with threads,
+ * and the methods here operate on the transaction associated with the
+ * calling thread.
+ *
+ * @version $Revision$
+ */
+public interface TransactionManager
+{
+ /**
+ * Starts a new transaction, and associate it with the calling thread.
+ *
+ * @throws NotSupportedException If the calling thread is already
+ * associated with a transaction, and nested transactions are
+ * not supported.
+ * @throws SystemException If the transaction service fails in an
+ * unexpected way.
+ */
+ public void begin() throws NotSupportedException, SystemException;
+
+ /**
+ * Commit the transaction associated with the calling thread.
+ *
+ * @throws RollbackException If the transaction was marked for rollback
+ * only, the transaction is rolled back and this exception is
+ * thrown.
+ * @throws IllegalStateException If the calling thread is not associated
+ * with a transaction.
+ * @throws SystemException If the transaction service fails in an
+ * unexpected way.
+ * @throws HeuristicMixedException If a heuristic decision was made and
+ * some some parts of the transaction have been committed while
+ * other parts have been rolled back.
+ * @throws HeuristicRollbackException If a heuristic decision to roll
+ * back the transaction was made.
+ * @throws SecurityException If the caller is not allowed to commit this
+ * transaction.
+ */
+ public void commit() throws RollbackException, HeuristicMixedException,
+ HeuristicRollbackException, SecurityException,
+ IllegalStateException, SystemException;
+
+ /**
+ * Rolls back the transaction associated with the calling thread.
+ *
+ * @throws IllegalStateException If the transaction is in a state
+ * where it cannot be rolled back. This could be because the
+ * calling thread is not associated with a transaction, or
+ * because it is in the
+ * {@link Status#STATUS_PREPARED prepared state}.
+ * @throws SecurityException If the caller is not allowed to roll back
+ * this transaction.
+ * @throws SystemException If the transaction service fails in an
+ * unexpected way.
+ */
+ public void rollback() throws IllegalStateException, SecurityException,
+ SystemException;
+
+ /**
+ * Mark the transaction associated with the calling thread for rollback
+ * only.
+ *
+ * @throws IllegalStateException If the transaction is in a state
+ * where it cannot be rolled back. This could be because the
+ * calling thread is not associated with a transaction, or
+ * because it is in the
+ * {@link Status#STATUS_PREPARED prepared state}.
+ * @throws SystemException If the transaction service fails in an
+ * unexpected way.
+ */
+ public void setRollbackOnly() throws IllegalStateException, SystemException;
+
+ /**
+ * Get the status of the transaction associated with the calling thread.
+ *
+ * @return The status of the transaction. This is one of the
+ * {@link Status} constants. If no transaction is associated
+ * with the calling thread,
+ * {@link Status#STATUS_NO_TRANSACTION} is returned.
+ *
+ * @throws SystemException If the transaction service fails in an
+ * unexpected way.
+ */
+ public int getStatus() throws SystemException;
+
+ /**
+ * Get the transaction associated with the calling thread.
+ *
+ * @return The transaction associated with the calling thread, or
+ * <code>null</code> if the calling thread is not associated
+ * with a transaction.
+ *
+ * @throws SystemException If the transaction service fails in an
+ * unexpected way.
+ */
+ public Transaction getTransaction() throws SystemException;
+
+ /**
+ * Change the transaction timeout for transactions started by the calling
+ * thread with the {@link #begin()} method.
+ *
+ * @param seconds The new timeout value, in seconds. If this parameter
+ * is <code>0</code>, the timeout value is reset to the default
+ * value.
+ *
+ * @throws SystemException If the transaction service fails in an
+ * unexpected way.
+ */
+ public void setTransactionTimeout(int seconds) throws SystemException;
+
+ /**
+ * Suspend the association the calling thread has to a transaction,
+ * and return the suspended transaction.
+ * When returning from this method, the calling thread is no longer
+ * associated with a transaction.
+ *
+ * @return The transaction that the calling thread was associated with,
+ * or <code>null</code> if the calling thread was not associated
+ * with a transaction.
+ *
+ * @throws SystemException If the transaction service fails in an
+ * unexpected way.
+ */
+ public Transaction suspend() throws SystemException;
+
+ /**
+ * Resume the association of the calling thread with the given
+ * transaction.
+ *
+ * @param tobj The transaction to be associated with the calling thread.
+ *
+ * @throws InvalidTransactionException If the argument does not represent
+ * a valid transaction.
+ * @throws IllegalStateException If the calling thread is already
+ * associated with a transaction.
+ * @throws SystemException If the transaction service fails in an
+ * unexpected way.
+ */
+ public void resume(Transaction tobj) throws InvalidTransactionException,
+ IllegalStateException, SystemException;
+}
Property changes on: projects/javaee/trunk/transaction-api/src/main/javax/transaction/TransactionManager.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Copied: projects/javaee/trunk/transaction-api/src/main/javax/transaction/TransactionRequiredException.java (from rev 61188, trunk/j2ee/src/main/javax/transaction/TransactionRequiredException.java)
===================================================================
--- projects/javaee/trunk/transaction-api/src/main/javax/transaction/TransactionRequiredException.java (rev 0)
+++ projects/javaee/trunk/transaction-api/src/main/javax/transaction/TransactionRequiredException.java 2007-03-07 14:10:28 UTC (rev 61190)
@@ -0,0 +1,53 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY 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 along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package javax.transaction;
+
+import java.rmi.RemoteException;
+
+/**
+ * This exception indicates that a remote invocation request carried a null
+ * transaction context, but that an active transaction context was needed.
+ *
+ * @version $Revision$
+ */
+public class TransactionRequiredException extends RemoteException
+{
+
+ /**
+ * Creates a new <code>TransactionRequiredException</code> without a
+ * detail message.
+ */
+ public TransactionRequiredException()
+ {
+ }
+
+ /**
+ * Constructs an <code>TransactionRequiredException</code> with the
+ * specified detail message.
+ *
+ * @param msg the detail message.
+ */
+ public TransactionRequiredException(String msg)
+ {
+ super(msg);
+ }
+}
Property changes on: projects/javaee/trunk/transaction-api/src/main/javax/transaction/TransactionRequiredException.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Copied: projects/javaee/trunk/transaction-api/src/main/javax/transaction/TransactionRolledbackException.java (from rev 61188, trunk/j2ee/src/main/javax/transaction/TransactionRolledbackException.java)
===================================================================
--- projects/javaee/trunk/transaction-api/src/main/javax/transaction/TransactionRolledbackException.java (rev 0)
+++ projects/javaee/trunk/transaction-api/src/main/javax/transaction/TransactionRolledbackException.java 2007-03-07 14:10:28 UTC (rev 61190)
@@ -0,0 +1,56 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY 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 along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package javax.transaction;
+
+import java.rmi.RemoteException;
+
+/**
+ * This exception indicates that the transaction context carried in the
+ * remote invocation has been rolled back, or was marked for roll back only.
+ *
+ * This indicates to the client that further computation on behalf of this
+ * transaction would be fruitless.
+ *
+ * @version $Revision$
+ */
+public class TransactionRolledbackException extends RemoteException
+{
+
+ /**
+ * Creates a new <code>TransactionRolledbackException</code> without
+ * a detail message.
+ */
+ public TransactionRolledbackException()
+ {
+ }
+
+ /**
+ * Constructs an <code>TransactionRolledbackException</code> with the
+ * specified detail message.
+ *
+ * @param msg the detail message.
+ */
+ public TransactionRolledbackException(String msg)
+ {
+ super(msg);
+ }
+}
Property changes on: projects/javaee/trunk/transaction-api/src/main/javax/transaction/TransactionRolledbackException.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Copied: projects/javaee/trunk/transaction-api/src/main/javax/transaction/TransactionSynchronizationRegistry.java (from rev 61188, trunk/j2ee/src/main/javax/transaction/TransactionSynchronizationRegistry.java)
===================================================================
--- projects/javaee/trunk/transaction-api/src/main/javax/transaction/TransactionSynchronizationRegistry.java (rev 0)
+++ projects/javaee/trunk/transaction-api/src/main/javax/transaction/TransactionSynchronizationRegistry.java 2007-03-07 14:10:28 UTC (rev 61190)
@@ -0,0 +1,101 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY 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 along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package javax.transaction;
+
+/**
+ * TransactionSynchronizationRegistry.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision$
+ */
+public interface TransactionSynchronizationRegistry
+{
+ /**
+ * An object that has the same equals/hashCode behaviour
+ * as the transaction currently associated with the thread
+ *
+ * @return the key or null if there is no current transaction
+ */
+ Object getTransactionKey();
+
+ /**
+ * Get the transaction status of the current thread
+ *
+ * @return the status
+ */
+ int getTransactionStatus();
+
+ /**
+ * Get the rollback status of the transaction associated with the
+ * current thread.
+ *
+ * @return true when the transaction is rollback only
+ * @throws IllegalStateException if there is no current transaction
+ */
+ boolean getRollbackOnly() throws IllegalStateException;
+
+ /**
+ * Set the transaction associated with the current thread to force a rollback
+ *
+ * @throws IllegalStateException if there is no current transaction
+ */
+ void setRollbackOnly() throws IllegalStateException;
+
+ /**
+ * Add a transaction synchronization that is invoked "last",
+ * i.e. after SessionSynchronizations and directly registered transaction synchronizations.<p>
+ *
+ * The beforeCompletion is invoked in the context of the transaction,
+ * the afterCompletion in an undefined transaction context.
+ * Other context is the same as when the one used to register the synchronization.<p>
+ *
+ * Access to "user components" is not allowed, e.g. ejb bean methods.<p>
+ *
+ * Access to other resources, e.g. jca, is allowed in the beforeCompletion,
+ * but not transactional work is allowed in the afterCompletion. e.g.
+ * typically only "close()" is allowed.
+ *
+ * @param sync the synchronization
+ * @throws IllegalStateException if there is no current transaction
+ */
+ void registerInterposedSynchronization(Synchronization sync) throws IllegalStateException;
+
+ /**
+ * Get a transaction local for the current transaction
+ *
+ * @param key the key to the value
+ * @return the value
+ * @throws IllegalStateException if there is no current transaction
+ * @throws NullPointerException if the key is null
+ */
+ Object getResource(Object key) throws IllegalStateException;
+
+ /**
+ * Set a transaction local for the current transaction
+ *
+ * @param key the key to the value
+ * @param value the value
+ * @throws IllegalStateException if there is no current transaction
+ * @throws NullPointerException if the key is null
+ */
+ void putResource(Object key, Object value) throws IllegalStateException;
+}
Property changes on: projects/javaee/trunk/transaction-api/src/main/javax/transaction/TransactionSynchronizationRegistry.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Copied: projects/javaee/trunk/transaction-api/src/main/javax/transaction/UserTransaction.java (from rev 61188, trunk/j2ee/src/main/javax/transaction/UserTransaction.java)
===================================================================
--- projects/javaee/trunk/transaction-api/src/main/javax/transaction/UserTransaction.java (rev 0)
+++ projects/javaee/trunk/transaction-api/src/main/javax/transaction/UserTransaction.java 2007-03-07 14:10:28 UTC (rev 61190)
@@ -0,0 +1,119 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY 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 along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package javax.transaction;
+
+/**
+ * This interface allows an application to explicitly manage transactions.
+ *
+ * @version $Revision$
+ */
+public interface UserTransaction
+{
+ /**
+ * Starts a new transaction, and associate it with the calling thread.
+ *
+ * @throws NotSupportedException If the calling thread is already
+ * associated with a transaction, and nested transactions are
+ * not supported.
+ * @throws SystemException If the transaction service fails in an
+ * unexpected way.
+ */
+ public void begin() throws NotSupportedException, SystemException;
+
+ /**
+ * Commit the transaction associated with the calling thread.
+ *
+ * @throws RollbackException If the transaction was marked for rollback
+ * only, the transaction is rolled back and this exception is
+ * thrown.
+ * @throws IllegalStateException If the calling thread is not associated
+ * with a transaction.
+ * @throws SystemException If the transaction service fails in an
+ * unexpected way.
+ * @throws HeuristicMixedException If a heuristic decision was made and
+ * some some parts of the transaction have been committed while
+ * other parts have been rolled back.
+ * @throws HeuristicRollbackException If a heuristic decision to roll
+ * back the transaction was made.
+ * @throws SecurityException If the caller is not allowed to commit this
+ * transaction.
+ */
+ public void commit() throws RollbackException, HeuristicMixedException,
+ HeuristicRollbackException, SecurityException,
+ IllegalStateException, SystemException;
+
+ /**
+ * Rolls back the transaction associated with the calling thread.
+ *
+ * @throws IllegalStateException If the transaction is in a state
+ * where it cannot be rolled back. This could be because the
+ * calling thread is not associated with a transaction, or
+ * because it is in the
+ * {@link Status#STATUS_PREPARED prepared state}.
+ * @throws SecurityException If the caller is not allowed to roll back
+ * this transaction.
+ * @throws SystemException If the transaction service fails in an
+ * unexpected way.
+ */
+ public void rollback() throws IllegalStateException, SecurityException,
+ SystemException;
+
+ /**
+ * Mark the transaction associated with the calling thread for rollback
+ * only.
+ *
+ * @throws IllegalStateException If the transaction is in a state
+ * where it cannot be rolled back. This could be because the
+ * calling thread is not associated with a transaction, or
+ * because it is in the
+ * {@link Status#STATUS_PREPARED prepared state}.
+ * @throws SystemException If the transaction service fails in an
+ * unexpected way.
+ */
+ public void setRollbackOnly() throws IllegalStateException, SystemException;
+
+ /**
+ * Get the status of the transaction associated with the calling thread.
+ *
+ * @return The status of the transaction. This is one of the
+ * {@link Status} constants. If no transaction is associated
+ * with the calling thread,
+ * {@link Status#STATUS_NO_TRANSACTION} is returned.
+ *
+ * @throws SystemException If the transaction service fails in an
+ * unexpected way.
+ */
+ public int getStatus() throws SystemException;
+
+ /**
+ * Change the transaction timeout for transactions started by the calling
+ * thread with the {@link #begin()} method.
+ *
+ * @param seconds The new timeout value, in seconds. If this parameter
+ * is <code>0</code>, the timeout value is reset to the default
+ * value.
+ *
+ * @throws SystemException If the transaction service fails in an
+ * unexpected way.
+ */
+ public void setTransactionTimeout(int seconds) throws SystemException;
+}
Property changes on: projects/javaee/trunk/transaction-api/src/main/javax/transaction/UserTransaction.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Copied: projects/javaee/trunk/transaction-api/src/main/javax/transaction/xa (from rev 61188, trunk/j2ee/src/main/javax/transaction/xa)
Deleted: projects/javaee/trunk/transaction-api/src/main/javax/transaction/xa/XAException.java
===================================================================
--- trunk/j2ee/src/main/javax/transaction/xa/XAException.java 2007-03-07 13:37:51 UTC (rev 61188)
+++ projects/javaee/trunk/transaction-api/src/main/javax/transaction/xa/XAException.java 2007-03-07 14:10:28 UTC (rev 61190)
@@ -1,221 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY 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 along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-package javax.transaction.xa;
-
-/**
- * The XAException is thrown by resource managers in case of problems.
- *
- * @version $Revision$
- */
-public class XAException extends java.lang.Exception {
-
- /**
- * The error code.
- */
- public int errorCode = 0;
-
- /**
- * Creates new <code>XAException</code> without detail message.
- */
- public XAException() {
- }
-
- /**
- * Constructs an <code>XAException</code> with the specified detail
- * message.
- *
- * @param msg the detail message.
- */
- public XAException(String msg) {
- super(msg);
- }
-
- /**
- * Constructs an <code>XAException</code> for the specified error code.
- *
- * @param errorCode the error code.
- */
- public XAException(int errorCode) {
- super();
- this.errorCode = errorCode;
- }
-
- // STATIC VARIABLES ---------------------------------
-
- // changed numbers to match SUNs by pkendall for interoperability
-
- // added by kimptoc - needed for jbossmq to compile...
- // others added by jwalters for completeness
-
- /**
- * Error code indicating that an asynchronous operation is outstanding.
- */
- public static final int XAER_ASYNC = -2;
-
- /**
- * Error code indicating that a resource manager error has occurred.
- */
- public static final int XAER_RMERR = -3;
-
- /**
- * Error code indicating that an {@link Xid} is not valid.
- */
- public static final int XAER_NOTA = -4;
-
- /**
- * Error code indicating that invalid arguments were passed.
- */
- public static final int XAER_INVAL = -5;
-
- /**
- * Error code indicating a protocol error. This happens if a method
- * is invoked on a resource when it is not in the correct state for it.
- */
- public static final int XAER_PROTO = -6;
-
- /**
- * Error code indicating that the resource manager has failed and is
- * not available.
- */
- public static final int XAER_RMFAIL = -7;
-
- /**
- * Error code indicating that a Xid given as an argument is already
- * known to the resource manager.
- */
- public static final int XAER_DUPID = -8;
-
- /**
- * Error code indicating that the resource manager is doing work
- * outside the global transaction.
- */
- public static final int XAER_OUTSIDE = -9;
-
- // added by jwalters - needed for jboss
-
- /**
- * Error code indicating that the transaction branch was read-only,
- * and has already been committed.
- */
- public static final int XA_RDONLY = 3;
-
- /**
- * Error code indicating that the method invoked returned without having
- * any effect, and that it may be invoked again.
- * Note that this constant is not defined in JTA 1.0.1, but appears in
- * J2EE(TM) as shipped by SUN.
- */
- public static final int XA_RETRY = 4;
-
- /**
- * Error code indicating that a heuristic mixed decision was made.
- * This indicates that parts of the transaction were committed,
- * while other parts were rolled back.
- */
- public static final int XA_HEURMIX = 5;
-
- /**
- * Error code indicating that a heuristic rollback decision was made.
- */
- public static final int XA_HEURRB = 6;
-
- /**
- * Error code indicating that a heuristic commit decision was made.
- */
- public static final int XA_HEURCOM = 7;
-
- /**
- * Error code indicating that a heuristic decision may have been made.
- * The outcome of all parts of the transaction is not known, but the
- * outcome of the known parts are either all committed, or all rolled
- * back.
- */
- public static final int XA_HEURHAZ = 8;
-
- /**
- * Error code indicating that the transaction resumption must happen
- * where the suspension occurred.
- */
- public static final int XA_NOMIGRATE = 9;
-
- /**
- * This is not an error code, but the same as the rollback error code
- * with the lowest number.
- */
- public static final int XA_RBBASE = 100;
-
- /**
- * Rollback error code indicating that the rollback happened for
- * an unspecified reason.
- */
- public static final int XA_RBROLLBACK = 100;
-
- /**
- * Rollback error code indicating that the rollback happened due to a
- * communications failure.
- */
- public static final int XA_RBCOMMFAIL = 101;
-
- /**
- * Rollback error code indicating that the rollback happened because
- * deadlock was detected.
- */
- public static final int XA_RBDEADLOCK = 102;
-
- /**
- * Rollback error code indicating that the rollback happened because
- * an internal integrity check failed.
- */
- public static final int XA_RBINTEGRITY = 103;
-
- /**
- * Rollback error code indicating that the rollback happened for some
- * reason not fitting any of the other rollback error codes.
- */
- public static final int XA_RBOTHER = 104;
-
- /**
- * Rollback error code indicating that the rollback happened due to
- * a protocol error in the resource manager.
- */
- public static final int XA_RBPROTO = 105;
-
- /**
- * Rollback error code indicating that the rollback happened because
- * of a timeout.
- */
- public static final int XA_RBTIMEOUT = 106;
-
- /**
- * Rollback error code indicating that the rollback happened due to a
- * transient failure. The transaction branch may be retried.
- */
- public static final int XA_RBTRANSIENT = 107;
-
- /**
- * This is not an error code, but the same as the rollback error code
- * with the highest number.
- */
- public static final int XA_RBEND = 107;
-}
-
-
Copied: projects/javaee/trunk/transaction-api/src/main/javax/transaction/xa/XAException.java (from rev 61188, trunk/j2ee/src/main/javax/transaction/xa/XAException.java)
===================================================================
--- projects/javaee/trunk/transaction-api/src/main/javax/transaction/xa/XAException.java (rev 0)
+++ projects/javaee/trunk/transaction-api/src/main/javax/transaction/xa/XAException.java 2007-03-07 14:10:28 UTC (rev 61190)
@@ -0,0 +1,221 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY 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 along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package javax.transaction.xa;
+
+/**
+ * The XAException is thrown by resource managers in case of problems.
+ *
+ * @version $Revision$
+ */
+public class XAException extends java.lang.Exception {
+
+ /**
+ * The error code.
+ */
+ public int errorCode = 0;
+
+ /**
+ * Creates new <code>XAException</code> without detail message.
+ */
+ public XAException() {
+ }
+
+ /**
+ * Constructs an <code>XAException</code> with the specified detail
+ * message.
+ *
+ * @param msg the detail message.
+ */
+ public XAException(String msg) {
+ super(msg);
+ }
+
+ /**
+ * Constructs an <code>XAException</code> for the specified error code.
+ *
+ * @param errorCode the error code.
+ */
+ public XAException(int errorCode) {
+ super();
+ this.errorCode = errorCode;
+ }
+
+ // STATIC VARIABLES ---------------------------------
+
+ // changed numbers to match SUNs by pkendall for interoperability
+
+ // added by kimptoc - needed for jbossmq to compile...
+ // others added by jwalters for completeness
+
+ /**
+ * Error code indicating that an asynchronous operation is outstanding.
+ */
+ public static final int XAER_ASYNC = -2;
+
+ /**
+ * Error code indicating that a resource manager error has occurred.
+ */
+ public static final int XAER_RMERR = -3;
+
+ /**
+ * Error code indicating that an {@link Xid} is not valid.
+ */
+ public static final int XAER_NOTA = -4;
+
+ /**
+ * Error code indicating that invalid arguments were passed.
+ */
+ public static final int XAER_INVAL = -5;
+
+ /**
+ * Error code indicating a protocol error. This happens if a method
+ * is invoked on a resource when it is not in the correct state for it.
+ */
+ public static final int XAER_PROTO = -6;
+
+ /**
+ * Error code indicating that the resource manager has failed and is
+ * not available.
+ */
+ public static final int XAER_RMFAIL = -7;
+
+ /**
+ * Error code indicating that a Xid given as an argument is already
+ * known to the resource manager.
+ */
+ public static final int XAER_DUPID = -8;
+
+ /**
+ * Error code indicating that the resource manager is doing work
+ * outside the global transaction.
+ */
+ public static final int XAER_OUTSIDE = -9;
+
+ // added by jwalters - needed for jboss
+
+ /**
+ * Error code indicating that the transaction branch was read-only,
+ * and has already been committed.
+ */
+ public static final int XA_RDONLY = 3;
+
+ /**
+ * Error code indicating that the method invoked returned without having
+ * any effect, and that it may be invoked again.
+ * Note that this constant is not defined in JTA 1.0.1, but appears in
+ * J2EE(TM) as shipped by SUN.
+ */
+ public static final int XA_RETRY = 4;
+
+ /**
+ * Error code indicating that a heuristic mixed decision was made.
+ * This indicates that parts of the transaction were committed,
+ * while other parts were rolled back.
+ */
+ public static final int XA_HEURMIX = 5;
+
+ /**
+ * Error code indicating that a heuristic rollback decision was made.
+ */
+ public static final int XA_HEURRB = 6;
+
+ /**
+ * Error code indicating that a heuristic commit decision was made.
+ */
+ public static final int XA_HEURCOM = 7;
+
+ /**
+ * Error code indicating that a heuristic decision may have been made.
+ * The outcome of all parts of the transaction is not known, but the
+ * outcome of the known parts are either all committed, or all rolled
+ * back.
+ */
+ public static final int XA_HEURHAZ = 8;
+
+ /**
+ * Error code indicating that the transaction resumption must happen
+ * where the suspension occurred.
+ */
+ public static final int XA_NOMIGRATE = 9;
+
+ /**
+ * This is not an error code, but the same as the rollback error code
+ * with the lowest number.
+ */
+ public static final int XA_RBBASE = 100;
+
+ /**
+ * Rollback error code indicating that the rollback happened for
+ * an unspecified reason.
+ */
+ public static final int XA_RBROLLBACK = 100;
+
+ /**
+ * Rollback error code indicating that the rollback happened due to a
+ * communications failure.
+ */
+ public static final int XA_RBCOMMFAIL = 101;
+
+ /**
+ * Rollback error code indicating that the rollback happened because
+ * deadlock was detected.
+ */
+ public static final int XA_RBDEADLOCK = 102;
+
+ /**
+ * Rollback error code indicating that the rollback happened because
+ * an internal integrity check failed.
+ */
+ public static final int XA_RBINTEGRITY = 103;
+
+ /**
+ * Rollback error code indicating that the rollback happened for some
+ * reason not fitting any of the other rollback error codes.
+ */
+ public static final int XA_RBOTHER = 104;
+
+ /**
+ * Rollback error code indicating that the rollback happened due to
+ * a protocol error in the resource manager.
+ */
+ public static final int XA_RBPROTO = 105;
+
+ /**
+ * Rollback error code indicating that the rollback happened because
+ * of a timeout.
+ */
+ public static final int XA_RBTIMEOUT = 106;
+
+ /**
+ * Rollback error code indicating that the rollback happened due to a
+ * transient failure. The transaction branch may be retried.
+ */
+ public static final int XA_RBTRANSIENT = 107;
+
+ /**
+ * This is not an error code, but the same as the rollback error code
+ * with the highest number.
+ */
+ public static final int XA_RBEND = 107;
+}
+
+
Property changes on: projects/javaee/trunk/transaction-api/src/main/javax/transaction/xa/XAException.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Deleted: projects/javaee/trunk/transaction-api/src/main/javax/transaction/xa/XAResource.java
===================================================================
--- trunk/j2ee/src/main/javax/transaction/xa/XAResource.java 2007-03-07 13:37:51 UTC (rev 61188)
+++ projects/javaee/trunk/transaction-api/src/main/javax/transaction/xa/XAResource.java 2007-03-07 14:10:28 UTC (rev 61190)
@@ -1,289 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY 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 along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-package javax.transaction.xa;
-
-/**
- * The XAResource interface is a Java mapping of the industry standard XA
- * interface based on the X/Open CAE Specification (Distributed Transaction
- * Processing: The XA Specification).
- * <p>
- * The XA interface defines the contract between a Resource Manager and a
- * Transaction Manager in a distributed transaction processing (DTP)
- * environment.
- * An XA resource such as a JDBC driver or a JMS provider implements this
- * interface to support association between a global transaction and a
- * database or message service connection.
- * <p>
- * The XAResource interface can be supported by any transactional resource
- * that is intended to be used by application programs in an environment
- * where transactions are controlled by an external transaction manager.
- * An example of such a resource is a database management system.
- * An application may access data through multiple database connections.
- * Each database connection is enlisted with the transaction manager as a
- * transactional resource. The transaction manager obtains an XAResource for
- * each connection participating in a global transaction. The transaction
- * manager uses the {@link #start(Xid, int) start} method to associate the
- * global transaction with the resource, and it uses the
- * {@link #end(Xid, int) end} method to disassociate the transaction from
- * the resource.
- * The resource manager is responsible for associating the global
- * transaction to all work performed on its data between the start and
- * end method invocation.
- * <p>
- * At transaction commit time, the resource managers are informed by the
- * transaction manager to prepare, commit, or rollback a transaction
- * according to the two-phase commit protocol.
- * <p>
- * Behind the resources that implement this interface the resource manager
- * exists. The resource manager does not have a public interface or direct
- * references, and can manage several resources.
- * To see if two resources are managed by the same resource manager, the
- * {@link #isSameRM(XAResource)} method can be used.
- *
- * @version $Revision$
- */
-public interface XAResource
-{
- /**
- * Flag value indicating that no flags are set.
- */
- public static final int TMNOFLAGS = 0;
-
- /**
- * JTA specifies this constant and states that it indicates that the
- * caller is using one-phase optimization, but this constant seems
- * not to be used by JTA.
- */
- public static final int TMONEPHASE = 1073741824;
-
- /**
- * Flag value for the {@link #start(Xid, int) start} method indicating
- * that the resource should associate with a transaction previously seen
- * by this resource manager.
- */
- public static final int TMJOIN = 2097152;
-
- /**
- * Flag value for the {@link #start(Xid, int) start} method indicating
- * that the resource should associate with a transaction where the
- * association was suspended.
- */
- public static final int TMRESUME = 134217728;
-
- /**
- * Flag value for the {@link #end(Xid, int) end} method indicating that
- * the transaction should be disassociated, and that the work has
- * completed sucessfully.
- */
- public static final int TMSUCCESS = 67108864;
-
- /**
- * Flag value for the {@link #end(Xid, int) end} method indicating that
- * the transaction should be disassociated, and that the work has
- * failed
- */
- public static final int TMFAIL = 536870912;
-
- /**
- * Flag value for the {@link #end(Xid, int) end} method indicating that
- * the resource should temporarily suspend the association with the
- * transaction.
- */
- public static final int TMSUSPEND = 33554432;
-
- /**
- * Value returned from the {@link #prepare(Xid) prepare} method to
- * indicate that the resource was not changed in this transaction.
- */
- public static final int XA_RDONLY = 3;
-
- /**
- * Value returned from the {@link #prepare(Xid) prepare} method to
- * indicate that the resource has successfully prepared to commit
- * the transaction.
- */
- public static final int XA_OK = 0;
-
- /**
- * Flag value for the {@link #recover(int) recover} method indicating
- * that the resource manager should start a new recovery scan.
- */
- public static final int TMSTARTRSCAN = 16777216;
-
- /**
- * Flag value for the {@link #recover(int) recover} method indicating
- * that the resource manager should end the current recovery scan.
- */
- public static final int TMENDRSCAN = 8388608;
-
-
- /**
- * Called to associate the resource with a transaction.
- *
- * If the flags argument is {@link #TMNOFLAGS}, the transaction must not
- * previously have been seen by this resource manager, or an
- * {@link XAException} with error code XAER_DUPID will be thrown.
- *
- * If the flags argument is {@link #TMJOIN}, the resource will join a
- * transaction previously seen by tis resource manager.
- *
- * If the flags argument is {@link #TMRESUME} the resource will
- * resume the transaction association that was suspended with
- * end(TMSUSPEND).
- *
- * @param xid The id of the transaction to associate with.
- * @param flags Must be either {@link #TMNOFLAGS}, {@link #TMJOIN}
- * or {@link #TMRESUME}.
- * @throws XAException If an error occurred.
- */
- public void start(Xid xid, int flags) throws XAException;
-
- /**
- * Called to disassociate the resource from a transaction.
- *
- * If the flags argument is {@link #TMSUCCESS}, the portion of work
- * was done sucessfully.
- *
- * If the flags argument is {@link #TMFAIL}, the portion of work
- * failed. The resource manager may mark the transaction for
- * rollback only to avoid the transaction being committed.
- *
- * If the flags argument is {@link #TMSUSPEND} the resource will
- * temporarily suspend the transaction association. The transaction
- * must later be re-associated by giving the {@link #TMRESUME} flag
- * to the {@link #start(Xid,int) start} method.
- *
- * @param xid The id of the transaction to disassociate from.
- * @param flags Must be either {@link #TMSUCCESS}, {@link #TMFAIL}
- * or {@link #TMSUSPEND}.
- * @throws XAException If an error occurred.
- */
- public void end(Xid xid, int flags) throws XAException;
-
- /**
- * Prepare to commit the work done on this resource in the given
- * transaction.
- *
- * This method cannot return a status indicating that the transaction
- * should be rolled back. If the resource wants the transaction to
- * be rolled back, it should throw an <code>XAException</code> at the
- * caller.
- *
- * @param xid The id of the transaction to prepare to commit work for.
- * @return Either {@link #XA_OK} or {@link #XA_RDONLY}.
- * @throws XAException If an error occurred.
- */
- public int prepare(Xid xid) throws XAException;
-
- /**
- * Commit the work done on this resource in the given transaction.
- *
- * If the <code>onePhase</code> argument is true, one-phase
- * optimization is being used, and the {@link #prepare(Xid) prepare}
- * method must not have been called for this transaction.
- * Otherwise, this is the second phase of the two-phase commit protocol.
- *
- * @param xid The id of the transaction to commit work for.
- * @param onePhase If true, the transaction manager is using one-phase
- * optimization.
- * @throws XAException If an error occurred.
- */
- public void commit(Xid xid, boolean onePhase) throws XAException;
-
- /**
- * Roll back the work done on this resource in the given transaction.
- *
- * @param xid The id of the transaction to commit work for.
- * @throws XAException If an error occurred.
- */
- public void rollback(Xid xid) throws XAException;
-
- /**
- * Tells the resource manager to forget about a heuristic decision.
- *
- * @param xid The id of the transaction that was ended with a heuristic
- * decision.
- * @throws XAException If an error occurred.
- */
- public void forget(Xid xid) throws XAException;
-
- /**
- * Return a list of transactions that are in a prepared or heuristically
- * state.
- *
- * This method looks not only at the resource it is invoked on, but
- * also on all other resources managed by the same resource manager.
- * It is intended to be used by the application server when recovering
- * after a server crash.
- * <p>
- * A recovery scan is done with one or more calls to this method.
- * At the first call, {@link #TMSTARTRSCAN} must be in the
- * <code>flag</code> argument to indicate that the scan should be started.
- * During the recovery scan, the resource manager maintains an internal
- * cursor that keeps track of the progress of the recovery scan.
- * To end the recovery scan, the {@link #TMENDRSCAN} must be passed
- * in the <code>flag</code> argument.
- *
- * @param flag Must be either {@link #TMNOFLAGS}, {@link #TMSTARTRSCAN},
- * {@link #TMENDRSCAN} or <code>TMSTARTRSCAN|TMENDRSCAN</code>.
- * @return An array of zero or more transaction ids.
- * @throws XAException If an error occurred.
- */
- public Xid[] recover(int flag) throws XAException;
-
- /**
- * Tells the caller if this resource has the same resource manager
- * as the argument resource.
- *
- * The transaction manager needs this method to be able to decide
- * if the {@link #start(Xid,int) start} method should be given the
- * {@link #TMJOIN} flag.
- *
- * @throws XAException If an error occurred.
- */
- public boolean isSameRM(XAResource xaRes) throws XAException;
-
- /**
- * Get the current transaction timeout value for this resource.
- *
- * @return The current timeout value, in seconds.
- * @throws XAException If an error occurred.
- */
- public int getTransactionTimeout() throws XAException;
-
- /**
- * Set the transaction timeout value for this resource.
- *
- * If the <code>seconds</code> argument is <code>0</code>, the
- * timeout value is set to the default timeout value of the resource
- * manager.
- *
- * Not all resource managers support setting the timeout value.
- * If the resource manager does not support setting the timeout
- * value, it should return false.
- *
- * @param seconds The timeout value, in seconds.
- * @return True if the timeout value could be set, otherwise false.
- * @throws XAException If an error occurred.
- */
- public boolean setTransactionTimeout(int seconds) throws XAException;
-}
Copied: projects/javaee/trunk/transaction-api/src/main/javax/transaction/xa/XAResource.java (from rev 61188, trunk/j2ee/src/main/javax/transaction/xa/XAResource.java)
===================================================================
--- projects/javaee/trunk/transaction-api/src/main/javax/transaction/xa/XAResource.java (rev 0)
+++ projects/javaee/trunk/transaction-api/src/main/javax/transaction/xa/XAResource.java 2007-03-07 14:10:28 UTC (rev 61190)
@@ -0,0 +1,289 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY 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 along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package javax.transaction.xa;
+
+/**
+ * The XAResource interface is a Java mapping of the industry standard XA
+ * interface based on the X/Open CAE Specification (Distributed Transaction
+ * Processing: The XA Specification).
+ * <p>
+ * The XA interface defines the contract between a Resource Manager and a
+ * Transaction Manager in a distributed transaction processing (DTP)
+ * environment.
+ * An XA resource such as a JDBC driver or a JMS provider implements this
+ * interface to support association between a global transaction and a
+ * database or message service connection.
+ * <p>
+ * The XAResource interface can be supported by any transactional resource
+ * that is intended to be used by application programs in an environment
+ * where transactions are controlled by an external transaction manager.
+ * An example of such a resource is a database management system.
+ * An application may access data through multiple database connections.
+ * Each database connection is enlisted with the transaction manager as a
+ * transactional resource. The transaction manager obtains an XAResource for
+ * each connection participating in a global transaction. The transaction
+ * manager uses the {@link #start(Xid, int) start} method to associate the
+ * global transaction with the resource, and it uses the
+ * {@link #end(Xid, int) end} method to disassociate the transaction from
+ * the resource.
+ * The resource manager is responsible for associating the global
+ * transaction to all work performed on its data between the start and
+ * end method invocation.
+ * <p>
+ * At transaction commit time, the resource managers are informed by the
+ * transaction manager to prepare, commit, or rollback a transaction
+ * according to the two-phase commit protocol.
+ * <p>
+ * Behind the resources that implement this interface the resource manager
+ * exists. The resource manager does not have a public interface or direct
+ * references, and can manage several resources.
+ * To see if two resources are managed by the same resource manager, the
+ * {@link #isSameRM(XAResource)} method can be used.
+ *
+ * @version $Revision$
+ */
+public interface XAResource
+{
+ /**
+ * Flag value indicating that no flags are set.
+ */
+ public static final int TMNOFLAGS = 0;
+
+ /**
+ * JTA specifies this constant and states that it indicates that the
+ * caller is using one-phase optimization, but this constant seems
+ * not to be used by JTA.
+ */
+ public static final int TMONEPHASE = 1073741824;
+
+ /**
+ * Flag value for the {@link #start(Xid, int) start} method indicating
+ * that the resource should associate with a transaction previously seen
+ * by this resource manager.
+ */
+ public static final int TMJOIN = 2097152;
+
+ /**
+ * Flag value for the {@link #start(Xid, int) start} method indicating
+ * that the resource should associate with a transaction where the
+ * association was suspended.
+ */
+ public static final int TMRESUME = 134217728;
+
+ /**
+ * Flag value for the {@link #end(Xid, int) end} method indicating that
+ * the transaction should be disassociated, and that the work has
+ * completed sucessfully.
+ */
+ public static final int TMSUCCESS = 67108864;
+
+ /**
+ * Flag value for the {@link #end(Xid, int) end} method indicating that
+ * the transaction should be disassociated, and that the work has
+ * failed
+ */
+ public static final int TMFAIL = 536870912;
+
+ /**
+ * Flag value for the {@link #end(Xid, int) end} method indicating that
+ * the resource should temporarily suspend the association with the
+ * transaction.
+ */
+ public static final int TMSUSPEND = 33554432;
+
+ /**
+ * Value returned from the {@link #prepare(Xid) prepare} method to
+ * indicate that the resource was not changed in this transaction.
+ */
+ public static final int XA_RDONLY = 3;
+
+ /**
+ * Value returned from the {@link #prepare(Xid) prepare} method to
+ * indicate that the resource has successfully prepared to commit
+ * the transaction.
+ */
+ public static final int XA_OK = 0;
+
+ /**
+ * Flag value for the {@link #recover(int) recover} method indicating
+ * that the resource manager should start a new recovery scan.
+ */
+ public static final int TMSTARTRSCAN = 16777216;
+
+ /**
+ * Flag value for the {@link #recover(int) recover} method indicating
+ * that the resource manager should end the current recovery scan.
+ */
+ public static final int TMENDRSCAN = 8388608;
+
+
+ /**
+ * Called to associate the resource with a transaction.
+ *
+ * If the flags argument is {@link #TMNOFLAGS}, the transaction must not
+ * previously have been seen by this resource manager, or an
+ * {@link XAException} with error code XAER_DUPID will be thrown.
+ *
+ * If the flags argument is {@link #TMJOIN}, the resource will join a
+ * transaction previously seen by tis resource manager.
+ *
+ * If the flags argument is {@link #TMRESUME} the resource will
+ * resume the transaction association that was suspended with
+ * end(TMSUSPEND).
+ *
+ * @param xid The id of the transaction to associate with.
+ * @param flags Must be either {@link #TMNOFLAGS}, {@link #TMJOIN}
+ * or {@link #TMRESUME}.
+ * @throws XAException If an error occurred.
+ */
+ public void start(Xid xid, int flags) throws XAException;
+
+ /**
+ * Called to disassociate the resource from a transaction.
+ *
+ * If the flags argument is {@link #TMSUCCESS}, the portion of work
+ * was done sucessfully.
+ *
+ * If the flags argument is {@link #TMFAIL}, the portion of work
+ * failed. The resource manager may mark the transaction for
+ * rollback only to avoid the transaction being committed.
+ *
+ * If the flags argument is {@link #TMSUSPEND} the resource will
+ * temporarily suspend the transaction association. The transaction
+ * must later be re-associated by giving the {@link #TMRESUME} flag
+ * to the {@link #start(Xid,int) start} method.
+ *
+ * @param xid The id of the transaction to disassociate from.
+ * @param flags Must be either {@link #TMSUCCESS}, {@link #TMFAIL}
+ * or {@link #TMSUSPEND}.
+ * @throws XAException If an error occurred.
+ */
+ public void end(Xid xid, int flags) throws XAException;
+
+ /**
+ * Prepare to commit the work done on this resource in the given
+ * transaction.
+ *
+ * This method cannot return a status indicating that the transaction
+ * should be rolled back. If the resource wants the transaction to
+ * be rolled back, it should throw an <code>XAException</code> at the
+ * caller.
+ *
+ * @param xid The id of the transaction to prepare to commit work for.
+ * @return Either {@link #XA_OK} or {@link #XA_RDONLY}.
+ * @throws XAException If an error occurred.
+ */
+ public int prepare(Xid xid) throws XAException;
+
+ /**
+ * Commit the work done on this resource in the given transaction.
+ *
+ * If the <code>onePhase</code> argument is true, one-phase
+ * optimization is being used, and the {@link #prepare(Xid) prepare}
+ * method must not have been called for this transaction.
+ * Otherwise, this is the second phase of the two-phase commit protocol.
+ *
+ * @param xid The id of the transaction to commit work for.
+ * @param onePhase If true, the transaction manager is using one-phase
+ * optimization.
+ * @throws XAException If an error occurred.
+ */
+ public void commit(Xid xid, boolean onePhase) throws XAException;
+
+ /**
+ * Roll back the work done on this resource in the given transaction.
+ *
+ * @param xid The id of the transaction to commit work for.
+ * @throws XAException If an error occurred.
+ */
+ public void rollback(Xid xid) throws XAException;
+
+ /**
+ * Tells the resource manager to forget about a heuristic decision.
+ *
+ * @param xid The id of the transaction that was ended with a heuristic
+ * decision.
+ * @throws XAException If an error occurred.
+ */
+ public void forget(Xid xid) throws XAException;
+
+ /**
+ * Return a list of transactions that are in a prepared or heuristically
+ * state.
+ *
+ * This method looks not only at the resource it is invoked on, but
+ * also on all other resources managed by the same resource manager.
+ * It is intended to be used by the application server when recovering
+ * after a server crash.
+ * <p>
+ * A recovery scan is done with one or more calls to this method.
+ * At the first call, {@link #TMSTARTRSCAN} must be in the
+ * <code>flag</code> argument to indicate that the scan should be started.
+ * During the recovery scan, the resource manager maintains an internal
+ * cursor that keeps track of the progress of the recovery scan.
+ * To end the recovery scan, the {@link #TMENDRSCAN} must be passed
+ * in the <code>flag</code> argument.
+ *
+ * @param flag Must be either {@link #TMNOFLAGS}, {@link #TMSTARTRSCAN},
+ * {@link #TMENDRSCAN} or <code>TMSTARTRSCAN|TMENDRSCAN</code>.
+ * @return An array of zero or more transaction ids.
+ * @throws XAException If an error occurred.
+ */
+ public Xid[] recover(int flag) throws XAException;
+
+ /**
+ * Tells the caller if this resource has the same resource manager
+ * as the argument resource.
+ *
+ * The transaction manager needs this method to be able to decide
+ * if the {@link #start(Xid,int) start} method should be given the
+ * {@link #TMJOIN} flag.
+ *
+ * @throws XAException If an error occurred.
+ */
+ public boolean isSameRM(XAResource xaRes) throws XAException;
+
+ /**
+ * Get the current transaction timeout value for this resource.
+ *
+ * @return The current timeout value, in seconds.
+ * @throws XAException If an error occurred.
+ */
+ public int getTransactionTimeout() throws XAException;
+
+ /**
+ * Set the transaction timeout value for this resource.
+ *
+ * If the <code>seconds</code> argument is <code>0</code>, the
+ * timeout value is set to the default timeout value of the resource
+ * manager.
+ *
+ * Not all resource managers support setting the timeout value.
+ * If the resource manager does not support setting the timeout
+ * value, it should return false.
+ *
+ * @param seconds The timeout value, in seconds.
+ * @return True if the timeout value could be set, otherwise false.
+ * @throws XAException If an error occurred.
+ */
+ public boolean setTransactionTimeout(int seconds) throws XAException;
+}
Property changes on: projects/javaee/trunk/transaction-api/src/main/javax/transaction/xa/XAResource.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Deleted: projects/javaee/trunk/transaction-api/src/main/javax/transaction/xa/Xid.java
===================================================================
--- trunk/j2ee/src/main/javax/transaction/xa/Xid.java 2007-03-07 13:37:51 UTC (rev 61188)
+++ projects/javaee/trunk/transaction-api/src/main/javax/transaction/xa/Xid.java 2007-03-07 14:10:28 UTC (rev 61190)
@@ -1,93 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY 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 along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-package javax.transaction.xa;
-
-/**
- * The Xid interface is a Java mapping of the X/Open transaction identifier
- * XID structure.
- * <p>
- * A transaction id is an aggregate of three parts:
- * <ul>
- * <li> The format identifier indicates the transaction family and tells
- * how the other two parts should be interpreted.
- * </li>
- * <li> The global transaction id denotes, with the format specifier, the
- * id of the global transaction.
- * </li>
- * <li> The branch qualifier denotes a particular branch of the global
- * transaction.
- * </li>
- * </ul>
- * <p>
- * The Xid interface is used by the application server, the transaction manager
- * and the resource managers, and is not used in application programs.
- *
- * @version $Revision$
- */
-public interface Xid
-{
- /**
- * The maximum possible size of a global transaction id.
- * This is the largest possible array returned by the
- * {@link #getGlobalTransactionId() getGlobalTransactionId} method.
- */
- public static final int MAXGTRIDSIZE = 64;
-
- /**
- * The maximum possible size of a transaction branch qualifier.
- * This is the largest possible array returned by the
- * {@link #getBranchQualifier() getBranchQualifier} method.
- */
- public static final int MAXBQUALSIZE = 64;
-
- /**
- * Get the format identifier.
- *
- * @return An integer denoting the family of this transaction, and
- * telling how the two other parts can be interpreted.
- */
- public int getFormatId();
-
- /**
- * Get the global transaction id of this transaction.
- *
- * Please note that JTA does not define if this method returns
- * a copy or a reference to an internal byte array. For maximum
- * portability, do not modify the returned array.
- *
- * @return A byte array that together with the format ID
- * defines the globally unique ID of this transaction.
- */
- public byte[] getGlobalTransactionId();
-
- /**
- * Get the transaction branch qualifier of this transaction.
- *
- * Please note that JTA does not define if this method returns
- * a copy or a reference to an internal byte array. For maximum
- * portability, do not modify the returned array.
- *
- * @return A byte array that identifies the branch of this
- * transaction.
- */
- public byte[] getBranchQualifier();
-}
Copied: projects/javaee/trunk/transaction-api/src/main/javax/transaction/xa/Xid.java (from rev 61188, trunk/j2ee/src/main/javax/transaction/xa/Xid.java)
===================================================================
--- projects/javaee/trunk/transaction-api/src/main/javax/transaction/xa/Xid.java (rev 0)
+++ projects/javaee/trunk/transaction-api/src/main/javax/transaction/xa/Xid.java 2007-03-07 14:10:28 UTC (rev 61190)
@@ -0,0 +1,93 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY 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 along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package javax.transaction.xa;
+
+/**
+ * The Xid interface is a Java mapping of the X/Open transaction identifier
+ * XID structure.
+ * <p>
+ * A transaction id is an aggregate of three parts:
+ * <ul>
+ * <li> The format identifier indicates the transaction family and tells
+ * how the other two parts should be interpreted.
+ * </li>
+ * <li> The global transaction id denotes, with the format specifier, the
+ * id of the global transaction.
+ * </li>
+ * <li> The branch qualifier denotes a particular branch of the global
+ * transaction.
+ * </li>
+ * </ul>
+ * <p>
+ * The Xid interface is used by the application server, the transaction manager
+ * and the resource managers, and is not used in application programs.
+ *
+ * @version $Revision$
+ */
+public interface Xid
+{
+ /**
+ * The maximum possible size of a global transaction id.
+ * This is the largest possible array returned by the
+ * {@link #getGlobalTransactionId() getGlobalTransactionId} method.
+ */
+ public static final int MAXGTRIDSIZE = 64;
+
+ /**
+ * The maximum possible size of a transaction branch qualifier.
+ * This is the largest possible array returned by the
+ * {@link #getBranchQualifier() getBranchQualifier} method.
+ */
+ public static final int MAXBQUALSIZE = 64;
+
+ /**
+ * Get the format identifier.
+ *
+ * @return An integer denoting the family of this transaction, and
+ * telling how the two other parts can be interpreted.
+ */
+ public int getFormatId();
+
+ /**
+ * Get the global transaction id of this transaction.
+ *
+ * Please note that JTA does not define if this method returns
+ * a copy or a reference to an internal byte array. For maximum
+ * portability, do not modify the returned array.
+ *
+ * @return A byte array that together with the format ID
+ * defines the globally unique ID of this transaction.
+ */
+ public byte[] getGlobalTransactionId();
+
+ /**
+ * Get the transaction branch qualifier of this transaction.
+ *
+ * Please note that JTA does not define if this method returns
+ * a copy or a reference to an internal byte array. For maximum
+ * portability, do not modify the returned array.
+ *
+ * @return A byte array that identifies the branch of this
+ * transaction.
+ */
+ public byte[] getBranchQualifier();
+}
Property changes on: projects/javaee/trunk/transaction-api/src/main/javax/transaction/xa/Xid.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Deleted: projects/javaee/trunk/transaction-api/src/main/javax/transaction/xa/package.html
===================================================================
--- trunk/j2ee/src/main/javax/transaction/xa/package.html 2007-03-07 13:37:51 UTC (rev 61188)
+++ projects/javaee/trunk/transaction-api/src/main/javax/transaction/xa/package.html 2007-03-07 14:10:28 UTC (rev 61190)
@@ -1,30 +0,0 @@
-<body>
-<!--
- JBoss, the OpenSource J2EE webOS
-
- This library is free software; you can redistribute it and/or modify it
- under the terms of the GNU Lesser General Public License as published
- by the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This library is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
--->
-
-This package contains the classes and interfaces that define the interaction
-between the transaction manager and the resources it manages.
-<p>
-Classes and interfaces here are conforming to the
-<a href="http://java.sun.com/products/jta/">Java Transaction API
- (JTA) 1.0.1 specification</a>.
-
-<p>
-The interaction is modelled after the X/Open CAE Specification
-(Distributed Transaction Processing: The XA Specification).
-
-The <a href="http://www.omg.org/technology/documents/formal/transaction_service.htm">CORBA CosTransactions specification</a> is freely available, and gives
-a pretty good overview of the XA protocol.
-
-</body>
Copied: projects/javaee/trunk/transaction-api/src/main/javax/transaction/xa/package.html (from rev 61188, trunk/j2ee/src/main/javax/transaction/xa/package.html)
===================================================================
--- projects/javaee/trunk/transaction-api/src/main/javax/transaction/xa/package.html (rev 0)
+++ projects/javaee/trunk/transaction-api/src/main/javax/transaction/xa/package.html 2007-03-07 14:10:28 UTC (rev 61190)
@@ -0,0 +1,30 @@
+<body>
+<!--
+ JBoss, the OpenSource J2EE webOS
+
+ This library is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as published
+ by the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+-->
+
+This package contains the classes and interfaces that define the interaction
+between the transaction manager and the resources it manages.
+<p>
+Classes and interfaces here are conforming to the
+<a href="http://java.sun.com/products/jta/">Java Transaction API
+ (JTA) 1.0.1 specification</a>.
+
+<p>
+The interaction is modelled after the X/Open CAE Specification
+(Distributed Transaction Processing: The XA Specification).
+
+The <a href="http://www.omg.org/technology/documents/formal/transaction_service.htm">CORBA CosTransactions specification</a> is freely available, and gives
+a pretty good overview of the XA protocol.
+
+</body>
Property changes on: projects/javaee/trunk/transaction-api/src/main/javax/transaction/xa/package.html
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
More information about the jboss-cvs-commits
mailing list