[jboss-svn-commits] JBL Code SVN: r15335 - in labs/jbosstm/branches/JBOSSTS_4_2_3_GA_SP: ArjunaCore/arjuna/tests/classes/com/hp/mwtests/ts/arjuna/resources and 3 other directories.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Mon Sep 24 11:37:33 EDT 2007


Author: jhalliday
Date: 2007-09-24 11:37:33 -0400 (Mon, 24 Sep 2007)
New Revision: 15335

Modified:
   labs/jbosstm/branches/JBOSSTS_4_2_3_GA_SP/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/coordinator/SynchronizationRecord.java
   labs/jbosstm/branches/JBOSSTS_4_2_3_GA_SP/ArjunaCore/arjuna/tests/classes/com/hp/mwtests/ts/arjuna/resources/SyncRecord.java
   labs/jbosstm/branches/JBOSSTS_4_2_3_GA_SP/ArjunaJTS/jtax/classes/com/arjuna/ats/internal/jta/resources/jts/LocalCleanupSynchronization.java
   labs/jbosstm/branches/JBOSSTS_4_2_3_GA_SP/XTS/WSCF/classes/com/arjuna/mwlabs/wscf/model/as/coordinator/arjunacore/SynchronizationRecord.java
   labs/jbosstm/branches/JBOSSTS_4_2_3_GA_SP/XTS/WSCF/classes/com/arjuna/mwlabs/wscf/model/twophase/arjunacore/SynchronizationRecord.java
Log:
Merged fix for SyncronizationRecord impls must be Comparable JBTM-254 from trunk to 4.2.3.SP branch.


Modified: labs/jbosstm/branches/JBOSSTS_4_2_3_GA_SP/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/coordinator/SynchronizationRecord.java
===================================================================
--- labs/jbosstm/branches/JBOSSTS_4_2_3_GA_SP/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/coordinator/SynchronizationRecord.java	2007-09-24 15:09:30 UTC (rev 15334)
+++ labs/jbosstm/branches/JBOSSTS_4_2_3_GA_SP/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/coordinator/SynchronizationRecord.java	2007-09-24 15:37:33 UTC (rev 15335)
@@ -1,20 +1,20 @@
 /*
  * JBoss, Home of Professional Open Source
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors 
- * as indicated by the @author tags. 
+ * 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. 
+ * 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 
+ * 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, 
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
  * MA  02110-1301, USA.
- * 
+ *
  * (C) 2005-2006,
  * @author JBoss Inc.
  */
@@ -24,7 +24,7 @@
  * Hewlett Packard Arjuna Labs,
  * Newcastle upon Tyne,
  * Tyne and Wear,
- * UK.  
+ * UK.
  *
  * $Id: SynchronizationRecord.java 2342 2006-03-30 13:06:17Z  $
  */
@@ -39,12 +39,11 @@
  * @since 3.0.
  */
 
-public interface SynchronizationRecord extends ListElement
+public interface SynchronizationRecord extends ListElement, Comparable
 {
 
     public boolean beforeCompletion ();
 
     public boolean afterCompletion (int status);
 
-}
-
+}
\ No newline at end of file

Modified: labs/jbosstm/branches/JBOSSTS_4_2_3_GA_SP/ArjunaCore/arjuna/tests/classes/com/hp/mwtests/ts/arjuna/resources/SyncRecord.java
===================================================================
--- labs/jbosstm/branches/JBOSSTS_4_2_3_GA_SP/ArjunaCore/arjuna/tests/classes/com/hp/mwtests/ts/arjuna/resources/SyncRecord.java	2007-09-24 15:09:30 UTC (rev 15334)
+++ labs/jbosstm/branches/JBOSSTS_4_2_3_GA_SP/ArjunaCore/arjuna/tests/classes/com/hp/mwtests/ts/arjuna/resources/SyncRecord.java	2007-09-24 15:37:33 UTC (rev 15335)
@@ -1,20 +1,20 @@
 /*
  * JBoss, Home of Professional Open Source
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors 
- * as indicated by the @author tags. 
+ * 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. 
+ * 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 
+ * 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, 
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
  * MA  02110-1301, USA.
- * 
+ *
  * (C) 2005-2006,
  * @author JBoss Inc.
  */
@@ -24,7 +24,7 @@
  * Arjuna Technologies Limited,
  * Newcastle upon Tyne,
  * Tyne and Wear,
- * UK.  
+ * UK.
  *
  * $Id: SyncRecord.java 2342 2006-03-30 13:06:17Z  $
  */
@@ -59,8 +59,17 @@
     {
 	return _theUid;
     }
-    
+
     private Uid _theUid = new Uid();
