[Jboss-cvs] JBossAS SVN: r56210 - in trunk: aspects/src/main/org/jboss/aspects/remoting cluster/src/main/org/jboss/ha/framework/interfaces

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Wed Aug 23 20:28:16 EDT 2006


Author: bdecoste
Date: 2006-08-23 20:28:13 -0400 (Wed, 23 Aug 2006)
New Revision: 56210

Modified:
   trunk/aspects/src/main/org/jboss/aspects/remoting/FamilyWrapper.java
   trunk/cluster/src/main/org/jboss/ha/framework/interfaces/ClusteringTargetsRepository.java
   trunk/cluster/src/main/org/jboss/ha/framework/interfaces/FamilyClusterInfo.java
   trunk/cluster/src/main/org/jboss/ha/framework/interfaces/FamilyClusterInfoImpl.java
Log:
fixed ArrayList vs List CCEs

Modified: trunk/aspects/src/main/org/jboss/aspects/remoting/FamilyWrapper.java
===================================================================
--- trunk/aspects/src/main/org/jboss/aspects/remoting/FamilyWrapper.java	2006-08-23 23:45:19 UTC (rev 56209)
+++ trunk/aspects/src/main/org/jboss/aspects/remoting/FamilyWrapper.java	2006-08-24 00:28:13 UTC (rev 56210)
@@ -25,7 +25,7 @@
 import org.jboss.ha.framework.interfaces.FamilyClusterInfo;
 
 import java.io.IOException;
-import java.util.ArrayList;
+import java.util.List;
 /**
  *
  * @author <a href="mailto:bill at jboss.org">Bill Burke</a>
@@ -39,7 +39,7 @@
 
    public FamilyWrapper() {}
 
-   public FamilyWrapper(String proxyFamilyName, ArrayList targets)
+   public FamilyWrapper(String proxyFamilyName, List targets)
    {
       info = ClusteringTargetsRepository.initTarget(proxyFamilyName, targets);
    }
@@ -62,7 +62,7 @@
       throws IOException, ClassNotFoundException
    {
       String proxyFamilyName = (String)in.readObject();
-      ArrayList targets = (ArrayList)in.readObject();
+      List targets = (List)in.readObject();
       // keep a reference on our family object
       //
       this.info = ClusteringTargetsRepository.initTarget(proxyFamilyName, targets);

Modified: trunk/cluster/src/main/org/jboss/ha/framework/interfaces/ClusteringTargetsRepository.java
===================================================================
--- trunk/cluster/src/main/org/jboss/ha/framework/interfaces/ClusteringTargetsRepository.java	2006-08-23 23:45:19 UTC (rev 56209)
+++ trunk/cluster/src/main/org/jboss/ha/framework/interfaces/ClusteringTargetsRepository.java	2006-08-24 00:28:13 UTC (rev 56210)
@@ -21,7 +21,7 @@
   */
 package org.jboss.ha.framework.interfaces;
 
-import java.util.ArrayList;
+import java.util.List;
 import java.util.Hashtable;
 
 /**
@@ -55,12 +55,12 @@
    
    // Static --------------------------------------------------------
    
-   public synchronized static FamilyClusterInfo initTarget (String familyName, ArrayList targets)
+   public synchronized static FamilyClusterInfo initTarget (String familyName, List targets)
    {
       return initTarget (familyName, targets, 0L);
    }
    
-   public synchronized static FamilyClusterInfo initTarget (String familyName, ArrayList targets, long viewId)
+   public synchronized static FamilyClusterInfo initTarget (String familyName, List targets, long viewId)
    {
       // this method must be somehow synchronized to avoid multiple FamilyClusterInfoImpl 
       // for the same familyName in multi-threaded app accessing the same bean

Modified: trunk/cluster/src/main/org/jboss/ha/framework/interfaces/FamilyClusterInfo.java
===================================================================
--- trunk/cluster/src/main/org/jboss/ha/framework/interfaces/FamilyClusterInfo.java	2006-08-23 23:45:19 UTC (rev 56209)
+++ trunk/cluster/src/main/org/jboss/ha/framework/interfaces/FamilyClusterInfo.java	2006-08-24 00:28:13 UTC (rev 56210)
@@ -21,7 +21,6 @@
   */
 package org.jboss.ha.framework.interfaces;
 
-import java.util.ArrayList;
 import java.util.List;
 
 /**
@@ -77,7 +76,7 @@
     * <strong>NOTE:</strong> Implementations should synchronize on themselves 
     * when executing this method (see JBAS-2071).
     */
-   public List updateClusterInfo (ArrayList targets, long viewId);
+   public List updateClusterInfo (List targets, long viewId);
    
    public boolean currentMembershipInSyncWithViewId();
    

Modified: trunk/cluster/src/main/org/jboss/ha/framework/interfaces/FamilyClusterInfoImpl.java
===================================================================
--- trunk/cluster/src/main/org/jboss/ha/framework/interfaces/FamilyClusterInfoImpl.java	2006-08-23 23:45:19 UTC (rev 56209)
+++ trunk/cluster/src/main/org/jboss/ha/framework/interfaces/FamilyClusterInfoImpl.java	2006-08-24 00:28:13 UTC (rev 56210)
@@ -42,7 +42,7 @@
    // Attributes ----------------------------------------------------
    
    public String familyName = null;
-   ArrayList targets = null;
+   List targets = null;
    long currentViewId = 0;
    boolean isViewMembersInSyncWithViewId = false;
    
@@ -55,10 +55,14 @@
    
    private FamilyClusterInfoImpl (){ }
    
-   protected FamilyClusterInfoImpl (String familyName, ArrayList targets, long viewId)
+   protected FamilyClusterInfoImpl (String familyName, List targets, long viewId)
    {
       this.familyName = familyName;
-      this.targets = (ArrayList) targets.clone();
+      this.targets = new ArrayList();
+      synchronized (targets)
+      {
+         this.targets.addAll(targets);
+      }
       this.currentViewId = viewId;
       
       this.isViewMembersInSyncWithViewId = false;
@@ -89,7 +93,11 @@
    {
       synchronized (this)
       {
-         ArrayList tmp = (ArrayList) targets.clone();
+         ArrayList tmp = new ArrayList();
+         synchronized (targets)
+         {
+            tmp.addAll(targets);
+         }
          tmp.remove (target);
          this.targets = tmp;
          this.isViewMembersInSyncWithViewId = false;
@@ -97,11 +105,15 @@
       }      
    }
    
-   public List updateClusterInfo (ArrayList targets, long viewId)
+   public List updateClusterInfo (List targets, long viewId)
    {
       synchronized (this)
       {
-         this.targets = (ArrayList) targets.clone();
+         this.targets = new ArrayList();
+         synchronized (targets)
+         {
+            this.targets.addAll(targets);
+         }
          this.currentViewId = viewId;
          this.isViewMembersInSyncWithViewId = true;
          return Collections.unmodifiableList(this.targets);




More information about the jboss-cvs-commits mailing list