OW2 Consortium
Search OW2 Mail Archive: 

Advanced Search - Powered by Google


Mail Archive Home | gotm-commits List | October 2005 Index

<--  Date Index  --> <--  Thread Index  -->

CVS update of gotm/src/java/org/objectweb/gotm/lib (2 files)


    Date: Friday, October 21, 2005 @ 15:15:30
  Author: rouvoy
    Path: /cvsroot/gotm/gotm/src/java/org/objectweb/gotm/lib

Modified: coordination/TwoPCFeature.java event/SubscriberPool.java

* updating the 2PC protocol.
* minor optimization in the subscriber pool.


--------------------------------+
 coordination/TwoPCFeature.java |   10 ++++++----
 event/SubscriberPool.java      |   12 +++++++-----
 2 files changed, 13 insertions(+), 9 deletions(-)


Index: gotm/src/java/org/objectweb/gotm/lib/coordination/TwoPCFeature.java
diff -u 
gotm/src/java/org/objectweb/gotm/lib/coordination/TwoPCFeature.java:1.9 
gotm/src/java/org/objectweb/gotm/lib/coordination/TwoPCFeature.java:1.10
--- gotm/src/java/org/objectweb/gotm/lib/coordination/TwoPCFeature.java:1.9   
  Fri Oct 14 13:43:53 2005
+++ gotm/src/java/org/objectweb/gotm/lib/coordination/TwoPCFeature.java Fri 
Oct 21 15:15:30 2005
@@ -23,7 +23,7 @@
  Contributor(s): .
  
  ---------------------------------------------------------------------
- $Id: TwoPCFeature.java,v 1.9 2005/10/14 11:43:53 rouvoy Exp $
+ $Id: TwoPCFeature.java,v 1.10 2005/10/21 13:15:30 rouvoy Exp $
  ====================================================================*/
 
 package org.objectweb.gotm.lib.coordination;
@@ -43,8 +43,8 @@
  * Implementation of a Two-Phase Commit Protocol.
  * @author <a href="mailto:Romain.Rouvoy@xxxxxxx";>Romain Rouvoy</a>
  * @created 5 janv. 2005
- * @modified $Date: 2005/10/14 11:43:53 $
- * @version $Revision: 1.9 $
+ * @modified $Date: 2005/10/21 13:15:30 $
+ * @version $Revision: 1.10 $
  * @fractal.itf name="2pc" 
signature="org.objectweb.transaction.api.coordination.CoordinationFeature"
  * @fractal.itf name="prepare" role="client" 
signature="org.objectweb.transaction.api.coordination.CoordinationFeature"
  * @fractal.itf name="commit" role="client" 
signature="org.objectweb.transaction.api.coordination.CoordinationFeature"
@@ -100,7 +100,9 @@
             prepare().execute(context);
             Vector enf_rollback = (Vector) 
context.get(ResourceVoteRollback.vote);
             if (enf_rollback.size() == 0) {
-                commit().execute(context);
+                Vector enf_commit = (Vector) 
context.get(ResourceVoteCommit.vote);
+                if (enf_commit.size() != 0)
+                    commit().execute(context);
             } else {
                 abort().execute(context);
             }
Index: gotm/src/java/org/objectweb/gotm/lib/event/SubscriberPool.java
diff -u gotm/src/java/org/objectweb/gotm/lib/event/SubscriberPool.java:1.3 
gotm/src/java/org/objectweb/gotm/lib/event/SubscriberPool.java:1.4
--- gotm/src/java/org/objectweb/gotm/lib/event/SubscriberPool.java:1.3  Tue 
Aug 16 15:36:18 2005
+++ gotm/src/java/org/objectweb/gotm/lib/event/SubscriberPool.java      Fri 
Oct 21 15:15:30 2005
@@ -23,7 +23,7 @@
 Contributor(s): .
 
 ---------------------------------------------------------------------
-$Id: SubscriberPool.java,v 1.3 2005/08/16 13:36:18 rouvoy Exp $
+$Id: SubscriberPool.java,v 1.4 2005/10/21 13:15:30 rouvoy Exp $
 ====================================================================*/
 package org.objectweb.gotm.lib.event;
 
@@ -31,6 +31,7 @@
 import java.util.Collection;
 import java.util.HashMap;
 import java.util.Map;
+import java.util.Set;
 
 import org.objectweb.fractal.api.control.LifeCycleController;
 import org.objectweb.fractal.lib.LoggablePrimitive;
@@ -41,8 +42,8 @@
 /**
  * @author <a href="mailto:Romain.Rouvoy@xxxxxxx";>Romain Rouvoy</a>
  * @created 11 juil. 2005
- * @modified $Date: 2005/08/16 13:36:18 $
- * @version $Revision: 1.3 $
+ * @modified $Date: 2005/10/21 13:15:30 $
+ * @version $Revision: 1.4 $
  * @fractal.itf 
  */
 public class SubscriberPool
@@ -51,7 +52,7 @@
     /**
      * Map containing all the available <code>topics</code>.
      */
-    private Map topics = new HashMap();
+    private final Map topics = new HashMap();
 
     /* (non-Javadoc)
      * @see org.objectweb.fractal.api.control.CacheController#getCacheState()
@@ -87,7 +88,8 @@
      * @see org.objectweb.gotm.lib.event.SubscriberProvider#listTopics()
      */
     public Event[] listTopics() {
-        return (Event[]) this.topics.keySet().toArray(new Event[0]);
+        Set keySet = this.topics.keySet();
+        return (Event[]) keySet.toArray(new Event[keySet.size()]);
     }
 
     /* (non-Javadoc)



<--  Date Index  --> <--  Thread Index  -->

Reply via email to:

Powered by MHonArc.

Copyright © 2006-2007, OW2 Consortium | contact | webmaster.