-    
+
+
+    public int compareTo(Object o) {
+        SynchronizationRecord sr = (SynchronizationRecord)o;
+        if(_theUid.equals(sr.get_uid())) {
+            return 0;
+        } else {
+            return _theUid.lessThan(sr.get_uid()) ? -1 : 1;
+        }
+    }
 }
 

Modified: labs/jbosstm/branches/JBOSSTS_4_2_3_GA_SP/ArjunaJTS/jtax/classes/com/arjuna/ats/internal/jta/resources/jts/LocalCleanupSynchronization.java
===================================================================
--- labs/jbosstm/branches/JBOSSTS_4_2_3_GA_SP/ArjunaJTS/jtax/classes/com/arjuna/ats/internal/jta/resources/jts/LocalCleanupSynchronization.java	2007-09-24 15:09:30 UTC (rev 15334)
+++ labs/jbosstm/branches/JBOSSTS_4_2_3_GA_SP/ArjunaJTS/jtax/classes/com/arjuna/ats/internal/jta/resources/jts/LocalCleanupSynchronization.java	2007-09-24 15:37:33 UTC (rev 15335)
@@ -1,20 +1,20 @@
 /*
  * JBoss, Home of Professional Open Source
  * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. 
- * See the copyright.txt in the distribution for a full listing 
+ * as indicated by the @author tags.
+ * See the copyright.txt in the distribution for a full listing
  * of individual contributors.
  * This copyrighted material is made available to anyone wishing to use,
  * modify, copy, or redistribute it subject to the terms and conditions
  * of the GNU General Public License, v. 2.0.
- * This program is distributed in the hope that it will be useful, but WITHOUT A 
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A 
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
  * PARTICULAR PURPOSE.  See the GNU General Public License for more details.
  * You should have received a copy of the GNU General Public License,
  * v. 2.0 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
  * MA  02110-1301, USA.
- * 
+ *
  * (C) 2005-2006,
  * @author JBoss Inc.
  */
@@ -32,6 +32,7 @@
 package com.arjuna.ats.internal.jta.resources.jts;
 
 import com.arjuna.ats.arjuna.common.Uid;
+import com.arjuna.ats.arjuna.coordinator.SynchronizationRecord;
 
 import com.arjuna.ats.internal.jta.transaction.jts.TransactionImple;
 
@@ -56,7 +57,7 @@
     {
 	_tx = tx;
     }
-    
+
     public boolean beforeCompletion ()
     {
 	return true;
@@ -73,8 +74,17 @@
     {
 	return _theUid;
     }
-    
+
     private TransactionImple _tx;
     private Uid              _theUid = new Uid();
-    
-}
+
+    public int compareTo(Object o) {
+        SynchronizationRecord sr = (SynchronizationRecord)o;
+        if(_theUid.equals(sr.get_uid())) {
+            return 0;
+        } else {
+            return _theUid.lessThan(sr.get_uid()) ? -1 : 1;
+        }
+    }
+
+}
\ No newline at end of file

Modified: labs/jbosstm/branches/JBOSSTS_4_2_3_GA_SP/XTS/WSCF/classes/com/arjuna/mwlabs/wscf/model/as/coordinator/arjunacore/SynchronizationRecord.java
===================================================================
--- labs/jbosstm/branches/JBOSSTS_4_2_3_GA_SP/XTS/WSCF/classes/com/arjuna/mwlabs/wscf/model/as/coordinator/arjunacore/SynchronizationRecord.java	2007-09-24 15:09:30 UTC (rev 15334)
+++ labs/jbosstm/branches/JBOSSTS_4_2_3_GA_SP/XTS/WSCF/classes/com/arjuna/mwlabs/wscf/model/as/coordinator/arjunacore/SynchronizationRecord.java	2007-09-24 15:37:33 UTC (rev 15335)
@@ -1,20 +1,20 @@
 /*
  * JBoss, Home of Professional Open Source
  * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. 
- * See the copyright.txt in the distribution for a full listing 
+ * as indicated by the @author tags.
+ * See the copyright.txt in the distribution for a full listing
  * of individual contributors.
  * This copyrighted material is made available to anyone wishing to use,
  * modify, copy, or redistribute it subject to the terms and conditions
  * of the GNU General Public License, v. 2.0.
- * This program is distributed in the hope that it will be useful, but WITHOUT A 
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A 
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
  * PARTICULAR PURPOSE.  See the GNU General Public License for more details.
  * You should have received a copy of the GNU General Public License,
  * v. 2.0 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
  * MA  02110-1301, USA.
- * 
+ *
  * (C) 2005-2006,
  * @author JBoss Inc.
  */
