You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stratos.apache.org by re...@apache.org on 2015/06/30 07:54:20 UTC

[2/5] stratos git commit: fixing concurrent modification exception

fixing concurrent modification exception


Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/d227bb4e
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/d227bb4e
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/d227bb4e

Branch: refs/heads/master
Commit: d227bb4e580252e883396b5737141cb7ebb6a488
Parents: 33aac2e
Author: reka <rt...@gmail.com>
Authored: Mon Jun 29 15:52:52 2015 +0530
Committer: reka <rt...@gmail.com>
Committed: Tue Jun 30 11:23:49 2015 +0530

----------------------------------------------------------------------
 .../org/apache/stratos/messaging/domain/topology/Cluster.java   | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/d227bb4e/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/domain/topology/Cluster.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/domain/topology/Cluster.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/domain/topology/Cluster.java
index babf38c..b734499 100644
--- a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/domain/topology/Cluster.java
+++ b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/domain/topology/Cluster.java
@@ -28,6 +28,7 @@ import javax.xml.bind.annotation.XmlRootElement;
 import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
 import java.io.Serializable;
 import java.util.*;
+import java.util.concurrent.ConcurrentHashMap;
 
 /**
  * Defines a cluster of a service.
@@ -89,9 +90,9 @@ public class Cluster implements Serializable {
         this.deploymentPolicyName = deploymentPolicyName;
         this.autoscalePolicyName = autoscalePolicyName;
         this.setHostNames(new ArrayList<String>());
-        this.memberMap = new HashMap<String, Member>();
+        this.memberMap = new ConcurrentHashMap<String, Member>();
         this.appId = appId;
-        this.setInstanceIdToInstanceContextMap(new HashMap<String, ClusterInstance>());
+        this.setInstanceIdToInstanceContextMap(new ConcurrentHashMap<String, ClusterInstance>());
         this.accessUrls = new ArrayList<String>();
         this.kubernetesServices = new ArrayList<KubernetesService>();
     }