[jboss-svn-commits] JBL Code SVN: r32883 - in labs/jbosstm/trunk/XTS: WS-C/dev/src/com/arjuna/webservices/util and 39 other directories.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Fri May 14 04:16:50 EDT 2010
Author: adinn
Date: 2010-05-14 04:16:48 -0400 (Fri, 14 May 2010)
New Revision: 32883
Added:
labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/util/InsertionOrderSet.java
labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/SagasParticipant.java
labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/sagas/
labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/sagas/AddParticipant.java
labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/sagas/BeginCancel.java
labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/sagas/BeginClose.java
labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/sagas/CancelOnlyCancel.java
labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/sagas/CancelOnlyClose.java
labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/sagas/ParticipantCannotCompleteClose.java
labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/sagas/ParticipantExitedClose.java
labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/sagas/ParticipantFaultedClose.java
labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/sagas/Suspend.java
labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/sagas/SuspendClose.java
labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/sagas/SuspendResume.java
labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/sagas/SuspendResumeMultiParticipant.java
Removed:
labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/services/framework/admin/
labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/util/InsertionOrderSet.java
labs/jbosstm/trunk/XTS/WSAS/classes/com/arjuna/mwlabs/wsas/context/
labs/jbosstm/trunk/XTS/WSCF/classes/com/arjuna/mw/wscf/UserCoordinator.java
labs/jbosstm/trunk/XTS/WSCF/classes/com/arjuna/mw/wscf/model/as/
labs/jbosstm/trunk/XTS/WSCF/classes/com/arjuna/mw/wscf/model/xa/
labs/jbosstm/trunk/XTS/WSCF/classes/com/arjuna/mwlabs/wscf/UserCoordinatorImple.java
labs/jbosstm/trunk/XTS/WSCF/classes/com/arjuna/mwlabs/wscf/model/as/
labs/jbosstm/trunk/XTS/WSCF/classes/com/arjuna/mwlabs/wscf/model/jta/
labs/jbosstm/trunk/XTS/WSCF/classes/com/arjuna/mwlabs/wscf/model/sagas/arjunacore/context/
labs/jbosstm/trunk/XTS/WSCF/classes/com/arjuna/mwlabs/wscf/model/twophase/arjunacore/context/
labs/jbosstm/trunk/XTS/WSCF/classes10/com/arjuna/mw/wscf/UserCoordinatorFactory.java
labs/jbosstm/trunk/XTS/WSCF/classes10/com/arjuna/mw/wscf/model/as/
labs/jbosstm/trunk/XTS/WSCF/classes10/com/arjuna/mw/wscf/model/xa/
labs/jbosstm/trunk/XTS/WSCF/classes10/com/arjuna/mwlabs/wsc/model/
labs/jbosstm/trunk/XTS/WSCF/classes10/com/arjuna/mwlabs/wscf/model/jta/
labs/jbosstm/trunk/XTS/WSCF/classes11/com/arjuna/mw/wscf11/UserCoordinatorFactory.java
labs/jbosstm/trunk/XTS/WSCF/classes11/com/arjuna/mw/wscf11/model/as/
labs/jbosstm/trunk/XTS/WSCF/classes11/com/arjuna/mwlabs/wscf11/protocols/Initializer.java
labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf/tests/DemoParticipant.java
labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf/tests/DemoXAParticipant.java
labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf/tests/DemoXAResource.java
labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf/tests/FailureParticipant.java
labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf/tests/JTASynchronization.java
labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf/tests/junit/model/as/
labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf/tests/junit/model/jta/
labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf/tests/junit/model/twophase/StartEnd.java
labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf/tests/junit/xml/
labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/twophase/StartEnd.java
labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mw/wst/BAParticipantManager.java
labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mw/wst/Durable2PCCoordinator.java
labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mw/wst/exceptions/
labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mw/wst/resources/
labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mw/wst/vote/
labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mw/wstx/TransactionManager.java
labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mw/wstx/UserTransaction.java
labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mw/wstx/transaction/
labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mwlabs/wst/at/coordinator/
labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mwlabs/wstx/
labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mw/wstx/
labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mwlabs/wstx/
labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mw/wstx11/
labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wstx11/
labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wstx/tests/junit/basic/
Modified:
labs/jbosstm/trunk/XTS/WSAS/classes/com/arjuna/mw/wsas/context/DeploymentContextFactory.java
labs/jbosstm/trunk/XTS/WSCF/build.xml
labs/jbosstm/trunk/XTS/WSCF/classes/com/arjuna/mwlabs/wscf/protocols/ProtocolEntry.java
labs/jbosstm/trunk/XTS/WSCF/classes10/com/arjuna/mw/wscf/protocols/ProtocolManager.java
labs/jbosstm/trunk/XTS/WSCF/classes10/com/arjuna/mwlabs/wscf/model/sagas/arjunacore/SagasHLSImple.java
labs/jbosstm/trunk/XTS/WSCF/classes10/com/arjuna/mwlabs/wscf/model/twophase/arjunacore/TwoPhaseHLSImple.java
labs/jbosstm/trunk/XTS/WSCF/classes11/com/arjuna/mw/wscf11/protocols/ProtocolManager.java
labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf/tests/WSCFTestSuite.java
labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf/tests/WSCFTestUtils.java
labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/WSCF11TestSuite.java
labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/WSCF11TestUtils.java
labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/twophase/ParticipantSynchronization.java
Log:
deleted first slice of redundant code and code paths identified by coverage testing -- initial fixes for JBTM-741
Deleted: labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/util/InsertionOrderSet.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/util/InsertionOrderSet.java 2010-05-14 08:05:22 UTC (rev 32882)
+++ labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/util/InsertionOrderSet.java 2010-05-14 08:16:48 UTC (rev 32883)
@@ -1,403 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags.
- * See the copyright.txt in the distribution for a full listing
- * of individual contributors.
- * This copyrighted material is made available to anyone wishing to use,
- * modify, copy, or redistribute it subject to the terms and conditions
- * of the GNU Lesser General Public License, v. 2.1.
- * This program is distributed in the hope that it will be useful, but WITHOUT A
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
- * You should have received a copy of the GNU Lesser General Public License,
- * v.2.1 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA 02110-1301, USA.
- *
- * (C) 2005-2006,
- * @author JBoss Inc.
- */
-package com.arjuna.webservices.util;
-
-import java.io.IOException;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.io.Serializable;
-import java.util.AbstractSet;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.NoSuchElementException;
-
-/**
- * Set implementation which honours insertion order. The iterator returns
- * the elements in the order they were inserted into the set.
- *
- * @author kevin
- */
-public class InsertionOrderSet extends AbstractSet implements Cloneable, Serializable
-{
- /**
- * Serial version UID for this class.
- */
- private static final long serialVersionUID = -5575694021209967201L ;
-
- /**
- * The map of entries to linked list entries in this set.
- */
- private transient HashMap entries = new HashMap() ;
- /**
- * The head of the linked list.
- */
- private transient LinkedListEntry head ;
-
- /**
- * Construct the insertion order set.
- */
- public InsertionOrderSet()
- {
- head = new LinkedListEntry(null) ;
- head.setNext(head) ;
- head.setPrevious(head) ;
- }
-
- /**
- * Construct the insertion order set with the specified collection.
- * @param collection The collection to add to this set.
- */
- public InsertionOrderSet(final Collection collection)
- {
- this() ;
- addAll(collection) ;
- }
-
- /**
- * Get the size of this set.
- * @return the set size.
- */
- public int size()
- {
- return entries.size() ;
- }
-
- /**
- * Does this set contain the specified object?
- * @param obj The object to test.
- * @return true if the object is in the set, false otherwise.
- */
- public boolean contains(final Object obj)
- {
- return (entries.get(obj) != null) ;
- }
-
- /**
- * Get the insertion order iterator for this set.
- * @return the iterator.
- */
- public Iterator iterator()
- {
- return new LinkedListEntryIterator() ;
- }
-
- /**
- * Add an object into the set if it is not already present.
- *
- * @param obj The object to add into the set.
- * @return true if the object has been added to the set, false otherwise.
- */
- public boolean add(final Object obj)
- {
- final LinkedListEntry listEntry = new LinkedListEntry(obj) ;
- final Object previous = entries.put(obj, listEntry) ;
- if (previous != null)
- {
- entries.put(obj, previous) ;
- return false ;
- }
-
- final LinkedListEntry lastEntry = head.getPrevious() ;
-
- listEntry.setPrevious(lastEntry) ;
- listEntry.setNext(head) ;
-
- lastEntry.setNext(listEntry) ;
- head.setPrevious(listEntry) ;
-
- return true ;
- }
-
- /**
- * Remove an entry from the set.
- * @param obj The object to remove from the set.
- * @return true if the object has been remove from the set, false otherwise.
- */
- public boolean remove(final Object obj)
- {
- final LinkedListEntry entry = (LinkedListEntry)entries.remove(obj) ;
- if (entry == null)
- {
- return false ;
- }
-
- final LinkedListEntry previousEntry = entry.getPrevious() ;
- final LinkedListEntry nextEntry = entry.getNext() ;
- previousEntry.setNext(nextEntry) ;
- nextEntry.setPrevious(previousEntry) ;
-
- entry.setPrevious(null) ;
- entry.setNext(null) ;
-
- return true ;
- }
-
- /**
- * Clear the set
- */
- public void clear()
- {
- head.setNext(head) ;
- head.setPrevious(head) ;
- entries.clear() ;
- }
-
- /**
- * Is the specified object equal to this one?
- * @param rhs The object to compare.
- * @return true if the specified object is an insertion order set
- * with the same entries and order as this one, false otherwise.
- */
- public boolean equals(final Object rhs)
- {
- if (rhs == this)
- {
- return true ;
- }
-
- if (!(rhs instanceof InsertionOrderSet))
- {
- return false ;
- }
-
- final InsertionOrderSet rhsSet = (InsertionOrderSet)rhs ;
- if (size() != rhsSet.size())
- {
- return false ;
- }
-
- final Iterator thisIter = iterator() ;
- final Iterator rhsIter = rhsSet.iterator() ;
-
- while(thisIter.hasNext())
- {
- if (!rhsIter.hasNext() || !equals(thisIter.next(), rhsIter.next()))
- {
- return false ;
- }
- }
-
- return true ;
- }
-
- /**
- * Clone this object.
- * @return the clone of this object.
- */
- protected Object clone()
- throws CloneNotSupportedException
- {
- return new InsertionOrderSet(this) ;
- }
-
-
- /**
- * Compare the two objects for equality, including nulls.
- * @param lhs The first object to compare.
- * @param rhs The second object to compare.
- * @return true if the objects are equals, false otherwise.
- */
- private static boolean equals(final Object lhs, final Object rhs)
- {
- if (lhs == null)
- {
- return (rhs == null) ;
- }
- return lhs.equals(rhs) ;
- }
-
- /**
- * Write this set to the object output stream.
- * @param objectOutputStream The object output stream
- * @throws IOException For IO errors.
- */
- private void writeObject(final ObjectOutputStream objectOutputStream)
- throws IOException
- {
- // Write default entries (should do nothing but included for completeness)
- objectOutputStream.defaultWriteObject();
-
- objectOutputStream.writeInt(size()) ;
- final Iterator iterator = iterator() ;
- while(iterator.hasNext())
- {
- objectOutputStream.writeObject(iterator.next()) ;
- }
- }
-
- /**
- * Read this set from the object input stream.
- * @param objectInputStream The object input stream.
- * @throws IOException for IO errors.
- * @throws ClassNotFoundException if a dependent class cannot be found.
- */
- private void readObject(final ObjectInputStream objectInputStream)
- throws IOException, ClassNotFoundException
- {
- // Read default entries (should do nothing but included for completeness)
- objectInputStream.defaultReadObject() ;
-
- final int size = objectInputStream.readInt() ;
-
- head = new LinkedListEntry(null) ;
- head.setNext(head) ;
- head.setPrevious(head) ;
- entries = new HashMap(size) ;
-
- for(int count = 0 ; count < size ; count++)
- {
- add(objectInputStream.readObject()) ;
- }
- }
-
- /**
- * Private inner class providing double linked list functionality
- * @author kevin
- */
- private static class LinkedListEntry
- {
- /**
- * The object associated with this entry in the list.
- */
- private final Object obj ;
- /**
- * The next list entry.
- */
- private LinkedListEntry next ;
- /**
- * The previous list entry.
- */
- private LinkedListEntry previous ;
-
- /**
- * Construct the linked list entry.
- * @param obj The associated object.
- */
- LinkedListEntry(final Object obj)
- {
- this.obj = obj ;
- }
-
- /**
- * Get the next entry in the list.
- * @return The next entry.
- */
- LinkedListEntry getNext()
- {
- return next ;
- }
-
- /**
- * Set the next entry in the list.
- * @param next The next entry.
- */
- void setNext(final LinkedListEntry next)
- {
- this.next = next ;
- }
-
- /**
- * Get the previous entry in the list.
- * @return The previous entry.
- */
- LinkedListEntry getPrevious()
- {
- return previous ;
- }
-
- /**
- * Set the previous entry in the list.
- * @param previous The previous entry.
- */
- void setPrevious(final LinkedListEntry previous)
- {
- this.previous = previous ;
- }
-
- /**
- * Get the object associated with this entry.
- * @return The object.
- */
- Object getObject()
- {
- return obj ;
- }
- }
-
- /**
- * The iterator class for the Insertion Order Set
- * @author kevin
- */
- private class LinkedListEntryIterator implements Iterator
- {
- /**
- * The current entry.
- */
- private LinkedListEntry current ;
- /**
- * The next entry.
- */
- private LinkedListEntry next = head.getNext() ;
-
- /**
- * Does the iterator have more entries?
- * @return true if the iterator contains more entries, false otherwise.
- */
- public boolean hasNext()
- {
- return (next != head) ;
- }
-
- /**
- * Get the next entry from the iterator.
- * @return the next entry in the iterator.
- * @throws NoSuchElementException if there are no more entries in the iterator.
- */
- public Object next()
- throws NoSuchElementException
- {
- if (!hasNext())
- {
- throw new NoSuchElementException("End of iterator") ;
- }
- current = next ;
- next = current.getNext() ;
- return current.getObject() ;
- }
-
- /**
- * Remove the current entry from the set.
- * @throws IllegalStateException if the next method has not been called or if
- * remove has already been called on the current
- */
- public void remove()
- throws IllegalStateException
- {
- if (current == null)
- {
- throw new IllegalStateException("Nothing to remove") ;
- }
- InsertionOrderSet.this.remove(current.getObject()) ;
- current = null ;
- }
- }
-}
Copied: labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/util/InsertionOrderSet.java (from rev 32598, labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/util/InsertionOrderSet.java)
===================================================================
--- labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/util/InsertionOrderSet.java (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/util/InsertionOrderSet.java 2010-05-14 08:16:48 UTC (rev 32883)
@@ -0,0 +1,403 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags.
+ * See the copyright.txt in the distribution for a full listing
+ * of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2006,
+ * @author JBoss Inc.
+ */
+package com.arjuna.webservices.util;
+
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.io.Serializable;
+import java.util.AbstractSet;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.NoSuchElementException;
+
+/**
+ * Set implementation which honours insertion order. The iterator returns
+ * the elements in the order they were inserted into the set.
+ *
+ * @author kevin
+ */
+public class InsertionOrderSet extends AbstractSet implements Cloneable, Serializable
+{
+ /**
+ * Serial version UID for this class.
+ */
+ private static final long serialVersionUID = -5575694021209967201L ;
+
+ /**
+ * The map of entries to linked list entries in this set.
+ */
+ private transient HashMap entries = new HashMap() ;
+ /**
+ * The head of the linked list.
+ */
+ private transient LinkedListEntry head ;
+
+ /**
+ * Construct the insertion order set.
+ */
+ public InsertionOrderSet()
+ {
+ head = new LinkedListEntry(null) ;
+ head.setNext(head) ;
+ head.setPrevious(head) ;
+ }
+
+ /**
+ * Construct the insertion order set with the specified collection.
+ * @param collection The collection to add to this set.
+ */
+ public InsertionOrderSet(final Collection collection)
+ {
+ this() ;
+ addAll(collection) ;
+ }
+
+ /**
+ * Get the size of this set.
+ * @return the set size.
+ */
+ public int size()
+ {
+ return entries.size() ;
+ }
+
+ /**
+ * Does this set contain the specified object?
+ * @param obj The object to test.
+ * @return true if the object is in the set, false otherwise.
+ */
+ public boolean contains(final Object obj)
+ {
+ return (entries.get(obj) != null) ;
+ }
+
+ /**
+ * Get the insertion order iterator for this set.
+ * @return the iterator.
+ */
+ public Iterator iterator()
+ {
+ return new LinkedListEntryIterator() ;
+ }
+
+ /**
+ * Add an object into the set if it is not already present.
+ *
+ * @param obj The object to add into the set.
+ * @return true if the object has been added to the set, false otherwise.
+ */
+ public boolean add(final Object obj)
+ {
+ final LinkedListEntry listEntry = new LinkedListEntry(obj) ;
+ final Object previous = entries.put(obj, listEntry) ;
+ if (previous != null)
+ {
+ entries.put(obj, previous) ;
+ return false ;
+ }
+
+ final LinkedListEntry lastEntry = head.getPrevious() ;
+
+ listEntry.setPrevious(lastEntry) ;
+ listEntry.setNext(head) ;
+
+ lastEntry.setNext(listEntry) ;
+ head.setPrevious(listEntry) ;
+
+ return true ;
+ }
+
+ /**
+ * Remove an entry from the set.
+ * @param obj The object to remove from the set.
+ * @return true if the object has been remove from the set, false otherwise.
+ */
+ public boolean remove(final Object obj)
+ {
+ final LinkedListEntry entry = (LinkedListEntry)entries.remove(obj) ;
+ if (entry == null)
+ {
+ return false ;
+ }
+
+ final LinkedListEntry previousEntry = entry.getPrevious() ;
+ final LinkedListEntry nextEntry = entry.getNext() ;
+ previousEntry.setNext(nextEntry) ;
+ nextEntry.setPrevious(previousEntry) ;
+
+ entry.setPrevious(null) ;
+ entry.setNext(null) ;
+
+ return true ;
+ }
+
+ /**
+ * Clear the set
+ */
+ public void clear()
+ {
+ head.setNext(head) ;
+ head.setPrevious(head) ;
+ entries.clear() ;
+ }
+
+ /**
+ * Is the specified object equal to this one?
+ * @param rhs The object to compare.
+ * @return true if the specified object is an insertion order set
+ * with the same entries and order as this one, false otherwise.
+ */
+ public boolean equals(final Object rhs)
+ {
+ if (rhs == this)
+ {
+ return true ;
+ }
+
+ if (!(rhs instanceof InsertionOrderSet))
+ {
+ return false ;
+ }
+
+ final InsertionOrderSet rhsSet = (InsertionOrderSet)rhs ;
+ if (size() != rhsSet.size())
+ {
+ return false ;
+ }
+
+ final Iterator thisIter = iterator() ;
+ final Iterator rhsIter = rhsSet.iterator() ;
+
+ while(thisIter.hasNext())
+ {
+ if (!rhsIter.hasNext() || !equals(thisIter.next(), rhsIter.next()))
+ {
+ return false ;
+ }
+ }
+
+ return true ;
+ }
+
+ /**
+ * Clone this object.
+ * @return the clone of this object.
+ */
+ protected Object clone()
+ throws CloneNotSupportedException
+ {
+ return new InsertionOrderSet(this) ;
+ }
+
+
+ /**
+ * Compare the two objects for equality, including nulls.
+ * @param lhs The first object to compare.
+ * @param rhs The second object to compare.
+ * @return true if the objects are equals, false otherwise.
+ */
+ private static boolean equals(final Object lhs, final Object rhs)
+ {
+ if (lhs == null)
+ {
+ return (rhs == null) ;
+ }
+ return lhs.equals(rhs) ;
+ }
+
+ /**
+ * Write this set to the object output stream.
+ * @param objectOutputStream The object output stream
+ * @throws IOException For IO errors.
+ */
+ private void writeObject(final ObjectOutputStream objectOutputStream)
+ throws IOException
+ {
+ // Write default entries (should do nothing but included for completeness)
+ objectOutputStream.defaultWriteObject();
+
+ objectOutputStream.writeInt(size()) ;
+ final Iterator iterator = iterator() ;
+ while(iterator.hasNext())
+ {
+ objectOutputStream.writeObject(iterator.next()) ;
+ }
+ }
+
+ /**
+ * Read this set from the object input stream.
+ * @param objectInputStream The object input stream.
+ * @throws IOException for IO errors.
+ * @throws ClassNotFoundException if a dependent class cannot be found.
+ */
+ private void readObject(final ObjectInputStream objectInputStream)
+ throws IOException, ClassNotFoundException
+ {
+ // Read default entries (should do nothing but included for completeness)
+ objectInputStream.defaultReadObject() ;
+
+ final int size = objectInputStream.readInt() ;
+
+ head = new LinkedListEntry(null) ;
+ head.setNext(head) ;
+ head.setPrevious(head) ;
+ entries = new HashMap(size) ;
+
+ for(int count = 0 ; count < size ; count++)
+ {
+ add(objectInputStream.readObject()) ;
+ }
+ }
+
+ /**
+ * Private inner class providing double linked list functionality
+ * @author kevin
+ */
+ private static class LinkedListEntry
+ {
+ /**
+ * The object associated with this entry in the list.
+ */
+ private final Object obj ;
+ /**
+ * The next list entry.
+ */
+ private LinkedListEntry next ;
+ /**
+ * The previous list entry.
+ */
+ private LinkedListEntry previous ;
+
+ /**
+ * Construct the linked list entry.
+ * @param obj The associated object.
+ */
+ LinkedListEntry(final Object obj)
+ {
+ this.obj = obj ;
+ }
+
+ /**
+ * Get the next entry in the list.
+ * @return The next entry.
+ */
+ LinkedListEntry getNext()
+ {
+ return next ;
+ }
+
+ /**
+ * Set the next entry in the list.
+ * @param next The next entry.
+ */
+ void setNext(final LinkedListEntry next)
+ {
+ this.next = next ;
+ }
+
+ /**
+ * Get the previous entry in the list.
+ * @return The previous entry.
+ */
+ LinkedListEntry getPrevious()
+ {
+ return previous ;
+ }
+
+ /**
+ * Set the previous entry in the list.
+ * @param previous The previous entry.
+ */
+ void setPrevious(final LinkedListEntry previous)
+ {
+ this.previous = previous ;
+ }
+
+ /**
+ * Get the object associated with this entry.
+ * @return The object.
+ */
+ Object getObject()
+ {
+ return obj ;
+ }
+ }
+
+ /**
+ * The iterator class for the Insertion Order Set
+ * @author kevin
+ */
+ private class LinkedListEntryIterator implements Iterator
+ {
+ /**
+ * The current entry.
+ */
+ private LinkedListEntry current ;
+ /**
+ * The next entry.
+ */
+ private LinkedListEntry next = head.getNext() ;
+
+ /**
+ * Does the iterator have more entries?
+ * @return true if the iterator contains more entries, false otherwise.
+ */
+ public boolean hasNext()
+ {
+ return (next != head) ;
+ }
+
+ /**
+ * Get the next entry from the iterator.
+ * @return the next entry in the iterator.
+ * @throws NoSuchElementException if there are no more entries in the iterator.
+ */
+ public Object next()
+ throws NoSuchElementException
+ {
+ if (!hasNext())
+ {
+ throw new NoSuchElementException("End of iterator") ;
+ }
+ current = next ;
+ next = current.getNext() ;
+ return current.getObject() ;
+ }
+
+ /**
+ * Remove the current entry from the set.
+ * @throws IllegalStateException if the next method has not been called or if
+ * remove has already been called on the current
+ */
+ public void remove()
+ throws IllegalStateException
+ {
+ if (current == null)
+ {
+ throw new IllegalStateException("Nothing to remove") ;
+ }
+ InsertionOrderSet.this.remove(current.getObject()) ;
+ current = null ;
+ }
+ }
+}
Property changes on: labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/util/InsertionOrderSet.java
___________________________________________________________________
Name: svn:executable
+ *
Modified: labs/jbosstm/trunk/XTS/WSAS/classes/com/arjuna/mw/wsas/context/DeploymentContextFactory.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSAS/classes/com/arjuna/mw/wsas/context/DeploymentContextFactory.java 2010-05-14 08:05:22 UTC (rev 32882)
+++ labs/jbosstm/trunk/XTS/WSAS/classes/com/arjuna/mw/wsas/context/DeploymentContextFactory.java 2010-05-14 08:16:48 UTC (rev 32883)
@@ -33,8 +33,6 @@
import com.arjuna.mw.wsas.common.Environment;
-import com.arjuna.mwlabs.wsas.context.DeploymentContextImple;
-
/**
* @author Mark Little (mark at arjuna.com)
* @version $Id: DeploymentContextFactory.java,v 1.4 2004/03/15 13:25:00 nmcl Exp $
@@ -74,9 +72,6 @@
{
ex.printStackTrace();
}
-
- if (_deployContext == null)
- _deployContext = new DeploymentContextImple();
}
-
+
}
Modified: labs/jbosstm/trunk/XTS/WSCF/build.xml
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/build.xml 2010-05-14 08:05:22 UTC (rev 32882)
+++ labs/jbosstm/trunk/XTS/WSCF/build.xml 2010-05-14 08:16:48 UTC (rev 32883)
@@ -128,7 +128,8 @@
<target name="compile10" if="build10">
<echo message="Compiling module 1.0 code"/>
- <compile.macro src.dir="${src10.dir}" dest.dir="${build.classes10.dir}">
+ <compile.macro src.dir="${src10.dir}" dest.dir="${build.classes10.dir}"
+ emmafilter="com.arjuna.mw.wscf.model.xa.* ">
<additional.classpath>
<path>
<pathelement path="${build.classes.dir}"/>
Deleted: labs/jbosstm/trunk/XTS/WSCF/classes/com/arjuna/mw/wscf/UserCoordinator.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/classes/com/arjuna/mw/wscf/UserCoordinator.java 2010-05-14 08:05:22 UTC (rev 32882)
+++ labs/jbosstm/trunk/XTS/WSCF/classes/com/arjuna/mw/wscf/UserCoordinator.java 2010-05-14 08:16:48 UTC (rev 32883)
@@ -1,137 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags.
- * See the copyright.txt in the distribution for a full listing
- * of individual contributors.
- * This copyrighted material is made available to anyone wishing to use,
- * modify, copy, or redistribute it subject to the terms and conditions
- * of the GNU Lesser General Public License, v. 2.1.
- * This program is distributed in the hope that it will be useful, but WITHOUT A
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
- * You should have received a copy of the GNU Lesser General Public License,
- * v.2.1 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA 02110-1301, USA.
- *
- * (C) 2005-2006,
- * @author JBoss Inc.
- */
-/*
- * Copyright (C) 2002,
- *
- * Arjuna Technologies Limited,
- * Newcastle upon Tyne,
- * Tyne and Wear,
- * UK.
- *
- * $Id: UserCoordinator.java,v 1.2 2005/05/19 12:13:20 nmcl Exp $
- */
-
-package com.arjuna.mw.wscf;
-
-import com.arjuna.mw.wscf.common.CoordinatorId;
-import com.arjuna.mw.wscf.common.Qualifier;
-
-import com.arjuna.mw.wsas.UserActivity;
-
-import com.arjuna.mw.wsas.activity.Outcome;
-
-import com.arjuna.mw.wsas.completionstatus.CompletionStatus;
-
-import com.arjuna.mw.wsas.exceptions.WrongStateException;
-import com.arjuna.mw.wsas.exceptions.SystemException;
-import com.arjuna.mw.wsas.exceptions.ProtocolViolationException;
-import com.arjuna.mw.wsas.exceptions.NoActivityException;
-
-/**
- * The user portion of the coordinator API. An implementation of this interface
- * presents each thread with the capability to create and manage coordinators.
- * It is very similar to the OTS Current and JTA UserTransaction.
- *
- * @author Mark Little (mark.little at arjuna.com)
- * @version $Id: UserCoordinator.java,v 1.2 2005/05/19 12:13:20 nmcl Exp $
- * @since 1.0.
- */
-
-public interface UserCoordinator extends UserActivity
-{
-
- /**
- * Coordinate the participants using the current completion status
- * associated with the activity. This does not necessarily complete the
- * coordination domain, i.e., it may be possible to call this method
- * multiple times within the lifetime of a single activity.
- *
- * @exception WrongStateException Thrown if the current activity is not in a
- * state that allows it to be coordinated, or is incompatible with the
- * completion status provided.
- * @exception ProtocolViolationException Thrown if the a violation of the
- * activity service or HLS protocol occurs.
- * @exception NoActivityException Thrown if there is no activity
- * associated with the invoking thread.
- * @exception SystemException Thrown if some other error occurred.
- *
- * @return the result of completing the activity. Null is valid and must
- * be interpreted within the context of any HLS that may exist.
- *
- * @see com.arjuna.mw.wsas.activity.Outcome
- */
-
- public Outcome coordinate () throws WrongStateException, ProtocolViolationException, NoActivityException, SystemException;
-
-
- /**
- * Coordinate the participants using the completion status provided.
- * This does not necessarily complete the coordination domain, i.e., it
- * may be possible to call this method multiple times within the lifetime
- * of a single activity.
- *
- * @exception WrongStateException Thrown if the current activity is not in a
- * state that allows it to be coordinated, or is incompatible with the
- * completion status provided.
- * @exception ProtocolViolationException Thrown if the a violation of the
- * activity service or HLS protocol occurs.
- * @exception NoActivityException Thrown if there is no activity
- * associated with the invoking thread.
- * @exception SystemException Thrown if some other error occurred.
- *
- * @param cs The CompletionStatus to use.
- *
- * @return the result of completing the activity. Null is valid and must
- * be interpreted within the context of any HLS that may exist.
- *
- * @see com.arjuna.mw.wsas.activity.Outcome
- */
-
- public Outcome coordinate (CompletionStatus cs) throws WrongStateException, ProtocolViolationException, NoActivityException, SystemException;
-
- /**
- * Each participant can supply qualifiers to the coordinator at the time
- * it enrols. These qualifiers may be used within the coordination protocol
- * and hence need to be made available to users.
- *
- * @exception NoActivityException Thrown if there is no activity
- * associated with the invoking thread.
- * @exception SystemException Thrown if some other error occurred.
- *
- * @return Qualifier[] qualifiers The qualifiers for all of the enlisted
- * participants, or null if there are none.
- */
-
- public Qualifier[] qualifiers () throws NoActivityException, SystemException;
-
- /**
- * @exception NoActivityException Thrown if there is no activity
- * associated with the invoking thread.
- * @exception SystemException Thrown if some other error occurred.
- *
- * @return the unique coordinator id for the current coordinator. This
- * may or may not be the same as the activity id.
- */
-
- public CoordinatorId identifier () throws NoActivityException, SystemException;
-
-}
-
Deleted: labs/jbosstm/trunk/XTS/WSCF/classes/com/arjuna/mwlabs/wscf/UserCoordinatorImple.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/classes/com/arjuna/mwlabs/wscf/UserCoordinatorImple.java 2010-05-14 08:05:22 UTC (rev 32882)
+++ labs/jbosstm/trunk/XTS/WSCF/classes/com/arjuna/mwlabs/wscf/UserCoordinatorImple.java 2010-05-14 08:16:48 UTC (rev 32883)
@@ -1,475 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags.
- * See the copyright.txt in the distribution for a full listing
- * of individual contributors.
- * This copyrighted material is made available to anyone wishing to use,
- * modify, copy, or redistribute it subject to the terms and conditions
- * of the GNU Lesser General Public License, v. 2.1.
- * This program is distributed in the hope that it will be useful, but WITHOUT A
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
- * You should have received a copy of the GNU Lesser General Public License,
- * v.2.1 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA 02110-1301, USA.
- *
- * (C) 2005-2006,
- * @author JBoss Inc.
- */
-/*
- * Copyright (C) 2002,
- *
- * Arjuna Technologies Limited,
- * Newcastle upon Tyne,
- * Tyne and Wear,
- * UK.
- *
- * $Id: UserCoordinatorImple.java,v 1.6 2005/05/19 12:13:31 nmcl Exp $
- */
-
-package com.arjuna.mwlabs.wscf;
-
-import com.arjuna.mw.wscf.UserCoordinator;
-
-import com.arjuna.mw.wscf.common.CoordinatorId;
-import com.arjuna.mw.wscf.common.Qualifier;
-
-import com.arjuna.mw.wscf.api.UserCoordinatorService;
-
-import com.arjuna.mwlabs.wsas.UserActivityImple;
-
-import com.arjuna.mwlabs.wsas.activity.ActivityImple;
-
-import com.arjuna.mw.wsas.activity.Outcome;
-
-import com.arjuna.mw.wsas.UserActivity;
-import com.arjuna.mw.wsas.UserActivityFactory;
-
-import com.arjuna.mw.wsas.activity.ActivityHierarchy;
-
-import com.arjuna.mw.wsas.completionstatus.CompletionStatus;
-
-import com.arjuna.mw.wsas.status.NoActivity;
-
-import com.arjuna.mw.wsas.common.GlobalId;
-
-import com.arjuna.mw.wsas.exceptions.WrongStateException;
-import com.arjuna.mw.wsas.exceptions.SystemException;
-import com.arjuna.mw.wsas.exceptions.InvalidTimeoutException;
-import com.arjuna.mw.wsas.exceptions.ProtocolViolationException;
-import com.arjuna.mw.wsas.exceptions.NoActivityException;
-import com.arjuna.mw.wsas.exceptions.NoPermissionException;
-import com.arjuna.mw.wsas.exceptions.HLSError;
-import com.arjuna.mw.wsas.exceptions.InvalidActivityException;
-import com.arjuna.mw.wsas.exceptions.ActiveChildException;
-
-/**
- * The user portion of the coordinator API. An implementation of this interface
- * presents each thread with the capability to create and manage coordinators.
- * It is very similar to the OTS Current and JTA UserTransaction.
- *
- * @author Mark Little (mark.little at arjuna.com)
- * @version $Id: UserCoordinatorImple.java,v 1.6 2005/05/19 12:13:31 nmcl Exp $
- * @since 1.0.
- */
-
-public class UserCoordinatorImple implements UserCoordinator, UserActivity
-{
-
- public UserCoordinatorImple (Object type)
- {
- super();
-
- try
- {
- if (type instanceof String)
- {
- Class c = Class.forName((String) type);
-
- _theCoordinatorService = (UserCoordinatorService) c.newInstance();
- }
- else
- _theCoordinatorService = (UserCoordinatorService) type;
-
- // ActivityManagerFactory.activityManager().addHLS((HLS) _theCoordinatorService);
- }
- catch (Exception ex)
- {
- throw new HLSError(ex.toString());
- }
- }
-
- /**
- * Coordinate the participants using the current completion status
- * associated with the activity.
- *
- * @exception WrongStateException Thrown if the current activity is not in a
- * state that allows it to be completed, or is incompatible with the
- * completion status provided.
- * @exception ProtocolViolationException Thrown if the a violation of the
- * activity service or HLS protocol occurs.
- * @exception NoActivityException Thrown if there is no activity
- * associated with the invoking thread.
- * @exception SystemException Thrown if some other error occurred.
- *
- * @return the result of completing the activity. Null is valid and must
- * be interpreted within the context of any HLS that may exist.
- *
- * @see com.arjuna.mw.wsas.Outcome
- */
-
- public Outcome coordinate () throws WrongStateException, ProtocolViolationException, NoActivityException, SystemException
- {
- ActivityImple curr = current();
-
- if (curr == null)
- throw new NoActivityException();
-
- return _theCoordinatorService.coordinate(curr.getCompletionStatus());
- }
-
- /**
- * Coordinate the participants using the completion status provided.
- *
- * @exception WrongStateException Thrown if the current activity is not in a
- * state that allows it to be completed, or is incompatible with the
- * completion status provided.
- * @exception ProtocolViolationException Thrown if the a violation of the
- * activity service or HLS protocol occurs.
- * @exception NoActivityException Thrown if there is no activity
- * associated with the invoking thread.
- * @exception SystemException Thrown if some other error occurred.
- *
- * @param CompletionStatus cs The CompletionStatus to use.
- *
- * @return the result of completing the activity. Null is valid and must
- * be interpreted within the context of any HLS that may exist.
- *
- * @see com.arjuna.mw.wsas.Outcome
- */
-
- public Outcome coordinate (CompletionStatus cs) throws WrongStateException, ProtocolViolationException, NoActivityException, SystemException
- {
- ActivityImple curr = current();
-
- if (curr == null)
- throw new NoActivityException();
-
- curr.completionValid(cs);
-
- return _theCoordinatorService.coordinate(cs);
- }
-
- /**
- * Each participant can supply qualifiers to the coordinator at the time
- * it enrols. These qualifiers may be used within the coordination protocol
- * and hence need to be made available to users.
- *
- * @exception NoActivityException Thrown if there is no activity
- * associated with the invoking thread.
- * @exception SystemException Thrown if some other error occurred.
- *
- * @return Qualifier[] qualifiers The qualifiers.
- */
-
- public Qualifier[] qualifiers () throws NoActivityException, SystemException
- {
- ActivityImple curr = current();
-
- if (curr == null)
- throw new NoActivityException();
-
- return _theCoordinatorService.qualifiers();
- }
-
- /**
- * @return the unique coordinator identifier.
- */
-
- public CoordinatorId identifier () throws NoActivityException, SystemException
- {
- ActivityImple curr = current();
-
- if (curr == null)
- throw new NoActivityException();
-
- return _theCoordinatorService.identifier();
- }
-
- /**
- * Start a new activity. If there is already an activity associated
- * with the thread then it will be nested. An implementation specific
- * timeout will be associated with the activity (which may be no
- * timeout).
- *
- * @exception WrongStateException Thrown if the any currently associated
- * activity is in a state that does not allow a new activity to be
- * enlisted.
- * @exception SystemException Thrown in any other situation.
- */
-
- public void start () throws WrongStateException, SystemException
- {
- UserActivityFactory.userActivity().start();
- }
-
- /**
- * Start a new activity. If there is already an activity associated
- * with the thread then it will be nested.
- *
- * @param int timeout The timeout associated with the activity. If the
- * activity has not been terminated by the time this period elapses, then
- * it will automatically be terminated.
- * @exception WrongStateException Thrown if the currently associated
- * activity is in a state that does not allow a new activity to be
- * enlisted as a child.
- * @exception InvalidTimeoutException Thrown if the specified timeout is
- * invalid within the current working environment.
- * @exception SystemException Thrown in any other situation.
- */
-
- public void start (int timeout) throws WrongStateException, InvalidTimeoutException, SystemException
- {
- UserActivityFactory.userActivity().start(timeout);
- }
-
- /**
- * Complete the activity with the current completion status.
- *
- * @exception InvalidActivityException Thrown if the current activity is a
- * parent activity with active children.
- * @exception WrongStateException Thrown if the current activity is not in a
- * state that allows it to be completed in the status requested.
- * @exception ProtocolViolationException Thrown if the a violation of the
- * activity service or HLS protocol occurs.
- * @exception NoActivityException Thrown if there is no activity
- * associated with the invoking thread.
- * @exception NoPermissionException Thrown if the invoking thread does
- * not have permission to terminate the transaction.
- * @exception SystemException Thrown if some other error occurred.
- *
- * @return the result of completing the activity. Null is valid and must
- * be interpreted within the context of any HLS that may exist.
- *
- * @see com.arjuna.mw.wsas.Outcome
- */
-
- public Outcome end () throws InvalidActivityException, WrongStateException, ProtocolViolationException, NoActivityException, SystemException, NoPermissionException, ActiveChildException
- {
- return UserActivityFactory.userActivity().end();
- }
-
-
- /**
- * Complete the activity with the completion status provided.
- *
- * @exception InvalidActivityException Thrown if the current activity is a
- * parent activity with active children.
- * @exception WrongStateException Thrown if the current activity is not in a
- * state that allows it to be completed, or is incompatible with the
- * completion status provided.
- * @exception ProtocolViolationException Thrown if the a violation of the
- * activity service or HLS protocol occurs.
- * @exception NoActivityException Thrown if there is no activity
- * associated with the invoking thread.
- * @exception NoPermissionException Thrown if the invoking thread does
- * not have permission to terminate the transaction.
- * @exception SystemException Thrown if some other error occurred.
- *
- * @param CompletionStatus cs The CompletionStatus to use.
- *
- * @return the result of completing the activity. Null is valid and must
- * be interpreted within the context of any HLS that may exist.
- *
- * @see com.arjuna.mw.wsas.Outcome
- */
-
- public Outcome end (com.arjuna.mw.wsas.completionstatus.CompletionStatus cs) throws InvalidActivityException, WrongStateException, ProtocolViolationException, SystemException, NoActivityException, NoPermissionException, ActiveChildException
- {
- return UserActivityFactory.userActivity().end(cs);
- }
-
- /**
- * Set the termination status for the current activity, if any.
- *
- * @param CompletionStatus endStatus The state in which the activity
- * should attempt to terminate. This may
- * be one of the default values provided by WSAS or may be extended in
- * an implementation specific manner by an HLS.
- *
- * @exception NoActivityException Thrown if there is no activity
- * associated with the invoking thread.
- * @exception WrongStateException Thrown if the completion status is
- * incompatible with the current state of the activity.
- * @exception SystemException Thrown if any other error occurs.
- */
-
- public void setCompletionStatus (CompletionStatus endStatus) throws NoActivityException, WrongStateException, SystemException
- {
- UserActivityFactory.userActivity().setCompletionStatus(endStatus);
- }
-
- /**
- * Get the completion status currently associated with the activity.
- *
- * @exception NoActivityException Thrown if there is no activity
- * associated with the current thread.
- * @exception SystemException Thrown if any other error occurs.
- *
- * @return the termination status for the current activity, if any.
- */
-
- public CompletionStatus getCompletionStatus () throws NoActivityException, SystemException
- {
- return UserActivityFactory.userActivity().getCompletionStatus();
- }
-
- /**
- * Get the timeout value currently associated with activities.
- *
- * @exception SystemException Thrown if any error occurs.
- *
- * @return the timeout value in seconds, or 0 if no application specified
- * timeout has been provided.
- */
-
- public int getTimeout () throws SystemException
- {
- return UserActivityFactory.userActivity().getTimeout();
- }
-
- /**
- * Set the timeout to be associated with all subsequently created
- * activities. A default value of 0 is automatically associated with
- * each thread and this means that no application specified timeout is
- * set for activities.
- *
- * @param int timeout The timeout (in seconds) to associate with all
- * subsequently created activities. This value must be 0 or greater.
- *
- * @exception InvalidTimeoutException Thrown if the timeout value provided
- * is negative, too large, or if timeouts are simply not supported by
- * the activity implementation.
- * @exception SystemException Thrown if any other error occurs.
- */
-
- public void setTimeout (int timeout) throws InvalidTimeoutException, SystemException
- {
- UserActivityFactory.userActivity().setTimeout(timeout);
- }
-
- /**
- * @exception SystemException Thrown if any error occurs.
- *
- * @return the status of the current activity. If there is no
- * activity associated with the thread then NoActivity
- * will be returned.
- *
- * @see com.arjuna.mw.wsas.status.Status
- */
-
- public com.arjuna.mw.wsas.status.Status status () throws SystemException
- {
- ActivityImple curr = current();
-
- if (curr == null)
- return NoActivity.instance();
-
- return _theCoordinatorService.status();
- }
-
- /**
- * What is the name of the current activity? Use only for
- * debugging purposes!
- *
- * @exception NoActivityException Thrown if there is no activity
- * associated with the invoking thread.
- * @exception SystemException Thrown if any other error occurs.
- *
- * @return the name of the activity.
- */
-
- public String activityName () throws NoActivityException, SystemException
- {
- return UserActivityFactory.userActivity().activityName();
- }
-
- /**
- * @return the unique activity id.
- *
- * @exception NoActivityException Thrown if there is no activity
- * associated with the invoking thread.
- * @exception SystemException Thrown if any other error occurs.
- */
-
- public GlobalId activityId () throws NoActivityException, SystemException
- {
- return UserActivityFactory.userActivity().activityId();
- }
-
- /**
- * Suspend the current activity from this thread and return the token
- * representing the context, if any, or null otherwise. Once called, the
- * thread will have no activities associated with it.
- *
- * @exception SystemException Thrown if any error occurs.
- *
- * @return the token representing the current context, if any, or null
- * otherwise.
- */
-
- public ActivityHierarchy suspend () throws SystemException
- {
- return UserActivityFactory.userActivity().suspend();
- }
-
- /**
- * Given a token representing a context, associate it with the current
- * thread of control. This will implicitly disassociate the thread from any
- * activities that it may already be associated with. If the parameter is
- * null then the thread is associated with no activity.
- *
- * @param ActivityHierarchy tx The activity to associate with this thread. This
- * may be null in which case the current thread becomes associated with
- * no activity.
- *
- * @exception InvalidActivityException Thrown if the activity handle
- * is invalid in this context.
- * @exception SystemException Thrown if any other error occurs.
- */
-
- public void resume (ActivityHierarchy tx) throws InvalidActivityException, SystemException
- {
- UserActivityFactory.userActivity().resume(tx);
- }
-
- /**
- * @return the token representing the current activity context hierarchy,
- * or null if there is none associated with the invoking thread.
- *
- * @exception SystemException Thrown if any error occurs.
- */
-
- public ActivityHierarchy currentActivity () throws SystemException
- {
- return UserActivityFactory.userActivity().currentActivity();
- }
-
- public final ActivityImple current ()
- {
- UserActivityImple imple = (UserActivityImple) UserActivityFactory.userActivity();
-
- return imple.current();
- }
-
- final UserCoordinatorService coordinatorService ()
- {
- return _theCoordinatorService;
- }
-
- private UserCoordinatorService _theCoordinatorService;
-
-}
-
Modified: labs/jbosstm/trunk/XTS/WSCF/classes/com/arjuna/mwlabs/wscf/protocols/ProtocolEntry.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/classes/com/arjuna/mwlabs/wscf/protocols/ProtocolEntry.java 2010-05-14 08:05:22 UTC (rev 32882)
+++ labs/jbosstm/trunk/XTS/WSCF/classes/com/arjuna/mwlabs/wscf/protocols/ProtocolEntry.java 2010-05-14 08:16:48 UTC (rev 32883)
@@ -49,23 +49,7 @@
public ProtocolEntry (org.w3c.dom.Document doc)
{
- _doc = doc;
- _implementation = null;
-
- org.w3c.dom.Element rootElement = _doc.getDocumentElement();
-
- _protocolType = DomUtil.getTextNode(rootElement, CoordinatorXSD.coordinatorType).getNodeValue();
-
- /*
- * Optional part of schema.
- */
-
- org.w3c.dom.Text name = DomUtil.getTextNode(rootElement, CoordinatorXSD.coordinatorName);
-
- if (name != null)
- _protocolName = name.getNodeValue();
- else
- _protocolName = null;
+ this(doc, null);
}
public ProtocolEntry (org.w3c.dom.Document doc, Object implementation)
Deleted: labs/jbosstm/trunk/XTS/WSCF/classes10/com/arjuna/mw/wscf/UserCoordinatorFactory.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/classes10/com/arjuna/mw/wscf/UserCoordinatorFactory.java 2010-05-14 08:05:22 UTC (rev 32882)
+++ labs/jbosstm/trunk/XTS/WSCF/classes10/com/arjuna/mw/wscf/UserCoordinatorFactory.java 2010-05-14 08:16:48 UTC (rev 32883)
@@ -1,171 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags.
- * See the copyright.txt in the distribution for a full listing
- * of individual contributors.
- * This copyrighted material is made available to anyone wishing to use,
- * modify, copy, or redistribute it subject to the terms and conditions
- * of the GNU Lesser General Public License, v. 2.1.
- * This program is distributed in the hope that it will be useful, but WITHOUT A
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
- * You should have received a copy of the GNU Lesser General Public License,
- * v.2.1 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA 02110-1301, USA.
- *
- * (C) 2005-2006,
- * @author JBoss Inc.
- */
-/*
- * Copyright (C) 2002,
- *
- * Arjuna Technologies Limited,
- * Newcastle upon Tyne,
- * Tyne and Wear,
- * UK.
- *
- * $Id: UserCoordinatorFactory.java,v 1.12 2005/05/19 12:13:20 nmcl Exp $
- */
-
-package com.arjuna.mw.wscf;
-
-import com.arjuna.mw.wscf.logging.wscfLogger;
-
-import com.arjuna.mw.wscf.common.CoordinatorXSD;
-
-import com.arjuna.mwlabs.wscf.utils.ProtocolLocator;
-
-import com.arjuna.mwlabs.wscf.UserCoordinatorImple;
-
-import com.arjuna.mw.wscf.protocols.*;
-import com.arjuna.mw.wscf.utils.*;
-
-import com.arjuna.mw.wscf.exceptions.ProtocolNotRegisteredException;
-
-import com.arjuna.mw.wsas.exceptions.SystemException;
-
-import java.util.HashMap;
-
-import java.io.FileNotFoundException;
-
-/**
- * The factory which returns the UserCoordinator implementation to use.
- *
- * @author Mark Little (mark.little at arjuna.com)
- * @version $Id: UserCoordinatorFactory.java,v 1.12 2005/05/19 12:13:20 nmcl Exp $
- * @since 1.0.
- */
-
-public class UserCoordinatorFactory
-{
-
- /**
- * @exception ProtocolNotRegisteredException Thrown if the default
- * protocol is not available.
- *
- * @return the UserCoordinator implementation to use. The default
- * coordination protocol is used (two-phase commit) with its
- * associated implementation.
- *
- * @message com.arjuna.mw.wscf.UCF_1 [com.arjuna.mw.wscf.UCF_1] - Failed to create {0} doc!
- */
-
- public static UserCoordinator userCoordinator () throws ProtocolNotRegisteredException, SystemException
- {
- try
- {
- ProtocolLocator pl = new ProtocolLocator(com.arjuna.mwlabs.wscf.model.as.coordinator.arjunacore.ArjunaCoreHLS.class);
- org.w3c.dom.Document doc = pl.getProtocol();
-
- if (doc == null)
- {
- wscfLogger.arjLoggerI18N.warn("com.arjuna.mw.wscf.UCF_1",
- new Object[]{com.arjuna.mwlabs.wscf.model.as.coordinator.arjunacore.ArjunaCoreHLS.class.getName()});
- }
- else
- return userCoordinator(doc);
- }
- catch (Exception ex)
- {
- ex.printStackTrace();
-
- throw new SystemException(ex.toString());
- }
-
- return null;
- }
-
- /**
- * Obtain a reference to a coordinator that implements the specified
- * protocol.
- *
- * @param protocol The XML definition of the type of
- * coordination protocol required.
- *
- * @exception ProtocolNotRegisteredException Thrown if the requested
- * protocol is not available.
- *
- * @return the UserCoordinator implementation to use.
- */
-
- /*
- * Have the type specified in XML. More data may be specified, which
- * can be passed to the implementation in the same way ObjectName was.
- */
-
- public static UserCoordinator userCoordinator (org.w3c.dom.Document protocol) throws ProtocolNotRegisteredException, SystemException
- {
- try
- {
- synchronized (_implementations)
- {
- org.w3c.dom.Text child = DomUtil.getTextNode(protocol, CoordinatorXSD.coordinatorType);
- String protocolType = child.getNodeValue();
- UserCoordinatorImple coord = (UserCoordinatorImple) _implementations.get(protocolType);
-
- if (coord == null)
- {
- Object implementation = _protocolManager.getProtocolImplementation(protocol);
-
- coord = new UserCoordinatorImple(implementation);
-
- _implementations.put(protocolType, coord);
- }
-
- return coord;
- }
- }
- catch (ProtocolNotRegisteredException ex)
- {
- throw ex;
- }
- catch (Exception ex)
- {
- ex.printStackTrace();
-
- throw new SystemException(ex.toString());
- }
- }
-
- private static ProtocolManager _protocolManager = ProtocolRegistry.sharedManager();
- private static HashMap _implementations = new HashMap();
-
- static
- {
- try
- {
- com.arjuna.mw.wsas.utils.Configuration.initialise("/wscf.xml");
- }
- catch (FileNotFoundException ex)
- {
- }
- catch (Exception ex)
- {
- throw new ExceptionInInitializerError(ex.toString());
- }
- }
-
-}
-
Modified: labs/jbosstm/trunk/XTS/WSCF/classes10/com/arjuna/mw/wscf/protocols/ProtocolManager.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/classes10/com/arjuna/mw/wscf/protocols/ProtocolManager.java 2010-05-14 08:05:22 UTC (rev 32882)
+++ labs/jbosstm/trunk/XTS/WSCF/classes10/com/arjuna/mw/wscf/protocols/ProtocolManager.java 2010-05-14 08:16:48 UTC (rev 32883)
@@ -35,8 +35,6 @@
import com.arjuna.mw.wscf.common.Environment;
-import com.arjuna.mwlabs.wscf.protocols.Initializer;
-
import com.arjuna.mw.wscf.utils.CoordinationXML;
import com.arjuna.mwlabs.wscf.utils.ProtocolLocator;
@@ -404,7 +402,7 @@
try
{
- Initializer init = new Initializer(this);
+ com.arjuna.mw.wsas.utils.Configuration.initialise("/wscf.xml");
}
catch (Exception ex)
{
Modified: labs/jbosstm/trunk/XTS/WSCF/classes10/com/arjuna/mwlabs/wscf/model/sagas/arjunacore/SagasHLSImple.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/classes10/com/arjuna/mwlabs/wscf/model/sagas/arjunacore/SagasHLSImple.java 2010-05-14 08:05:22 UTC (rev 32882)
+++ labs/jbosstm/trunk/XTS/WSCF/classes10/com/arjuna/mwlabs/wscf/model/sagas/arjunacore/SagasHLSImple.java 2010-05-14 08:16:48 UTC (rev 32883)
@@ -218,7 +218,7 @@
}
}
else
- return new com.arjuna.mwlabs.wscf.model.sagas.arjunacore.context.soap.ArjunaContextImple(_coordManager.currentCoordinator());
+ throw new SystemException("SAGAS context implementation must be specified by setting environment property " + Environment.SAGAS_CONTEXT);
}
/**
Modified: labs/jbosstm/trunk/XTS/WSCF/classes10/com/arjuna/mwlabs/wscf/model/twophase/arjunacore/TwoPhaseHLSImple.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/classes10/com/arjuna/mwlabs/wscf/model/twophase/arjunacore/TwoPhaseHLSImple.java 2010-05-14 08:05:22 UTC (rev 32882)
+++ labs/jbosstm/trunk/XTS/WSCF/classes10/com/arjuna/mwlabs/wscf/model/twophase/arjunacore/TwoPhaseHLSImple.java 2010-05-14 08:16:48 UTC (rev 32883)
@@ -217,8 +217,7 @@
}
}
else
- return new com.arjuna.mwlabs.wscf.model.twophase.arjunacore.context.soap.ArjunaContextImple(
- _coordManager.currentCoordinator());
+ throw new SystemException("Two Phase context implementation must be specified by setting environment property " + Environment.TWO_PHASE_CONTEXT);
}
/**
Deleted: labs/jbosstm/trunk/XTS/WSCF/classes11/com/arjuna/mw/wscf11/UserCoordinatorFactory.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/classes11/com/arjuna/mw/wscf11/UserCoordinatorFactory.java 2010-05-14 08:05:22 UTC (rev 32882)
+++ labs/jbosstm/trunk/XTS/WSCF/classes11/com/arjuna/mw/wscf11/UserCoordinatorFactory.java 2010-05-14 08:16:48 UTC (rev 32883)
@@ -1,171 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags.
- * See the copyright.txt in the distribution for a full listing
- * of individual contributors.
- * This copyrighted material is made available to anyone wishing to use,
- * modify, copy, or redistribute it subject to the terms and conditions
- * of the GNU Lesser General Public License, v. 2.1.
- * This program is distributed in the hope that it will be useful, but WITHOUT A
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
- * You should have received a copy of the GNU Lesser General Public License,
- * v.2.1 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA 02110-1301, USA.
- *
- * (C) 2005-2006,
- * @author JBoss Inc.
- */
-/*
- * Copyright (C) 2002,
- *
- * Arjuna Technologies Limited,
- * Newcastle upon Tyne,
- * Tyne and Wear,
- * UK.
- *
- * $Id: UserCoordinatorFactory.java,v 1.12 2005/05/19 12:13:20 nmcl Exp $
- */
-
-package com.arjuna.mw.wscf11;
-
-import com.arjuna.mw.wscf.logging.wscfLogger;
-
-import com.arjuna.mw.wscf.common.CoordinatorXSD;
-
-import com.arjuna.mwlabs.wscf.utils.ProtocolLocator;
-
-import com.arjuna.mwlabs.wscf.UserCoordinatorImple;
-
-import com.arjuna.mw.wscf11.protocols.*;
-import com.arjuna.mw.wscf.utils.*;
-
-import com.arjuna.mw.wscf.exceptions.ProtocolNotRegisteredException;
-import com.arjuna.mw.wscf.UserCoordinator;
-
-import com.arjuna.mw.wsas.exceptions.SystemException;
-
-import java.util.HashMap;
-
-import java.io.FileNotFoundException;
-
-/**
- * The factory which returns the UserCoordinator implementation to use.
- *
- * @author Mark Little (mark.little at arjuna.com)
- * @version $Id: UserCoordinatorFactory.java,v 1.12 2005/05/19 12:13:20 nmcl Exp $
- * @since 1.0.
- */
-
-public class UserCoordinatorFactory
-{
-
- /**
- * @exception com.arjuna.mw.wscf.exceptions.ProtocolNotRegisteredException Thrown if the default
- * protocol is not available.
- *
- * @return the UserCoordinator implementation to use. The default
- * coordination protocol is used (two-phase commit) with its
- * associated implementation.
- *
- * @message com.arjuna.mw.wscf11.UCF_1 [com.arjuna.mw.wscf11.UCF_1] - Failed to create {0} doc!
- */
-
- public static UserCoordinator userCoordinator () throws ProtocolNotRegisteredException, SystemException
- {
- try
- {
- ProtocolLocator pl = new ProtocolLocator(com.arjuna.mwlabs.wscf.model.as.coordinator.arjunacore.ArjunaCoreHLS.class);
- org.w3c.dom.Document doc = pl.getProtocol();
-
- if (doc == null)
- {
- wscfLogger.arjLoggerI18N.warn("com.arjuna.mw.wscf11.UCF_1",
- new Object[]{com.arjuna.mwlabs.wscf.model.as.coordinator.arjunacore.ArjunaCoreHLS.class.getName()});
- }
- else
- return userCoordinator(doc);
- }
- catch (Exception ex)
- {
- ex.printStackTrace();
-
- throw new SystemException(ex.toString());
- }
-
- return null;
- }
-
- /**
- * Obtain a reference to a coordinator that implements the specified
- * protocol.
- *
- * @param protocol The XML definition of the type of
- * coordination protocol required.
- *
- * @exception com.arjuna.mw.wscf.exceptions.ProtocolNotRegisteredException Thrown if the requested
- * protocol is not available.
- *
- * @return the UserCoordinator implementation to use.
- */
-
- /*
- * Have the type specified in XML. More data may be specified, which
- * can be passed to the implementation in the same way ObjectName was.
- */
-
- public static UserCoordinator userCoordinator (org.w3c.dom.Document protocol) throws ProtocolNotRegisteredException, SystemException
- {
- try
- {
- synchronized (_implementations)
- {
- org.w3c.dom.Text child = DomUtil.getTextNode(protocol, CoordinatorXSD.coordinatorType);
- String protocolType = child.getNodeValue();
- UserCoordinatorImple coord = (UserCoordinatorImple) _implementations.get(protocolType);
-
- if (coord == null)
- {
- Object implementation = _protocolManager.getProtocolImplementation(protocol);
-
- coord = new UserCoordinatorImple(implementation);
-
- _implementations.put(protocolType, coord);
- }
-
- return coord;
- }
- }
- catch (ProtocolNotRegisteredException ex)
- {
- throw ex;
- }
- catch (Exception ex)
- {
- ex.printStackTrace();
-
- throw new SystemException(ex.toString());
- }
- }
-
- private static ProtocolManager _protocolManager = ProtocolRegistry.sharedManager();
- private static HashMap _implementations = new HashMap();
-
- static
- {
- try
- {
- com.arjuna.mw.wsas.utils.Configuration.initialise("/wscf.xml");
- }
- catch (FileNotFoundException ex)
- {
- }
- catch (Exception ex)
- {
- throw new ExceptionInInitializerError(ex.toString());
- }
- }
-
-}
\ No newline at end of file
Modified: labs/jbosstm/trunk/XTS/WSCF/classes11/com/arjuna/mw/wscf11/protocols/ProtocolManager.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/classes11/com/arjuna/mw/wscf11/protocols/ProtocolManager.java 2010-05-14 08:05:22 UTC (rev 32882)
+++ labs/jbosstm/trunk/XTS/WSCF/classes11/com/arjuna/mw/wscf11/protocols/ProtocolManager.java 2010-05-14 08:16:48 UTC (rev 32883)
@@ -395,7 +395,7 @@
try
{
- Initializer init = new Initializer(this);
+ com.arjuna.mw.wsas.utils.Configuration.initialise("/wscf11.xml");
}
catch (Exception ex)
{
Deleted: labs/jbosstm/trunk/XTS/WSCF/classes11/com/arjuna/mwlabs/wscf11/protocols/Initializer.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/classes11/com/arjuna/mwlabs/wscf11/protocols/Initializer.java 2010-05-14 08:05:22 UTC (rev 32882)
+++ labs/jbosstm/trunk/XTS/WSCF/classes11/com/arjuna/mwlabs/wscf11/protocols/Initializer.java 2010-05-14 08:16:48 UTC (rev 32883)
@@ -1,99 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags.
- * See the copyright.txt in the distribution for a full listing
- * of individual contributors.
- * This copyrighted material is made available to anyone wishing to use,
- * modify, copy, or redistribute it subject to the terms and conditions
- * of the GNU Lesser General Public License, v. 2.1.
- * This program is distributed in the hope that it will be useful, but WITHOUT A
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
- * You should have received a copy of the GNU Lesser General Public License,
- * v.2.1 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA 02110-1301, USA.
- *
- * (C) 2005-2006,
- * @author JBoss Inc.
- */
-/*
- * Copyright (C) 2002,
- *
- * Arjuna Technologies Limited,
- * Newcastle upon Tyne,
- * Tyne and Wear,
- * UK.
- *
- * $Id: Initializer.java,v 1.7 2005/05/19 12:13:39 nmcl Exp $
- */
-
-package com.arjuna.mwlabs.wscf11.protocols;
-
-import com.arjuna.mw.wsas.exceptions.SystemException;
-import com.arjuna.mw.wscf.logging.wscfLogger;
-import com.arjuna.mw.wscf11.protocols.ProtocolManager;
-import com.arjuna.mwlabs.wscf.utils.ProtocolLocator;
-
-/**
- * Register all of the default coordination protocols with the system.
- *
- * @author Mark Little (mark.little at arjuna.com)
- * @version $Id: Initializer.java,v 1.7 2005/05/19 12:13:39 nmcl Exp $
- * @since 1.0.
- */
-
-public class Initializer
-{
-
- public Initializer(ProtocolManager manager) throws SystemException
- {
- _manager = null;
-
- try
- {
- com.arjuna.mw.wsas.utils.Configuration.initialise("/wscf11.xml");
- }
- catch (java.io.FileNotFoundException ex)
- {
- }
- catch (Exception ex)
- {
- }
- }
-
- /**
- * @message com.arjuna.mwlabs.wscf11.protocols.Initializer_1 [com.arjuna.mwlabs.wscf11.protocols.Initializer_1] - Failed to create:
- */
-
- private final void addProtocol (String impl) throws SystemException
- {
- try
- {
- // add in ArjunaCore support
-
- Class clazz = this.getClass().getClassLoader().loadClass(impl);
- ProtocolLocator pl = new ProtocolLocator(clazz);
- org.w3c.dom.Document doc = pl.getProtocol();
-
- if (doc == null)
- {
- throw new SystemException(wscfLogger.arjLoggerI18N.getString("com.arjuna.mwlabs.wscf11.protocols.Initializer_1")+impl);
- }
- else
- {
- _manager.addProtocol(doc, impl);
- }
- }
- catch (Exception ex)
- {
- ex.printStackTrace();
-
- throw new SystemException(ex.toString());
- }
- }
-
- private ProtocolManager _manager;
-
-}
\ No newline at end of file
Deleted: labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf/tests/DemoParticipant.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf/tests/DemoParticipant.java 2010-05-14 08:05:22 UTC (rev 32882)
+++ labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf/tests/DemoParticipant.java 2010-05-14 08:16:48 UTC (rev 32883)
@@ -1,151 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags.
- * See the copyright.txt in the distribution for a full listing
- * of individual contributors.
- * This copyrighted material is made available to anyone wishing to use,
- * modify, copy, or redistribute it subject to the terms and conditions
- * of the GNU Lesser General Public License, v. 2.1.
- * This program is distributed in the hope that it will be useful, but WITHOUT A
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
- * You should have received a copy of the GNU Lesser General Public License,
- * v.2.1 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA 02110-1301, USA.
- *
- * (C) 2005-2006,
- * @author JBoss Inc.
- */
-/*
- * Copyright (C) 2002,
- *
- * Arjuna Technologies Limited,
- * Newcastle upon Tyne,
- * Tyne and Wear,
- * UK.
- *
- * $Id: DemoParticipant.java,v 1.4 2004/03/15 13:25:14 nmcl Exp $
- */
-
-package com.arjuna.wscf.tests;
-
-import com.arjuna.ats.arjuna.coordinator.*;
-import com.arjuna.ats.arjuna.common.*;
-import com.arjuna.ats.arjuna.state.*;
-
-import com.arjuna.mw.wsas.activity.Outcome;
-
-import com.arjuna.mw.wscf.model.as.coordinator.Participant;
-
-import com.arjuna.mw.wscf.model.as.coordinator.Message;
-
-import com.arjuna.mw.wscf.model.as.coordinator.twophase.outcomes.*;
-import com.arjuna.mw.wscf.model.as.coordinator.twophase.messages.*;
-
-import com.arjuna.mw.wscf.model.twophase.outcomes.*;
-
-import com.arjuna.mw.wsas.exceptions.SystemException;
-import com.arjuna.mw.wsas.exceptions.WrongStateException;
-import com.arjuna.mw.wsas.exceptions.ProtocolViolationException;
-
-/**
- * @author Mark Little (mark.little at arjuna.com)
- * @version $Id: DemoParticipant.java,v 1.4 2004/03/15 13:25:14 nmcl Exp $
- * @since 1.0.
- */
-
-public class DemoParticipant implements Participant
-{
-
- public DemoParticipant ()
- {
- this(true);
- }
-
- public DemoParticipant (boolean readonly)
- {
- _readonly = readonly;
- _id = new Uid();
- }
-
- public Outcome processMessage (Message notification) throws WrongStateException, ProtocolViolationException, SystemException
- {
- System.out.println("DemoParticipant.processMessage ( "+notification+" ) : "+_id);
-
- if ((notification instanceof NestedPrepare) || (notification instanceof TopLevelPrepare))
- {
- if (_readonly)
- {
- System.out.println("\nReturning read-only");
-
- return new VoteReadOnly();
- }
- else
- {
- System.out.println("\nReturning commit");
-
- return new VoteConfirm();
- }
- }
- else
- {
- if ((notification instanceof NestedConfirm) || (notification instanceof TopLevelConfirm))
- {
- System.out.println("\nReturning finish-ok");
-
- return new CoordinationOutcome(TwoPhaseOutcome.FINISH_OK);
- }
- else
- {
- if ((notification instanceof NestedCancel) || (notification instanceof TopLevelCancel))
- {
- System.out.println("\nReturning finish-ok");
-
- return new CoordinationOutcome(TwoPhaseOutcome.FINISH_OK);
- }
- else
- {
- if ((notification instanceof TopLevelOnePhaseCommit) || (notification instanceof NestedOnePhaseCommit))
- {
- System.out.println("\nOne-phase commit ok");
-
- return new CoordinationOutcome(TwoPhaseOutcome.FINISH_OK);
- }
- else
- {
- System.out.println("\nReturning finish-error");
-
- return new CoordinationOutcome(TwoPhaseOutcome.FINISH_ERROR);
- }
- }
- }
- }
- }
-
- public String identity () throws SystemException
- {
- return "DemoParticipant: "+_id;
- }
-
- /**
- * These methods are required so that the coordinator can serialise and
- * de-serialise information about the inferior during completion and
- * recovery.
- */
-
- public boolean packState (OutputObjectState os)
- {
- return true;
- }
-
- public boolean unpackState (InputObjectState os)
- {
- return true;
- }
-
- private boolean _readonly;
- private Uid _id;
-
-}
Deleted: labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf/tests/DemoXAParticipant.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf/tests/DemoXAParticipant.java 2010-05-14 08:05:22 UTC (rev 32882)
+++ labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf/tests/DemoXAParticipant.java 2010-05-14 08:16:48 UTC (rev 32883)
@@ -1,171 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags.
- * See the copyright.txt in the distribution for a full listing
- * of individual contributors.
- * This copyrighted material is made available to anyone wishing to use,
- * modify, copy, or redistribute it subject to the terms and conditions
- * of the GNU Lesser General Public License, v. 2.1.
- * This program is distributed in the hope that it will be useful, but WITHOUT A
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
- * You should have received a copy of the GNU Lesser General Public License,
- * v.2.1 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA 02110-1301, USA.
- *
- * (C) 2005-2006,
- * @author JBoss Inc.
- */
-/*
- * Copyright (C) 2002,
- *
- * Arjuna Technologies Limited,
- * Newcastle upon Tyne,
- * Tyne and Wear,
- * UK.
- *
- * $Id: DemoXAParticipant.java,v 1.4 2004/03/15 13:25:14 nmcl Exp $
- */
-
-package com.arjuna.wscf.tests;
-
-import com.arjuna.ats.arjuna.common.*;
-import com.arjuna.ats.arjuna.state.*;
-
-import com.arjuna.mw.wsas.completionstatus.Failure;
-
-import com.arjuna.mw.wsas.activity.Outcome;
-
-import com.arjuna.mw.wscf.model.as.coordinator.Participant;
-import com.arjuna.mw.wscf.model.as.coordinator.Message;
-
-import com.arjuna.mw.wscf.model.as.coordinator.xa.outcomes.*;
-import com.arjuna.mw.wscf.model.as.coordinator.xa.messages.*;
-
-import com.arjuna.mw.wsas.exceptions.SystemException;
-import com.arjuna.mw.wsas.exceptions.WrongStateException;
-import com.arjuna.mw.wsas.exceptions.ProtocolViolationException;
-
-import javax.transaction.xa.*;
-
-import java.util.Hashtable;
-
-/**
- * @author Mark Little (mark.little at arjuna.com)
- * @version $Id: DemoXAParticipant.java,v 1.4 2004/03/15 13:25:14 nmcl Exp $
- * @since 1.0.
- */
-
-public class DemoXAParticipant implements Participant
-{
-
- public DemoXAParticipant ()
- {
- this(true);
- }
-
- public DemoXAParticipant (boolean readonly)
- {
- _readonly = readonly;
- _id = new Uid();
- }
-
- public Outcome processMessage (Message notification) throws WrongStateException, ProtocolViolationException, SystemException
- {
- System.out.println("DemoXAParticipant.processMessage ( "+notification+" ) : "+_id);
-
- if (notification instanceof XAPrepare)
- {
- if (_readonly)
- {
- System.out.println("\nReturning read-only to prepare");
-
- return new XAPrepareOutcome(XAResource.XA_RDONLY);
- }
- else
- {
- System.out.println("\nReturning commit to prepare");
-
- return new XAPrepareOutcome(XAResource.XA_OK);
- }
- }
- else
- {
- if (notification instanceof XACommit)
- {
- if (((XACommit) notification).onePhaseCommit())
- {
- System.out.println("\nOne-phase commit ok");
-
- return new XAOutcome();
- }
- else
- {
- System.out.println("\nCommit ok");
-
- return new XAOutcome();
- }
- }
- else
- {
- if (notification instanceof XAStart)
- {
- System.out.println("\nStarting ok");
-
- return new XAOutcome();
- }
- else
- {
- if (notification instanceof XAEnd)
- {
- System.out.println("\nEnding ok");
-
- return new XAOutcome();
- }
- else
- {
- if (notification instanceof XARollback)
- {
- System.out.println("\nRolling back ok");
-
- return new XAOutcome(Failure.instance());
- }
- else
- {
- System.out.println("\nReturning finish-error for "+notification);
-
- return new XAOutcome(new XAException(XAException.XAER_INVAL));
- }
- }
- }
- }
- }
- }
-
- public String identity () throws SystemException
- {
- return "DemoXAParticipant: "+_id;
- }
-
- /**
- * These methods are required so that the coordinator can serialise and
- * de-serialise information about the inferior during completion and
- * recovery.
- */
-
- public boolean packState (OutputObjectState os)
- {
- return true;
- }
-
- public boolean unpackState (InputObjectState os)
- {
- return true;
- }
-
- private boolean _readonly;
- private Uid _id;
-
-}
Deleted: labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf/tests/DemoXAResource.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf/tests/DemoXAResource.java 2010-05-14 08:05:22 UTC (rev 32882)
+++ labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf/tests/DemoXAResource.java 2010-05-14 08:16:48 UTC (rev 32883)
@@ -1,103 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags.
- * See the copyright.txt in the distribution for a full listing
- * of individual contributors.
- * This copyrighted material is made available to anyone wishing to use,
- * modify, copy, or redistribute it subject to the terms and conditions
- * of the GNU Lesser General Public License, v. 2.1.
- * This program is distributed in the hope that it will be useful, but WITHOUT A
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
- * You should have received a copy of the GNU Lesser General Public License,
- * v.2.1 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA 02110-1301, USA.
- *
- * (C) 2005-2006,
- * @author JBoss Inc.
- */
-/*
- * Copyright (C) 2002,
- *
- * Arjuna Technologies Limited,
- * Newcastle upon Tyne,
- * Tyne and Wear,
- * UK.
- *
- * $Id: DemoXAResource.java,v 1.1 2003/01/07 10:37:17 nmcl Exp $
- */
-
-package com.arjuna.wscf.tests;
-
-import javax.transaction.xa.*;
-
-public class DemoXAResource implements XAResource
-{
-
- public DemoXAResource ()
- {
- }
-
- public void commit (Xid xid, boolean onePhase) throws XAException
- {
- System.out.println("DemoXAResource.commit "+xid);
- }
-
- public void end (Xid xid, int flags) throws XAException
- {
- System.out.println("DemoXAResource.end "+xid);
- }
-
- public void forget (Xid xid) throws XAException
- {
- System.out.println("DemoXAResource.forget "+xid);
- }
-
- public int getTransactionTimeout () throws XAException
- {
- System.out.println("DemoXAResource.getTransactionTimeout");
-
- return 0;
- }
-
- public int prepare (Xid xid) throws XAException
- {
- System.out.println("DemoXAResource.prepare "+xid);
-
- return XAResource.XA_OK;
- }
-
- public Xid[] recover (int flag) throws XAException
- {
- System.out.println("DemoXAResource.recover "+flag);
-
- return null;
- }
-
- public void rollback (Xid xid) throws XAException
- {
- System.out.println("DemoXAResource.rollback "+xid);
- }
-
- public boolean setTransactionTimeout (int seconds) throws XAException
- {
- System.out.println("DemoXAResource.setTransactionTimeout "+seconds);
-
- return true;
- }
-
- public void start (Xid xid, int flags) throws XAException
- {
- System.out.println("DemoXAResource.start "+xid);
- }
-
- public boolean isSameRM (XAResource xares) throws XAException
- {
- System.out.println("DemoXAResource.isSameRM "+xares);
-
- return (xares == this);
- }
-
-}
Deleted: labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf/tests/FailureParticipant.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf/tests/FailureParticipant.java 2010-05-14 08:05:22 UTC (rev 32882)
+++ labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf/tests/FailureParticipant.java 2010-05-14 08:16:48 UTC (rev 32883)
@@ -1,192 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags.
- * See the copyright.txt in the distribution for a full listing
- * of individual contributors.
- * This copyrighted material is made available to anyone wishing to use,
- * modify, copy, or redistribute it subject to the terms and conditions
- * of the GNU Lesser General Public License, v. 2.1.
- * This program is distributed in the hope that it will be useful, but WITHOUT A
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
- * You should have received a copy of the GNU Lesser General Public License,
- * v.2.1 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA 02110-1301, USA.
- *
- * (C) 2005-2006,
- * @author JBoss Inc.
- */
-/*
- * Copyright (C) 2002,
- *
- * Arjuna Technologies Limited,
- * Newcastle upon Tyne,
- * Tyne and Wear,
- * UK.
- *
- * $Id: FailureParticipant.java,v 1.4 2004/03/15 13:25:14 nmcl Exp $
- */
-
-package com.arjuna.wscf.tests;
-
-import com.arjuna.ats.arjuna.coordinator.*;
-import com.arjuna.ats.arjuna.common.*;
-import com.arjuna.ats.arjuna.state.*;
-
-import com.arjuna.mw.wsas.activity.Outcome;
-
-import com.arjuna.mw.wscf.model.as.coordinator.Participant;
-import com.arjuna.mw.wscf.model.as.coordinator.Message;
-
-import com.arjuna.mw.wscf.model.as.coordinator.twophase.outcomes.*;
-import com.arjuna.mw.wscf.model.as.coordinator.twophase.messages.*;
-
-import com.arjuna.mw.wscf.model.twophase.outcomes.*;
-
-import com.arjuna.mw.wsas.exceptions.SystemException;
-import com.arjuna.mw.wsas.exceptions.WrongStateException;
-import com.arjuna.mw.wsas.exceptions.ProtocolViolationException;
-
-/**
- * @author Mark Little (mark.little at arjuna.com)
- * @version $Id: FailureParticipant.java,v 1.4 2004/03/15 13:25:14 nmcl Exp $
- * @since 1.0.
- */
-
-public class FailureParticipant implements Participant
-{
-
- public static final int NESTED_PREPARE = 0;
- public static final int NESTED_CONFIRM = 1;
- public static final int NESTED_CANCEL = 2;
- public static final int TOPLEVEL_PREPARE = 3;
- public static final int TOPLEVEL_CONFIRM = 4;
- public static final int TOPLEVEL_CANCEL = 5;
-
- public FailureParticipant (int failure)
- {
- this(true, failure);
- }
-
- public FailureParticipant (boolean readonly, int failure)
- {
- _readonly = readonly;
- _id = new Uid();
- _failurePoint = failure;
- }
-
- public Outcome processMessage (Message notification) throws WrongStateException, ProtocolViolationException, SystemException
- {
- System.out.println("FailureParticipant.processMessage ( "+notification+" ) : "+_id);
-
- if ((notification instanceof NestedPrepare) || (notification instanceof TopLevelPrepare))
- {
- if ((_failurePoint == NESTED_PREPARE) && (notification instanceof NestedPrepare))
- {
- System.out.println("\nReturning cancel");
-
- return new VoteCancel();
- }
-
- if ((_failurePoint == TOPLEVEL_PREPARE) && (notification instanceof TopLevelPrepare))
- {
- System.out.println("\nReturning cancel");
-
- return new VoteCancel();
- }
-
- if (_readonly)
- {
- System.out.println("\nReturning read-only");
-
- return new VoteReadOnly();
- }
- else
- {
- System.out.println("\nReturning commit");
-
- return new VoteConfirm();
- }
- }
- else
- {
- if ((notification instanceof NestedConfirm) || (notification instanceof TopLevelConfirm))
- {
- if ((_failurePoint == NESTED_CONFIRM) && (notification instanceof NestedConfirm))
- {
- System.out.println("\nReturning finish-error");
-
- return new CoordinationOutcome(TwoPhaseOutcome.FINISH_ERROR);
- }
-
- if ((_failurePoint == TOPLEVEL_CONFIRM) && (notification instanceof TopLevelConfirm))
- {
- System.out.println("\nReturning finish-error");
-
- return new CoordinationOutcome(TwoPhaseOutcome.FINISH_ERROR);
- }
-
- System.out.println("\nReturning finish-ok");
-
- return new CoordinationOutcome(TwoPhaseOutcome.FINISH_OK);
- }
- else
- {
- if ((notification instanceof NestedCancel) || (notification instanceof TopLevelCancel))
- {
- if ((_failurePoint == NESTED_CANCEL) && (notification instanceof NestedCancel))
- {
- System.out.println("\nReturning finish-error");
-
- return new CoordinationOutcome(TwoPhaseOutcome.FINISH_ERROR);
- }
-
- if ((_failurePoint == TOPLEVEL_CANCEL) && (notification instanceof TopLevelCancel))
- {
- System.out.println("\nReturning finish-error");
-
- return new CoordinationOutcome(TwoPhaseOutcome.FINISH_ERROR);
- }
-
- System.out.println("\nReturning finish-ok");
-
- return new CoordinationOutcome(TwoPhaseOutcome.FINISH_OK);
- }
- else
- {
- System.out.println("\nReturning finish-error");
-
- return new CoordinationOutcome(TwoPhaseOutcome.FINISH_ERROR);
- }
- }
- }
- }
-
- public String identity () throws SystemException
- {
- return "FailureParticipant: "+_id;
- }
-
- /**
- * These methods are required so that the coordinator can serialise and
- * de-serialise information about the inferior during completion and
- * recovery.
- */
-
- public boolean packState (OutputObjectState os)
- {
- return true;
- }
-
- public boolean unpackState (InputObjectState os)
- {
- return true;
- }
-
- private boolean _readonly;
- private Uid _id;
- private int _failurePoint;
-
-}
Deleted: labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf/tests/JTASynchronization.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf/tests/JTASynchronization.java 2010-05-14 08:05:22 UTC (rev 32882)
+++ labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf/tests/JTASynchronization.java 2010-05-14 08:16:48 UTC (rev 32883)
@@ -1,49 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags.
- * See the copyright.txt in the distribution for a full listing
- * of individual contributors.
- * This copyrighted material is made available to anyone wishing to use,
- * modify, copy, or redistribute it subject to the terms and conditions
- * of the GNU Lesser General Public License, v. 2.1.
- * This program is distributed in the hope that it will be useful, but WITHOUT A
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
- * You should have received a copy of the GNU Lesser General Public License,
- * v.2.1 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA 02110-1301, USA.
- *
- * (C) 2005-2006,
- * @author JBoss Inc.
- */
-/*
- * Copyright (C) 2002,
- *
- * Arjuna Technologies Limited,
- * Newcastle upon Tyne,
- * Tyne and Wear,
- * UK.
- *
- * $Id: JTASynchronization.java,v 1.1 2003/01/07 10:37:17 nmcl Exp $
- */
-
-package com.arjuna.wscf.tests;
-
-import javax.transaction.xa.*;
-
-public class JTASynchronization implements javax.transaction.Synchronization
-{
-
- public void beforeCompletion ()
- {
- System.out.println("beforeCompletion");
- }
-
- public void afterCompletion (int status)
- {
- System.out.println("afterCompletion :"+status);
- }
-
-}
Modified: labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf/tests/WSCFTestSuite.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf/tests/WSCFTestSuite.java 2010-05-14 08:05:22 UTC (rev 32882)
+++ labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf/tests/WSCFTestSuite.java 2010-05-14 08:16:48 UTC (rev 32883)
@@ -29,7 +29,7 @@
@RunWith(Suite.class)
@Suite.SuiteClasses({
- com.arjuna.wscf.tests.junit.model.twophase.StartEnd.class,
+// com.arjuna.wscf.tests.junit.model.twophase.StartEnd.class,
com.arjuna.wscf.tests.junit.model.twophase.BeginConfirm.class,
com.arjuna.wscf.tests.junit.model.twophase.BeginCancel.class,
com.arjuna.wscf.tests.junit.model.twophase.Suspend.class,
Modified: labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf/tests/WSCFTestUtils.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf/tests/WSCFTestUtils.java 2010-05-14 08:05:22 UTC (rev 32882)
+++ labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf/tests/WSCFTestUtils.java 2010-05-14 08:16:48 UTC (rev 32883)
@@ -19,17 +19,6 @@
}
}
- static public void cleanup(com.arjuna.mw.wscf.UserCoordinator ua)
- {
- try {
- while (ua.currentActivity() != null) {
- ua.end();
- }
- } catch (Exception e) {
- // do nothing -- caller will be dealing with exceptions
- }
- }
-
static public void cleanup(com.arjuna.mw.wscf.model.twophase.api.CoordinatorManager cm)
{
try {
Deleted: labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf/tests/junit/model/twophase/StartEnd.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf/tests/junit/model/twophase/StartEnd.java 2010-05-14 08:05:22 UTC (rev 32882)
+++ labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf/tests/junit/model/twophase/StartEnd.java 2010-05-14 08:16:48 UTC (rev 32883)
@@ -1,105 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags.
- * See the copyright.txt in the distribution for a full listing
- * of individual contributors.
- * This copyrighted material is made available to anyone wishing to use,
- * modify, copy, or redistribute it subject to the terms and conditions
- * of the GNU Lesser General Public License, v. 2.1.
- * This program is distributed in the hope that it will be useful, but WITHOUT A
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
- * You should have received a copy of the GNU Lesser General Public License,
- * v.2.1 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA 02110-1301, USA.
- *
- * (C) 2005-2006,
- * @author JBoss Inc.
- */
-/*
- * Copyright (C) 2002,
- *
- * Arjuna Technologies Limited,
- * Newcastle upon Tyne,
- * Tyne and Wear,
- * UK.
- *
- * $Id: StartEnd.java,v 1.3 2003/03/14 14:26:34 nmcl Exp $
- */
-
-package com.arjuna.wscf.tests.junit.model.twophase;
-
-import com.arjuna.mwlabs.wscf.utils.ProtocolLocator;
-
-import com.arjuna.mw.wscf.UserCoordinator;
-import com.arjuna.mw.wscf.UserCoordinatorFactory;
-
-import com.arjuna.mw.wscf.model.twophase.common.*;
-import com.arjuna.mw.wscf.model.twophase.outcomes.*;
-
-import com.arjuna.mw.wsas.activity.*;
-
-import com.arjuna.mw.wsas.exceptions.NoActivityException;
-import com.arjuna.wscf.tests.WSCFTestUtils;
-
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-import static org.junit.Assert.*;
-
-/**
- * @author Mark Little (mark.little at arjuna.com)
- * @version $Id: StartEnd.java,v 1.3 2003/03/14 14:26:34 nmcl Exp $
- * @since 1.0.
- */
-
-public class StartEnd
-{
- @Test
- public void testStartEnd()
- throws Exception
- {
- System.out.println("Running test : " + this.getClass().getName());
-
- String className = "com.arjuna.mwlabs.wscf.model.twophase.arjunacore.TwoPhaseHLSImple";
- org.w3c.dom.Document implementationDoc = null;
-
- // System.setProperty("com.arjuna.mw.wscf.protocolImplementation", className);
-
- Class clazz = this.getClass().getClassLoader().loadClass(className);
- ProtocolLocator pl = new ProtocolLocator(clazz);
-
- implementationDoc = pl.getProtocol();
-
- UserCoordinator ua = UserCoordinatorFactory.userCoordinator(implementationDoc);
-
- try
- {
- ua.start();
-
- System.out.println("Started: "+ua.activityName()+"\n");
-
- Outcome res = ua.end();
-
- if (res instanceof CoordinationOutcome)
- {
- CoordinationOutcome co = (CoordinationOutcome) res;
- int result = co.result();
-
- if (result != TwoPhaseResult.CANCELLED)
- fail("expected result \"CANCELLED\" (" + TwoPhaseResult.CANCELLED + ") but got " + result);
- }
- }
- catch (NoActivityException ex)
- {
- // why is it ok to get here?;
- }
- catch (Exception ex)
- {
- WSCFTestUtils.cleanup(ua);
- throw ex;
- }
- }
-}
Added: labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/SagasParticipant.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/SagasParticipant.java (rev 0)
+++ labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/SagasParticipant.java 2010-05-14 08:16:48 UTC (rev 32883)
@@ -0,0 +1,105 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags.
+ * See the copyright.txt in the distribution for a full listing
+ * of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (C) 2002,
+ *
+ * Arjuna Technologies Limited,
+ * Newcastle upon Tyne,
+ * Tyne and Wear,
+ * UK.
+ *
+ * $Id: TwoPhaseParticipant.java,v 1.3 2005/01/15 21:21:06 kconner Exp $
+ */
+
+package com.arjuna.wscf11.tests;
+
+import com.arjuna.ats.arjuna.state.InputObjectState;
+import com.arjuna.ats.arjuna.state.OutputObjectState;
+import com.arjuna.mw.wsas.exceptions.SystemException;
+import com.arjuna.mw.wsas.exceptions.WrongStateException;
+import com.arjuna.mw.wscf.exceptions.InvalidParticipantException;
+import com.arjuna.mw.wscf.model.sagas.exceptions.CompensateFailedException;
+import com.arjuna.mw.wscf.model.sagas.participants.Participant;
+import com.arjuna.mw.wscf.model.sagas.participants.ParticipantWithComplete;
+
+import java.io.IOException;
+
+/**
+ * @author Mark Little (mark.little at arjuna.com)
+ * @version $Id: TwoPhaseParticipant.java,v 1.3 2005/01/15 21:21:06 kconner Exp $
+ * @since 1.0.
+ */
+
+public class SagasParticipant implements ParticipantWithComplete
+{
+ public SagasParticipant(String id)
+ {
+ _id = id;
+ }
+
+ public void close() throws InvalidParticipantException, WrongStateException, SystemException {
+ System.out.println("SagasParticipant.close");
+ }
+
+ public void cancel () throws InvalidParticipantException, InvalidParticipantException, WrongStateException, SystemException
+ {
+ System.out.println("SagasParticipant.cancel");
+ }
+
+ public void compensate() throws CompensateFailedException, InvalidParticipantException, WrongStateException, SystemException
+ {
+ System.out.println("SagasParticipant.compensate");
+ }
+
+ public void forget() throws InvalidParticipantException, WrongStateException, SystemException {
+ System.out.println("SagasParticipant.forget");
+ }
+
+ public void complete() throws InvalidParticipantException, WrongStateException, SystemException {
+ System.out.println("SagasParticipant.complete");
+ }
+ public String id () throws SystemException
+ {
+ return _id;
+ }
+
+ public boolean save_state(OutputObjectState os)
+ {
+ try {
+ os.packString(_id);
+ } catch (IOException ioe) {
+ return false;
+ }
+ return true ;
+ }
+
+ public boolean restore_state(InputObjectState os)
+ {
+ try {
+ _id = os.unpackString();
+ } catch (IOException e) {
+ return false;
+ }
+ return true ;
+ }
+
+ private String _id;
+}
\ No newline at end of file
Modified: labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/WSCF11TestSuite.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/WSCF11TestSuite.java 2010-05-14 08:05:22 UTC (rev 32882)
+++ labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/WSCF11TestSuite.java 2010-05-14 08:16:48 UTC (rev 32883)
@@ -29,7 +29,7 @@
@RunWith(Suite.class)
@Suite.SuiteClasses({
- com.arjuna.wscf11.tests.model.twophase.StartEnd.class,
+// com.arjuna.wscf11.tests.model.twophase.StartEnd.class,
com.arjuna.wscf11.tests.model.twophase.BeginConfirm.class,
com.arjuna.wscf11.tests.model.twophase.BeginCancel.class,
com.arjuna.wscf11.tests.model.twophase.Suspend.class,
@@ -40,7 +40,19 @@
com.arjuna.wscf11.tests.model.twophase.AddParticipant.class,
com.arjuna.wscf11.tests.model.twophase.SuspendParticipant.class,
com.arjuna.wscf11.tests.model.twophase.AddSynchronization.class,
- com.arjuna.wscf11.tests.model.twophase.ParticipantSynchronization.class
+ com.arjuna.wscf11.tests.model.twophase.ParticipantSynchronization.class,
+ com.arjuna.wscf11.tests.model.sagas.BeginClose.class,
+ com.arjuna.wscf11.tests.model.sagas.BeginCancel.class,
+ com.arjuna.wscf11.tests.model.sagas.Suspend.class,
+ com.arjuna.wscf11.tests.model.sagas.SuspendResume.class,
+ com.arjuna.wscf11.tests.model.sagas.SuspendClose.class,
+ com.arjuna.wscf11.tests.model.sagas.CancelOnlyCancel.class,
+ com.arjuna.wscf11.tests.model.sagas.CancelOnlyClose.class,
+ com.arjuna.wscf11.tests.model.sagas.ParticipantExitedClose.class,
+ com.arjuna.wscf11.tests.model.sagas.ParticipantCannotCompleteClose.class,
+ com.arjuna.wscf11.tests.model.sagas.ParticipantFaultedClose.class,
+ com.arjuna.wscf11.tests.model.sagas.AddParticipant.class,
+ com.arjuna.wscf11.tests.model.sagas.SuspendResumeMultiParticipant.class
})
public class WSCF11TestSuite
{
Modified: labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/WSCF11TestUtils.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/WSCF11TestUtils.java 2010-05-14 08:05:22 UTC (rev 32882)
+++ labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/WSCF11TestUtils.java 2010-05-14 08:16:48 UTC (rev 32883)
@@ -1,5 +1,7 @@
package com.arjuna.wscf11.tests;
+import com.arjuna.mw.wscf.model.sagas.api.UserCoordinator;
+
/**
* Created by IntelliJ IDEA.
* User: adinn
@@ -19,19 +21,19 @@
}
}
- static public void cleanup(com.arjuna.mw.wscf.UserCoordinator ua)
+ static public void cleanup(com.arjuna.mw.wscf.model.twophase.api.CoordinatorManager cm)
{
try {
- while (ua.currentActivity() != null) {
- ua.end();
+ while (cm.currentActivity() != null) {
+ cm.cancel();
}
} catch (Exception e) {
// do nothing -- caller will be dealing with exceptions
}
}
- static public void cleanup(com.arjuna.mw.wscf.model.twophase.api.CoordinatorManager cm)
- {
+
+ public static void cleanup(com.arjuna.mw.wscf.model.sagas.api.CoordinatorManager cm) {
try {
while (cm.currentActivity() != null) {
cm.cancel();
@@ -41,5 +43,13 @@
}
}
-
+ public static void cleanup(com.arjuna.mw.wscf.model.sagas.api.UserCoordinator uc) {
+ try {
+ while (uc.currentActivity() != null) {
+ uc.cancel();
+ }
+ } catch (Exception e) {
+ // do nothing -- caller will be dealing with exceptions
+ }
+ }
}
\ No newline at end of file
Added: labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/sagas/AddParticipant.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/sagas/AddParticipant.java (rev 0)
+++ labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/sagas/AddParticipant.java 2010-05-14 08:16:48 UTC (rev 32883)
@@ -0,0 +1,40 @@
+package com.arjuna.wscf11.tests.model.sagas;
+
+import com.arjuna.mw.wscf.model.sagas.api.CoordinatorManager;
+import com.arjuna.mw.wscf11.model.sagas.CoordinatorManagerFactory;
+import com.arjuna.wscf11.tests.SagasParticipant;
+import com.arjuna.wscf11.tests.WSCF11TestUtils;
+import org.junit.Test;
+
+/**
+ */
+
+public class AddParticipant
+{
+ @Test
+ public void testAddParticipant()
+ throws Exception
+ {
+ System.out.println("Running test : " + this.getClass().getName());
+
+ CoordinatorManager cm = CoordinatorManagerFactory.coordinatorManager();
+
+ try
+ {
+ cm.begin();
+
+ cm.enlistParticipant(new SagasParticipant(null));
+
+ System.out.println("Started: "+cm.identifier()+"\n");
+
+ cm.complete();
+
+ cm.close();
+ }
+ catch (Exception ex)
+ {
+ WSCF11TestUtils.cleanup(cm);
+ throw ex;
+ }
+ }
+}
\ No newline at end of file
Added: labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/sagas/BeginCancel.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/sagas/BeginCancel.java (rev 0)
+++ labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/sagas/BeginCancel.java 2010-05-14 08:16:48 UTC (rev 32883)
@@ -0,0 +1,28 @@
+package com.arjuna.wscf11.tests.model.sagas;
+
+import com.arjuna.mw.wscf.model.sagas.api.UserCoordinator;
+import com.arjuna.mw.wscf11.model.sagas.UserCoordinatorFactory;
+import org.junit.Test;
+
+/**
+ */
+
+public class BeginCancel
+{
+ @Test
+ public void testBeginCancel()
+ throws Exception
+ {
+ System.out.println("Running test : " + this.getClass().getName());
+
+ UserCoordinator ua = UserCoordinatorFactory.userCoordinator();
+
+ ua.begin();
+
+ System.out.println("Started: "+ua.identifier()+"\n");
+
+ ua.cancel();
+
+ System.out.println("Cancelled");
+ }
+}
\ No newline at end of file
Added: labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/sagas/BeginClose.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/sagas/BeginClose.java (rev 0)
+++ labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/sagas/BeginClose.java 2010-05-14 08:16:48 UTC (rev 32883)
@@ -0,0 +1,35 @@
+package com.arjuna.wscf11.tests.model.sagas;
+
+import com.arjuna.mw.wscf.model.sagas.api.UserCoordinator;
+import com.arjuna.mw.wscf11.model.sagas.UserCoordinatorFactory;
+import com.arjuna.wscf11.tests.WSCF11TestUtils;
+import org.junit.Test;
+
+/**
+ */
+
+public class BeginClose
+{
+ @Test
+ public void testBeginClose()
+ throws Exception
+ {
+ System.out.println("Running test : " + this.getClass().getName());
+
+ UserCoordinator ua = UserCoordinatorFactory.userCoordinator();
+
+ try
+ {
+ ua.begin();
+
+ System.out.println("Started: "+ua.identifier()+"\n");
+
+ ua.close();
+ }
+ catch (Exception ex)
+ {
+ WSCF11TestUtils.cleanup(ua);
+ throw ex;
+ }
+ }
+}
\ No newline at end of file
Added: labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/sagas/CancelOnlyCancel.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/sagas/CancelOnlyCancel.java (rev 0)
+++ labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/sagas/CancelOnlyCancel.java 2010-05-14 08:16:48 UTC (rev 32883)
@@ -0,0 +1,43 @@
+package com.arjuna.wscf11.tests.model.sagas;
+
+import com.arjuna.mw.wscf.model.sagas.api.UserCoordinator;
+import com.arjuna.mw.wscf.model.sagas.exceptions.CoordinatorCancelledException;
+import com.arjuna.mw.wscf11.model.sagas.UserCoordinatorFactory;
+import com.arjuna.wscf11.tests.WSCF11TestUtils;
+import org.junit.Test;
+
+/**
+ */
+
+public class CancelOnlyCancel
+{
+ @Test
+ public void testCancelOnlyCancel()
+ throws Exception
+ {
+ System.out.println("Running test : " + this.getClass().getName());
+
+ UserCoordinator ua = UserCoordinatorFactory.userCoordinator();
+
+ try
+ {
+ ua.begin();
+
+ System.out.println("Started: "+ua.identifier()+"\n");
+
+ ua.setCancelOnly();
+
+ ua.cancel();
+ }
+ catch (CoordinatorCancelledException ex)
+ {
+ // why is it ok to get here?
+ WSCF11TestUtils.cleanup(ua);
+ }
+ catch (Exception ex)
+ {
+ WSCF11TestUtils.cleanup(ua);
+ throw ex;
+ }
+ }
+}
\ No newline at end of file
Added: labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/sagas/CancelOnlyClose.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/sagas/CancelOnlyClose.java (rev 0)
+++ labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/sagas/CancelOnlyClose.java 2010-05-14 08:16:48 UTC (rev 32883)
@@ -0,0 +1,47 @@
+package com.arjuna.wscf11.tests.model.sagas;
+
+import com.arjuna.mw.wscf.model.sagas.api.UserCoordinator;
+import com.arjuna.mw.wscf.model.sagas.exceptions.CoordinatorCancelledException;
+import com.arjuna.mw.wscf11.model.sagas.UserCoordinatorFactory;
+import com.arjuna.wscf11.tests.WSCF11TestUtils;
+import org.junit.Test;
+
+import static org.junit.Assert.fail;
+
+/**
+ */
+
+public class CancelOnlyClose
+{
+ @Test
+ public void testCancelOnlyClose()
+ throws Exception
+ {
+ System.out.println("Running test : " + this.getClass().getName());
+
+ UserCoordinator ua = UserCoordinatorFactory.userCoordinator();
+
+ try
+ {
+ ua.begin();
+
+ System.out.println("Started: "+ua.identifier()+"\n");
+
+ ua.setCancelOnly();
+
+ ua.close();
+
+ fail("Close succeeded after setCancelOnly");
+ }
+ catch (CoordinatorCancelledException ex)
+ {
+ // we should get here
+ WSCF11TestUtils.cleanup(ua);
+ }
+ catch (Exception ex)
+ {
+ WSCF11TestUtils.cleanup(ua);
+ throw ex;
+ }
+ }
+}
\ No newline at end of file
Added: labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/sagas/ParticipantCannotCompleteClose.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/sagas/ParticipantCannotCompleteClose.java (rev 0)
+++ labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/sagas/ParticipantCannotCompleteClose.java 2010-05-14 08:16:48 UTC (rev 32883)
@@ -0,0 +1,53 @@
+package com.arjuna.wscf11.tests.model.sagas;
+
+import com.arjuna.mw.wscf.model.sagas.api.CoordinatorManager;
+import com.arjuna.mw.wscf.model.sagas.exceptions.CoordinatorCancelledException;
+import com.arjuna.mw.wscf11.model.sagas.CoordinatorManagerFactory;
+import com.arjuna.wscf11.tests.SagasParticipant;
+import com.arjuna.wscf11.tests.WSCF11TestUtils;
+import org.junit.Test;
+
+import static org.junit.Assert.fail;
+
+/**
+ */
+
+public class ParticipantCannotCompleteClose
+{
+ @Test
+ public void testParticipantCannotCompleteClose()
+ throws Exception
+ {
+ System.out.println("Running test : " + this.getClass().getName());
+
+ CoordinatorManager cm = CoordinatorManagerFactory.coordinatorManager();
+
+ try
+ {
+ String id = "1234";
+
+ cm.begin();
+
+ SagasParticipant participant = new SagasParticipant(id);
+
+ cm.enlistParticipant(participant);
+
+ cm.participantCannotComplete(id);
+
+ System.out.println("Started: "+cm.identifier()+"\n");
+
+ cm.close();
+
+ fail("Close succeeded after participantFaulted");
+ }
+ catch (CoordinatorCancelledException ex)
+ {
+ WSCF11TestUtils.cleanup(cm);
+ }
+ catch (Exception ex)
+ {
+ WSCF11TestUtils.cleanup(cm);
+ throw ex;
+ }
+ }
+}
\ No newline at end of file
Added: labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/sagas/ParticipantExitedClose.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/sagas/ParticipantExitedClose.java (rev 0)
+++ labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/sagas/ParticipantExitedClose.java 2010-05-14 08:16:48 UTC (rev 32883)
@@ -0,0 +1,47 @@
+package com.arjuna.wscf11.tests.model.sagas;
+
+import com.arjuna.mw.wscf.model.sagas.api.CoordinatorManager;
+import com.arjuna.mw.wscf.model.sagas.exceptions.CoordinatorCancelledException;
+import com.arjuna.mw.wscf11.model.sagas.CoordinatorManagerFactory;
+import com.arjuna.wscf11.tests.SagasParticipant;
+import com.arjuna.wscf11.tests.WSCF11TestUtils;
+import org.junit.Test;
+
+import static org.junit.Assert.fail;
+
+/**
+ */
+
+public class ParticipantExitedClose
+{
+ @Test
+ public void testParticipantExitedClose()
+ throws Exception
+ {
+ System.out.println("Running test : " + this.getClass().getName());
+
+ CoordinatorManager cm = CoordinatorManagerFactory.coordinatorManager();
+
+ try
+ {
+ String id = "1235";
+
+ cm.begin();
+
+ SagasParticipant participant = new SagasParticipant(id);
+
+ cm.enlistParticipant(participant);
+
+ cm.delistParticipant(id);
+
+ System.out.println("Started: "+cm.identifier()+"\n");
+
+ cm.close();
+ }
+ catch (Exception ex)
+ {
+ WSCF11TestUtils.cleanup(cm);
+ throw ex;
+ }
+ }
+}
\ No newline at end of file
Added: labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/sagas/ParticipantFaultedClose.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/sagas/ParticipantFaultedClose.java (rev 0)
+++ labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/sagas/ParticipantFaultedClose.java 2010-05-14 08:16:48 UTC (rev 32883)
@@ -0,0 +1,53 @@
+package com.arjuna.wscf11.tests.model.sagas;
+
+import com.arjuna.mw.wscf.model.sagas.api.CoordinatorManager;
+import com.arjuna.mw.wscf.model.sagas.exceptions.CoordinatorCancelledException;
+import com.arjuna.mw.wscf11.model.sagas.CoordinatorManagerFactory;
+import com.arjuna.wscf11.tests.SagasParticipant;
+import com.arjuna.wscf11.tests.WSCF11TestUtils;
+import org.junit.Test;
+
+import static org.junit.Assert.fail;
+
+/**
+ */
+
+public class ParticipantFaultedClose
+{
+ @Test
+ public void testParticipantFaultedClose()
+ throws Exception
+ {
+ System.out.println("Running test : " + this.getClass().getName());
+
+ CoordinatorManager cm = CoordinatorManagerFactory.coordinatorManager();
+
+ try
+ {
+ String id = "1236";
+
+ cm.begin();
+
+ SagasParticipant participant = new SagasParticipant(id);
+
+ cm.enlistParticipant(participant);
+
+ cm.participantFaulted(id);
+
+ System.out.println("Started: "+cm.identifier()+"\n");
+
+ cm.close();
+
+ fail("Close succeeded after participantFaulted");
+ }
+ catch (CoordinatorCancelledException ex)
+ {
+ WSCF11TestUtils.cleanup(cm);
+ }
+ catch (Exception ex)
+ {
+ WSCF11TestUtils.cleanup(cm);
+ throw ex;
+ }
+ }
+}
\ No newline at end of file
Added: labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/sagas/Suspend.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/sagas/Suspend.java (rev 0)
+++ labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/sagas/Suspend.java 2010-05-14 08:16:48 UTC (rev 32883)
@@ -0,0 +1,50 @@
+package com.arjuna.wscf11.tests.model.sagas;
+
+import com.arjuna.mw.wsas.activity.ActivityHierarchy;
+import com.arjuna.mw.wscf.exceptions.NoCoordinatorException;
+import com.arjuna.mw.wscf.model.sagas.api.UserCoordinator;
+import com.arjuna.mw.wscf11.model.sagas.UserCoordinatorFactory;
+import com.arjuna.wscf11.tests.WSCF11TestUtils;
+import org.junit.Test;
+
+import static org.junit.Assert.fail;
+
+/**
+ */
+
+public class Suspend
+{
+ @Test
+ public void testSuspend()
+ throws Exception
+ {
+ System.out.println("Running test : " + this.getClass().getName());
+
+ UserCoordinator ua = UserCoordinatorFactory.userCoordinator();
+
+ try
+ {
+ ua.begin();
+
+ System.out.println("Started: "+ua.identifier()+"\n");
+
+ ActivityHierarchy hier = ua.suspend();
+
+ System.out.println("Suspended: "+hier+"\n");
+
+ if (ua.currentActivity() != null) {
+ WSCF11TestUtils.cleanup(ua);
+ fail("Hierarchy still active.");
+ }
+ }
+ catch (NoCoordinatorException ex)
+ {
+ // why is it ok to get here?
+ }
+ catch (Exception ex)
+ {
+ WSCF11TestUtils.cleanup(ua);
+ throw ex;
+ }
+ }
+}
\ No newline at end of file
Added: labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/sagas/SuspendClose.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/sagas/SuspendClose.java (rev 0)
+++ labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/sagas/SuspendClose.java 2010-05-14 08:16:48 UTC (rev 32883)
@@ -0,0 +1,52 @@
+package com.arjuna.wscf11.tests.model.sagas;
+
+import com.arjuna.mw.wsas.activity.ActivityHierarchy;
+import com.arjuna.mw.wscf.exceptions.NoCoordinatorException;
+import com.arjuna.mw.wscf.model.sagas.api.UserCoordinator;
+import com.arjuna.mw.wscf11.model.sagas.UserCoordinatorFactory;
+import com.arjuna.wscf11.tests.WSCF11TestUtils;
+import org.junit.Test;
+
+import static org.junit.Assert.fail;
+
+/**
+ */
+
+public class SuspendClose
+{
+ @Test
+ public void testSuspendClose()
+ throws Exception
+ {
+ System.out.println("Running test : " + this.getClass().getName());
+
+ UserCoordinator ua = UserCoordinatorFactory.userCoordinator();
+
+ try
+ {
+ ua.begin();
+
+ System.out.println("Started: "+ua.identifier()+"\n");
+
+ ActivityHierarchy hier = ua.suspend();
+
+ System.out.println("Suspended: "+hier+"\n");
+
+ if (ua.currentActivity() != null) {
+ WSCF11TestUtils.cleanup(ua);
+ fail("Hierarchy still active.");
+ }
+
+ ua.close();
+ }
+ catch (NoCoordinatorException ex)
+ {
+ WSCF11TestUtils.cleanup(ua);
+ }
+ catch (Exception ex)
+ {
+ WSCF11TestUtils.cleanup(ua);
+ throw ex;
+ }
+ }
+}
\ No newline at end of file
Added: labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/sagas/SuspendResume.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/sagas/SuspendResume.java (rev 0)
+++ labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/sagas/SuspendResume.java 2010-05-14 08:16:48 UTC (rev 32883)
@@ -0,0 +1,56 @@
+package com.arjuna.wscf11.tests.model.sagas;
+
+import com.arjuna.mw.wsas.activity.ActivityHierarchy;
+import com.arjuna.mw.wscf.model.sagas.api.UserCoordinator;
+import com.arjuna.mw.wscf11.model.sagas.UserCoordinatorFactory;
+import com.arjuna.wscf11.tests.WSCF11TestUtils;
+import org.junit.Test;
+
+import static org.junit.Assert.fail;
+
+/**
+ */
+
+public class SuspendResume
+{
+ @Test
+ public void testSuspendResume()
+ throws Exception
+ {
+ System.out.println("Running test : " + this.getClass().getName());
+
+ UserCoordinator ua = UserCoordinatorFactory.userCoordinator();
+
+ try
+ {
+ ua.begin();
+
+ System.out.println("Started: "+ua.identifier()+"\n");
+
+ ActivityHierarchy hier = ua.suspend();
+
+ System.out.println("Suspended: "+hier+"\n");
+
+ if (ua.currentActivity() != null)
+ {
+ WSCF11TestUtils.cleanup(ua);
+ fail("Hierarchy still active");
+ }
+ else
+ {
+ ua.resume(hier);
+
+ System.out.println("Resumed: "+hier+"\n");
+
+ ua.cancel();
+
+ System.out.println("Cancelled");
+ }
+ }
+ catch (Exception ex)
+ {
+ WSCF11TestUtils.cleanup(ua);
+ throw ex;
+ }
+ }
+}
\ No newline at end of file
Added: labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/sagas/SuspendResumeMultiParticipant.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/sagas/SuspendResumeMultiParticipant.java (rev 0)
+++ labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/sagas/SuspendResumeMultiParticipant.java 2010-05-14 08:16:48 UTC (rev 32883)
@@ -0,0 +1,57 @@
+package com.arjuna.wscf11.tests.model.sagas;
+
+import com.arjuna.mw.wsas.activity.ActivityHierarchy;
+import com.arjuna.mw.wscf.model.sagas.api.CoordinatorManager;
+import com.arjuna.mw.wscf11.model.sagas.CoordinatorManagerFactory;
+import com.arjuna.wscf11.tests.SagasParticipant;
+import com.arjuna.wscf11.tests.WSCF11TestUtils;
+import org.junit.Test;
+
+import static org.junit.Assert.fail;
+
+/**
+ */
+
+public class SuspendResumeMultiParticipant
+{
+ @Test
+ public void testSuspendResumeMultiParticipant()
+ throws Exception
+ {
+ System.out.println("Running test : " + this.getClass().getName());
+
+ CoordinatorManager cm = CoordinatorManagerFactory.coordinatorManager();
+
+ try
+ {
+ cm.begin();
+
+ cm.enlistParticipant(new SagasParticipant("p1"));
+ cm.enlistParticipant(new SagasParticipant("p2"));
+
+ System.out.println("Started: "+cm.identifier()+"\n");
+
+ ActivityHierarchy hier = cm.suspend();
+
+ System.out.println("Suspended: "+hier+"\n");
+
+ if (cm.currentActivity() != null)
+ {
+ WSCF11TestUtils.cleanup(cm);
+
+ fail("Hierarchy still active.");
+ }
+ cm.resume(hier);
+
+ System.out.println("Resumed: "+hier+"\n");
+
+ cm.close();
+ }
+ catch (Exception ex)
+ {
+ WSCF11TestUtils.cleanup(cm);
+
+ throw ex;
+ }
+ }
+}
\ No newline at end of file
Modified: labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/twophase/ParticipantSynchronization.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/twophase/ParticipantSynchronization.java 2010-05-14 08:05:22 UTC (rev 32882)
+++ labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/twophase/ParticipantSynchronization.java 2010-05-14 08:16:48 UTC (rev 32883)
@@ -73,6 +73,7 @@
catch (Exception ex)
{
WSCF11TestUtils.cleanup(cm);
+ throw ex;
}
}
}
\ No newline at end of file
Deleted: labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/twophase/StartEnd.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/twophase/StartEnd.java 2010-05-14 08:05:22 UTC (rev 32882)
+++ labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/twophase/StartEnd.java 2010-05-14 08:16:48 UTC (rev 32883)
@@ -1,103 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags.
- * See the copyright.txt in the distribution for a full listing
- * of individual contributors.
- * This copyrighted material is made available to anyone wishing to use,
- * modify, copy, or redistribute it subject to the terms and conditions
- * of the GNU Lesser General Public License, v. 2.1.
- * This program is distributed in the hope that it will be useful, but WITHOUT A
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
- * You should have received a copy of the GNU Lesser General Public License,
- * v.2.1 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA 02110-1301, USA.
- *
- * (C) 2005-2006,
- * @author JBoss Inc.
- */
-/*
- * Copyright (C) 2002,
- *
- * Arjuna Technologies Limited,
- * Newcastle upon Tyne,
- * Tyne and Wear,
- * UK.
- *
- * $Id: StartEnd.java,v 1.3 2003/03/14 14:26:34 nmcl Exp $
- */
-
-package com.arjuna.wscf11.tests.model.twophase;
-
-import com.arjuna.mwlabs.wscf.utils.ProtocolLocator;
-
-import com.arjuna.mw.wscf.UserCoordinator;
-import com.arjuna.mw.wscf11.UserCoordinatorFactory;
-
-import com.arjuna.mw.wscf.model.twophase.common.*;
-import com.arjuna.mw.wscf.model.twophase.outcomes.*;
-
-import com.arjuna.mw.wsas.activity.*;
-
-import com.arjuna.mw.wsas.exceptions.NoActivityException;
-import com.arjuna.wscf11.tests.WSCF11TestUtils;
-
-import org.junit.Test;
-import static org.junit.Assert.*;
-
-/**
- * @author Mark Little (mark.little at arjuna.com)
- * @version $Id: StartEnd.java,v 1.3 2003/03/14 14:26:34 nmcl Exp $
- * @since 1.0.
- */
-
-public class StartEnd
-{
- @Test
- public void testStartEnd()
- throws Exception
- {
- System.out.println("Running test : " + this.getClass().getName());
-
- String className = "com.arjuna.mwlabs.wscf11.model.twophase.arjunacore.TwoPhaseHLSImple";
- org.w3c.dom.Document implementationDoc = null;
-
- // System.setProperty("com.arjuna.mw.wscf.protocolImplementation", className);
-
- Class clazz = this.getClass().getClassLoader().loadClass(className);
- ProtocolLocator pl = new ProtocolLocator(clazz);
-
- implementationDoc = pl.getProtocol();
-
- UserCoordinator ua = UserCoordinatorFactory.userCoordinator(implementationDoc);
-
- try
- {
- ua.start();
-
- System.out.println("Started: "+ua.activityName()+"\n");
-
- Outcome res = ua.end();
-
- if (res instanceof CoordinationOutcome)
- {
- CoordinationOutcome co = (CoordinationOutcome) res;
- int result = co.result();
-
- if (result != TwoPhaseResult.CANCELLED)
- fail("expected result \"CANCELLED\" (" + TwoPhaseResult.CANCELLED + ") but got " + result);
- }
- }
- catch (NoActivityException ex)
- {
- // why is it ok to get here?;
- }
- catch (Exception ex)
- {
- WSCF11TestUtils.cleanup(ua);
- throw ex;
- }
- }
-}
\ No newline at end of file
Deleted: labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mw/wst/BAParticipantManager.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mw/wst/BAParticipantManager.java 2010-05-14 08:05:22 UTC (rev 32882)
+++ labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mw/wst/BAParticipantManager.java 2010-05-14 08:16:48 UTC (rev 32883)
@@ -1,69 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags.
- * See the copyright.txt in the distribution for a full listing
- * of individual contributors.
- * This copyrighted material is made available to anyone wishing to use,
- * modify, copy, or redistribute it subject to the terms and conditions
- * of the GNU Lesser General Public License, v. 2.1.
- * This program is distributed in the hope that it will be useful, but WITHOUT A
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
- * You should have received a copy of the GNU Lesser General Public License,
- * v.2.1 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA 02110-1301, USA.
- *
- * (C) 2005-2006,
- * @author JBoss Inc.
- */
-/*
- * Copyright (C) 2003,
- *
- * Arjuna Technologies Limited,
- * Newcastle upon Tyne,
- * Tyne and Wear,
- * UK.
- *
- * $Id: BAParticipantManager.java,v 1.4 2004/12/21 09:49:13 kconner Exp $
- */
-
-package com.arjuna.mw.wst;
-
-import com.arjuna.mw.wst.exceptions.*;
-
-/**
- * When a Business Activity participant registers with a BA transaction it
- * gets a reference to the transaction coordinator that lets it callback
- * into the transaction and drive the state-transition.
- *
- * One instance of this per transaction.
- *
- * @author Mark Little (mark.little at arjuna.com)
- * @version $Id: BAParticipantManager.java,v 1.4 2004/12/21 09:49:13 kconner Exp $
- * @since XTS 1.0.
- */
-
-public interface BAParticipantManager
-{
-
- /**
- * The participant has exited.
- */
-
- public void exited (String id) throws WrongStateException, UnknownTransactionException, UnknownParticipantException, SystemException;
-
- /**
- * The participant has completed.
- */
-
- public void completed (String id) throws WrongStateException, UnknownTransactionException, UnknownParticipantException, SystemException;
-
- /*
- * The participant has failed.
- */
-
- public void faulted (String id) throws WrongStateException, UnknownTransactionException, UnknownParticipantException, SystemException;
-
-}
Deleted: labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mw/wst/Durable2PCCoordinator.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mw/wst/Durable2PCCoordinator.java 2010-05-14 08:05:22 UTC (rev 32882)
+++ labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mw/wst/Durable2PCCoordinator.java 2010-05-14 08:16:48 UTC (rev 32883)
@@ -1,65 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags.
- * See the copyright.txt in the distribution for a full listing
- * of individual contributors.
- * This copyrighted material is made available to anyone wishing to use,
- * modify, copy, or redistribute it subject to the terms and conditions
- * of the GNU Lesser General Public License, v. 2.1.
- * This program is distributed in the hope that it will be useful, but WITHOUT A
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
- * You should have received a copy of the GNU Lesser General Public License,
- * v.2.1 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA 02110-1301, USA.
- *
- * (C) 2005-2006,
- * @author JBoss Inc.
- */
-/*
- * Copyright (C) 2004,
- *
- * Arjuna Technologies Limited,
- * Newcastle upon Tyne,
- * Tyne and Wear,
- * UK.
- *
- * $Id: Durable2PCCoordinator.java,v 1.1.2.1 2004/08/06 10:25:30 nmcl Exp $
- */
-
-package com.arjuna.mw.wst;
-
-import com.arjuna.mw.wst.exceptions.SystemException;
-import com.arjuna.mw.wst.exceptions.UnknownParticipantException;
-import com.arjuna.mw.wst.exceptions.UnknownTransactionException;
-import com.arjuna.mw.wst.exceptions.WrongStateException;
-
-/**
- * Allows a durable 2PC participant to rollback or send readonly
- * before the coordinator initiates the protocol.
- *
- * One instance of this per transaction.
- *
- * @author Mark Little (mark.little at arjuna.com)
- * @version $Id: Durable2PCCoordinator.java,v 1.1.2.1 2004/08/06 10:25:30 nmcl Exp $
- * @since XTS 1.0.
- */
-
-public interface Durable2PCCoordinator
-{
-
- /**
- * The participant has rolled back.
- */
-
- public void rollback (String id) throws WrongStateException, UnknownTransactionException, UnknownParticipantException, SystemException;
-
- /**
- * The participant is read-only.
- */
-
- public void readonly (String id) throws WrongStateException, UnknownTransactionException, UnknownParticipantException, SystemException;
-
-}
Deleted: labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mw/wstx/TransactionManager.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mw/wstx/TransactionManager.java 2010-05-14 08:05:22 UTC (rev 32882)
+++ labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mw/wstx/TransactionManager.java 2010-05-14 08:16:48 UTC (rev 32883)
@@ -1,151 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags.
- * See the copyright.txt in the distribution for a full listing
- * of individual contributors.
- * This copyrighted material is made available to anyone wishing to use,
- * modify, copy, or redistribute it subject to the terms and conditions
- * of the GNU Lesser General Public License, v. 2.1.
- * This program is distributed in the hope that it will be useful, but WITHOUT A
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
- * You should have received a copy of the GNU Lesser General Public License,
- * v.2.1 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA 02110-1301, USA.
- *
- * (C) 2005-2006,
- * @author JBoss Inc.
- */
-/*
- * Copyright (C) 2002,
- *
- * Arjuna Technologies Limited,
- * Newcastle upon Tyne,
- * Tyne and Wear,
- * UK.
- *
- * $Id: TransactionManager.java,v 1.1 2002/11/25 11:00:51 nmcl Exp $
- */
-
-package com.arjuna.mw.wstx;
-
-import com.arjuna.mw.wstx.resource.Participant;
-import com.arjuna.mw.wstx.resource.Synchronization;
-
-import com.arjuna.mw.wsas.exceptions.SystemException;
-import com.arjuna.mw.wsas.exceptions.WrongStateException;
-
-import com.arjuna.mw.wstx.exceptions.DuplicateParticipantException;
-import com.arjuna.mw.wstx.exceptions.NoTransactionException;
-import com.arjuna.mw.wstx.exceptions.InvalidTransactionException;
-import com.arjuna.mw.wstx.exceptions.InvalidParticipantException;
-import com.arjuna.mw.wstx.exceptions.DuplicateSynchronizationException;
-import com.arjuna.mw.wstx.exceptions.InvalidSynchronizationException;
-
-/**
- * This is the service side component of the user interface. Since services
- * or some entity acting on their behalf (e.g., an interceptor) must enlist
- * participants with the transaction, this interface
- * primarily concentrates on those methods. However, a service may well
- * not be the final destination for a transaction, i.e., in order to perform
- * its work, the service may have to make other remote invocations on other
- * services and propagate the context, suspend it, etc. As such, all of the
- * UserTransaction methods are also available to the service.
- *
- * @author Mark Little (mark.little at arjuna.com)
- * @version $Id: TransactionManager.java,v 1.1 2002/11/25 11:00:51 nmcl Exp $
- * @since 1.0.
- */
-
-public interface TransactionManager
-{
- /**
- * Enrol the specified participant in the current transaction such that
- * it will be invoked during the two-phase commit protocol.
- * It is illegal to call this method when no transaction is associated
- * with the thread.
- *
- * @param participant The participant to enrol.
- *
- * @exception WrongStateException Thrown if the transaction is not in a state
- * whereby participants can be enrolled.
- * @exception DuplicateParticipantException Thrown if the participant
- * has already been associated with the transaction.
- * @exception NoTransactionException Thrown if there is no transaction
- * associated with the invoking thread.
- * @exception InvalidTransactionException Thrown if the transaction associated with
- * the thread is invalid.
- * @exception InvalidParticipantException Thrown if the participant reference
- * is invalid.
- * @exception SystemException Thrown if any other error occurs.
- */
-
- public void enlist (Participant participant) throws WrongStateException, DuplicateParticipantException, NoTransactionException, InvalidTransactionException, InvalidParticipantException, SystemException;
-
- /**
- * Cause the specified participant to resign from the transaction.
- *
- * CAUTION: use with *extreme* care since if invoked at the wrong time
- * it could lead to data corruption or state modifications that are
- * no longer under the control of the transaction. You *must* ensure
- * that no state changes have been made that should be controlled by
- * the specified participant.
- *
- * @param participant The participant to resign.
- *
- * @exception InvalidTransactionException Thrown if the transaction associated with
- * the thread is invalid.
- * @exception NoTransactionException Thrown if no transaction is associated
- * with the invoking thread.
- * @exception InvalidParticipantException Thrown if the transaction does not know
- * about the specified participant or the parameter is invalid.
- * @exception WrongStateException Thrown if the transaction is not in a state
- * that allows participants to resign.
- * @exception SystemException Thrown if any other error occurs.
- */
-
- public void delist (Participant participant) throws InvalidTransactionException, NoTransactionException, InvalidParticipantException, WrongStateException, SystemException;
-
- /**
- * Enlist a synchronization with the current transaction. Synchronizations
- * do not receive the two-phase commit messages but instead are invoked
- * prior to its start and after it has completed.
- *
- * @param participant The synchronization to enroll.
- *
- * @exception WrongStateException Thrown if the transaction state is such
- * that synchronizations cannot be enrolled.
- * @exception NoTransactionException Thrown if there is no transaction
- * associated with the invoking thread.
- * @exception InvalidTransactionException Thrown if the transaction is not
- * top-level.
- * @exception InvalidSynchronizationException Thrown if the synchronization
- * reference is invalid.
- * @exception DuplicateSynchronizationException Thrown if the synchronization
- * has already been registered with the transaction.
- * @exception SystemException Thrown if any other error occurs.
- */
-
- public void addSynchronization (Synchronization participant) throws WrongStateException, NoTransactionException, InvalidTransactionException, InvalidSynchronizationException, DuplicateSynchronizationException, SystemException;
-
- /**
- * Remove the specified synchronization participant from the transaction.
- *
- * @param participant The participant to remove.
- *
- * @exception InvalidTransactionException Thrown if the transaction is not
- * top-level.
- * @exception NoTransactionException Thrown if there is no transaction
- * associated with the current thread.
- * @exception InvalidSynchronizationException Thrown if the transaction
- * does not know about the specified synchronization.
- * @exception WrongStateException Thrown if the state of the transaction is
- * such that the synchronization cannot be removed.
- * @exception SystemException Thrown if any other error occurs.
- */
-
- public void removeSynchronization (Synchronization participant) throws InvalidTransactionException, NoTransactionException, InvalidSynchronizationException, WrongStateException, SystemException;
-
-}
Deleted: labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mw/wstx/UserTransaction.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mw/wstx/UserTransaction.java 2010-05-14 08:05:22 UTC (rev 32882)
+++ labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mw/wstx/UserTransaction.java 2010-05-14 08:16:48 UTC (rev 32883)
@@ -1,237 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags.
- * See the copyright.txt in the distribution for a full listing
- * of individual contributors.
- * This copyrighted material is made available to anyone wishing to use,
- * modify, copy, or redistribute it subject to the terms and conditions
- * of the GNU Lesser General Public License, v. 2.1.
- * This program is distributed in the hope that it will be useful, but WITHOUT A
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
- * You should have received a copy of the GNU Lesser General Public License,
- * v.2.1 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA 02110-1301, USA.
- *
- * (C) 2005-2006,
- * @author JBoss Inc.
- */
-/*
- * Copyright (C) 2002,
- *
- * Arjuna Technologies Limited,
- * Newcastle upon Tyne,
- * Tyne and Wear,
- * UK.
- *
- * $Id: UserTransaction.java,v 1.1 2002/11/25 11:00:51 nmcl Exp $
- */
-
-package com.arjuna.mw.wstx;
-
-import com.arjuna.mw.wsas.status.Status;
-
-import com.arjuna.mw.wstx.transaction.*;
-
-import com.arjuna.mw.wstx.common.TxId;
-
-import com.arjuna.mw.wscf.common.Qualifier;
-
-// TODO: obtain via configuration
-
-import com.arjuna.mwlabs.wstx.common.arjunacore.TxIdImple;
-
-import com.arjuna.mw.wsas.exceptions.SystemException;
-import com.arjuna.mw.wsas.exceptions.WrongStateException;
-import com.arjuna.mw.wsas.exceptions.InvalidTimeoutException;
-
-import com.arjuna.mw.wstx.exceptions.InvalidTransactionException;
-import com.arjuna.mw.wstx.exceptions.NoTransactionException;
-import com.arjuna.mw.wstx.exceptions.HeuristicHazardException;
-import com.arjuna.mw.wstx.exceptions.HeuristicMixedException;
-import com.arjuna.mw.wstx.exceptions.HeuristicCommitException;
-import com.arjuna.mw.wstx.exceptions.HeuristicRollbackException;
-import com.arjuna.mw.wstx.exceptions.TransactionRolledBackException;
-import com.arjuna.mw.wstx.exceptions.TransactionCommittedException;
-
-/**
- * The user portion of the transaction API.
- *
- * @author Mark Little (mark.little at arjuna.com)
- * @version $Id: UserTransaction.java,v 1.1 2002/11/25 11:00:51 nmcl Exp $
- * @since 1.0.
- */
-
-public interface UserTransaction
-{
-
- /**
- * Start a new transaction. If there is already a transaction associated
- * with the thread then it will be nested.
- *
- * @exception WrongStateException Thrown if the any currently associated
- * transaction is in a state that does not allow a new transaction to be
- * enlisted.
- * @exception SystemException Thrown in any other situation.
- */
-
- public void begin () throws WrongStateException, SystemException;
-
- /**
- * Commit the transaction. All participants that are still enlisted
- * with the transaction are committed.
- *
- * @exception InvalidTransactionException Thrown if the current transaction is not
- * known about by the transaction system.
- * @exception WrongStateException Thrown if the current transaction is not in a
- * state that allows commit to be called.
- * @exception HeuristicHazardException Thrown if the participants generated a hazard
- * heuristic.
- * @exception HeuristicMixedException Thrown if the participants generated a mixed heuristic.
- * @exception NoTransactionException Thrown if there is no transaction
- * associated with the invoking thread.
- * @exception SystemException Thrown if some other error occurred.
- */
-
- public void commit () throws InvalidTransactionException, WrongStateException, HeuristicHazardException, HeuristicMixedException, SystemException, NoTransactionException, TransactionRolledBackException;
-
- /**
- * Abort the transaction. All participants that are still enlisted
- * with the transaction are rolled back.
- *
- * @exception InvalidTransactionException Thrown if the current transaction is not
- * known about by the transaction system.
- * @exception WrongStateException Thrown if the current transaction is not in a
- * state that allows cancel to be called.
- * @exception HeuristicHazardException Thrown if the participants generated a hazard
- * heuristic.
- * @exception HeuristicMixedException Thrown if the participants generated a mixed heuristic.
- * @exception NoTransactionException Thrown if there is no transaction
- * associated with the invoking thread.
- * @exception SystemException Thrown if some other error occurred.
- */
-
- public void rollback () throws InvalidTransactionException, WrongStateException, HeuristicHazardException, HeuristicMixedException, SystemException, NoTransactionException, TransactionCommittedException;
-
- /**
- * @exception SystemException Thrown if any error occurs.
- *
- * @return the status of the current transaction. If there is no
- * transaction associated with the thread then NO_TRANSACTION
- * will be returned.
- */
-
- public Status status () throws SystemException;
-
- /**
- * What is the name of the current transaction? Use only for
- * debugging purposes.
- *
- * @exception NoTransactionException Thrown if there is no transaction
- * associated with the invoking thread.
- * @exception SystemException Thrown if any other error occurs.
- *
- * @return the name of the transaction.
- */
-
- public String transactionName () throws NoTransactionException, SystemException;
-
- /**
- * Suspend all transactions associated with this thread. The thread then
- * becomes associated with no transaction.
- *
- * @exception SystemException if any error occurs.
- *
- * @return a representation of the context associated with the thread,
- * or null if there is no context.
- */
-
- public TransactionHierarchy suspend () throws SystemException;
-
- /**
- * Associate this thread with the specified context. Any current
- * associations are lost.
- *
- * @param tx The context representation to associate (may be
- * null).
- *
- * @exception InvalidTransactionException Thrown if the context is invalid.
- * @exception SystemException Thrown if any other error occurs.
- */
-
- public void resume (TransactionHierarchy tx) throws InvalidTransactionException, SystemException;
-
- /**
- * @return a representation of the context currently associated with
- * the invoking thread, or null if there is none.
- */
-
- public TransactionHierarchy currentTransaction () throws SystemException;
-
- /**
- * @exception NoTransactionException Thrown if there is no transaction
- * associated with the current thread.
- * @exception SystemException Thrown if any other error occurs.
- *
- * @return the qualifiers that are currently associated with the
- * transaction, or null if there are none.
- */
-
- public Qualifier[] qualifiers () throws NoTransactionException, SystemException;
-
- /**
- * Set the state of the transaction such that the only possible outcome is
- * for it to rollback.
- *
- * @exception NoTransactionException Thrown if there is no transaction
- * associated with the current thread.
- * @exception WrongStateException Thrown if the state of the transaction is
- * such that it is not possible to put it into a rollback-only state, e.g.,
- * it is committing.
- * @exception SystemException Thrown if any other error occurs.
- */
-
- public void setRollbackOnly () throws NoTransactionException, WrongStateException, SystemException;
-
- /**
- * Get the timeout value currently associated with the transaction.
- *
- * @exception SystemException Thrown if any error occurs.
- *
- * @return the timeout value in seconds, or 0 if no application specified
- * timeout has been provided.
- */
-
- public int getTimeout () throws SystemException;
-
- /**
- * Set the timeout to be associated with all subsequently created
- * transactions. A default value of 0 is automatically associated with
- * each thread and this means that no application specified timeout is
- * set for activities.
- *
- * @param timeout The timeout (in seconds) to associate with all
- * subsequently created activities. This value must be 0 or greater.
- *
- * @exception InvalidTimeoutException Thrown if the timeout value provided
- * is negative, too large, or if timeouts are simply not supported by
- * the activity implementation.
- * @exception SystemException Thrown if any other error occurs.
- */
-
- public void setTimeout (int timeout) throws InvalidTimeoutException, SystemException;
-
- /**
- * @exception NoTransactionException Thrown if there is no activity
- * associated with the invoking thread.
- * @exception SystemException Thrown if some other error occurred.
- *
- * @return the unique transaction id for the current transaction. This
- * may or may not be the same as the activity id.
- */
-
- public TxId identifier () throws NoTransactionException, SystemException;
-
-}
More information about the jboss-svn-commits
mailing list