Updated Branches:
  refs/heads/master 939f673f3 -> 9a15bebe4

Updated cluster constructor and added deployment policy name in message 
processor


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

Branch: refs/heads/master
Commit: ca687ea40d88b87712007b14e276abb4005b3fb0
Parents: ebc27c3
Author: Imesh Gunaratne <[email protected]>
Authored: Thu Dec 12 21:16:33 2013 +0530
Committer: Imesh Gunaratne <[email protected]>
Committed: Thu Dec 12 21:16:33 2013 +0530

----------------------------------------------------------------------
 .../controller/topology/TopologyBuilder.java    |  9 ++------
 .../messaging/domain/topology/Cluster.java      | 22 +++++++-------------
 .../ClusterCreatedMessageProcessor.java         |  2 +-
 .../conf/templates/jndi.properties.template     |  2 ++
 4 files changed, 13 insertions(+), 22 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/ca687ea4/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/topology/TopologyBuilder.java
----------------------------------------------------------------------
diff --git 
a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/topology/TopologyBuilder.java
 
b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/topology/TopologyBuilder.java
index bfc94b4..9d83e98 100644
--- 
a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/topology/TopologyBuilder.java
+++ 
b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/topology/TopologyBuilder.java
@@ -115,21 +115,16 @@ public class TopologyBuilder {
                 // update the cluster
                 cluster = service.getCluster(registrant.getClusterId());
                 cluster.addHostName(registrant.getHostName());
-                
cluster.setAutoscalePolicyName(registrant.getAutoScalerPolicyName());
                 cluster.setTenantRange(registrant.getTenantRange());
                 cluster.setProperties(props);
                 cluster.setLbCluster(isLb);
-                
cluster.setDeploymentPolicyName(registrant.getDeploymentPolicyName());
-                
             } else {
-                cluster =
-                          new Cluster(registrant.getCartridgeType(), 
registrant.getClusterId(),
-                                      registrant.getAutoScalerPolicyName());
+                cluster = new Cluster(registrant.getCartridgeType(), 
registrant.getClusterId(),
+                                      registrant.getDeploymentPolicyName(), 
registrant.getAutoScalerPolicyName());
                 cluster.addHostName(registrant.getHostName());
                 cluster.setTenantRange(registrant.getTenantRange());
                 cluster.setProperties(props);
                 cluster.setLbCluster(isLb);
-                
cluster.setDeploymentPolicyName(registrant.getDeploymentPolicyName());
                 service.addCluster(cluster);
             }
             TopologyManager.getInstance().updateTopology(topology);

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/ca687ea4/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 288921c..6b94e34 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
@@ -37,12 +37,13 @@ public class Cluster implements Serializable {
 
        private static final long serialVersionUID = -361960242360176077L;
        
-       private String serviceName;
-    private String clusterId;
+       private final String serviceName;
+    private final String clusterId;
+    private final String autoscalePolicyName;
+    private final String deploymentPolicyName;
+
     private List<String> hostNames;
     private String tenantRange;
-    private String autoscalePolicyName;
-    private String deploymentPolicyName;
     private boolean isLbCluster;
     // Key: Member.memberId
     @XmlJavaTypeAdapter(MapAdapter.class)
@@ -51,11 +52,12 @@ public class Cluster implements Serializable {
     @XmlJavaTypeAdapter(MapAdapter.class)
     private Properties properties;
 
-    public Cluster(String serviceName, String clusterId, String 
autoscalePolicyName) {
+    public Cluster(String serviceName, String clusterId, String 
deploymentPolicyName, String autoscalePolicyName) {
         this.serviceName = serviceName;
         this.clusterId = clusterId;
-        this.hostNames = new ArrayList<String>();
+        this.deploymentPolicyName = deploymentPolicyName;
         this.autoscalePolicyName = autoscalePolicyName;
+        this.hostNames = new ArrayList<String>();
         this.memberMap = new HashMap<String, Member>();
     }
 
@@ -116,18 +118,10 @@ public class Cluster implements Serializable {
         return autoscalePolicyName;
     }
 
-    public void setAutoscalePolicyName(String autoscalePolicyName) {
-        this.autoscalePolicyName = autoscalePolicyName;
-    }
-
        public String getDeploymentPolicyName() {
                return deploymentPolicyName;
        }
 
-       public void setDeploymentPolicyName(String deploymentPolicy) {
-               this.deploymentPolicyName = deploymentPolicy;
-       }
-
     public String getLoadBalanceAlgorithmName() {
         return loadBalanceAlgorithmName;
     }

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/ca687ea4/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/topology/ClusterCreatedMessageProcessor.java
----------------------------------------------------------------------
diff --git 
a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/topology/ClusterCreatedMessageProcessor.java
 
b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/topology/ClusterCreatedMessageProcessor.java
index d1795b6..19ad02e 100644
--- 
a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/topology/ClusterCreatedMessageProcessor.java
+++ 
b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/topology/ClusterCreatedMessageProcessor.java
@@ -96,7 +96,7 @@ public class ClusterCreatedMessageProcessor extends 
MessageProcessor {
             }
 
             // Apply changes to the topology
-            Cluster cluster = new Cluster(event.getServiceName(), 
event.getClusterId(), event.getAutoscalingPolicyName());
+            Cluster cluster = new Cluster(event.getServiceName(), 
event.getClusterId(), event.getDeploymentPolicyName(), 
event.getAutoscalingPolicyName());
             cluster.addHostName(event.getHostName());
             cluster.setTenantRange(event.getTenantRange());
 

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/ca687ea4/products/load-balancer/modules/distribution/src/main/conf/templates/jndi.properties.template
----------------------------------------------------------------------
diff --git 
a/products/load-balancer/modules/distribution/src/main/conf/templates/jndi.properties.template
 
b/products/load-balancer/modules/distribution/src/main/conf/templates/jndi.properties.template
index 7720018..9ccf044 100644
--- 
a/products/load-balancer/modules/distribution/src/main/conf/templates/jndi.properties.template
+++ 
b/products/load-balancer/modules/distribution/src/main/conf/templates/jndi.properties.template
@@ -23,4 +23,6 @@
 connectionfactoryName=topicConnectionfactory
 
connectionfactory.topicConnectionfactory=amqp://admin:admin@carbon/carbon?brokerlist='tcp://$mb_ip:$mb_port'
 
java.naming.factory.initial=org.wso2.andes.jndi.PropertiesFileInitialContextFactory
+java.naming.provider.url=repository/conf/jndi.properties
+
 

Reply via email to