@@ -58,7 +58,7 @@
 
 public class SynchronizationRecord implements com.arjuna.ats.arjuna.coordinator.SynchronizationRecord
 {
-    
+
     /**
      * Constructor.
      *
@@ -74,7 +74,7 @@
 	_priority = priority;
 	_quals = quals;
 	_id = new CoordinatorIdImple(id);
-	
+
 	if (_resourceHandle == null)
 	    wscfLogger.arjLoggerI18N.warn("com.arjuna.mwlabs.wscf.model.as.coordinator.arjunacore.SynchronizationRecord_1",
 					  new Object[]{_id});
@@ -97,7 +97,7 @@
             if (_resourceHandle != null)
             {
 		Outcome res = _resourceHandle.processMessage(new BeforeCompletion(_id));
-		
+
 		if (res != null)
 		{
 		    if (res instanceof CoordinationOutcome)
@@ -137,7 +137,7 @@
             if (_resourceHandle != null)
             {
 		Outcome res = _resourceHandle.processMessage(new AfterCompletion(_id, convertStatus(status)));
-		
+
 		if (res != null)
 		{
 		    if (res instanceof CoordinationOutcome)
@@ -169,7 +169,16 @@
     {
 	return _id;
     }
-    
+
+    public int compareTo(Object o) {
+        SynchronizationRecord sr = (SynchronizationRecord)o;
+        if(_id.equals(sr.get_uid())) {
+            return 0;
+        } else {
+            return _id.lessThan(sr.get_uid()) ? -1 : 1;
+        }
+    }
+
     private final CompletionStatus convertStatus (int result)
     {
 	switch (result)
@@ -183,10 +192,10 @@
 	    return Failure.instance();
 	}
     }
-    
+
     private Participant        _resourceHandle;
     private int                _priority;
     private Qualifier[]        _quals;
     private CoordinatorIdImple _id;
-    
+
 }

Modified: labs/jbosstm/branches/JBOSSTS_4_2_3_GA_SP/XTS/WSCF/classes/com/arjuna/mwlabs/wscf/model/twophase/arjunacore/SynchronizationRecord.java
===================================================================
--- labs/jbosstm/branches/JBOSSTS_4_2_3_GA_SP/XTS/WSCF/classes/com/arjuna/mwlabs/wscf/model/twophase/arjunacore/SynchronizationRecord.java	2007-09-24 15:09:30 UTC (rev 15334)
+++ labs/jbosstm/branches/JBOSSTS_4_2_3_GA_SP/XTS/WSCF/classes/com/arjuna/mwlabs/wscf/model/twophase/arjunacore/SynchronizationRecord.java	2007-09-24 15:37:33 UTC (rev 15335)
@@ -1,20 +1,20 @@
 /*
  * JBoss, Home of Professional Open Source
  * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. 
- * See the copyright.txt in the distribution for a full listing 
+ * as indicated by the @author tags.
+ * See the copyright.txt in the distribution for a full listing
  * of individual contributors.
  * This copyrighted material is made available to anyone wishing to use,
  * modify, copy, or redistribute it subject to the terms and conditions
  * of the GNU General Public License, v. 2.0.
- * This program is distributed in the hope that it will be useful, but WITHOUT A 
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A 
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
  * PARTICULAR PURPOSE.  See the GNU General Public License for more details.
  * You should have received a copy of the GNU General Public License,
  * v. 2.0 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
  * MA  02110-1301, USA.
- * 
+ *
  * (C) 2005-2006,
  * @author JBoss Inc.
  */
@@ -50,7 +50,7 @@
 
 public class SynchronizationRecord implements com.arjuna.ats.arjuna.coordinator.SynchronizationRecord
 {
-    
+
     /**
      * Constructor.
      *
@@ -64,7 +64,7 @@
     {
 	_resourceHandle = theResource;
 	_id = new CoordinatorIdImple(id);
-	
+
 	if (_resourceHandle == null)
 	    wscfLogger.arjLoggerI18N.warn("com.arjuna.mwlabs.wscf.model.twophase.arjunacore.ParticipantRecord_1",
 					  new Object[]{_id});
@@ -82,7 +82,7 @@
 	    try
 	    {
 		_resourceHandle.beforeCompletion();
-		
+
 		return true;
 	    }
 	    catch (Exception ex)
@@ -105,7 +105,7 @@
 	    catch (Exception ex)
 	    {
 	    }
-	    
+
 	    return true;
         }
 
@@ -116,7 +116,16 @@
     {
 	return _id;
     }
-    
+
+    public int compareTo(Object o) {
+        SynchronizationRecord sr = (SynchronizationRecord)o;
+        if(_id.equals(sr.get_uid())) {
+            return 0;
+        } else {
+            return _id.lessThan(sr.get_uid()) ? -1 : 1;
+        }
+    }
+
     private final int convertStatus (int result)
     {
 	switch (result)
@@ -130,8 +139,8 @@
 	    return CoordinationResult.CANCELLED;
 	}
     }
-    
+
     private Synchronization    _resourceHandle;
     private CoordinatorIdImple _id;
-    
+
 }




More information about the jboss-svn-commits mailing list