stratos-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r...@apache.org
Subject git commit: fixing merge issue
Date Fri, 31 Oct 2014 10:57:52 GMT
Repository: stratos
Updated Branches:
  refs/heads/4.0.0-grouping ff2e971d6 -> 746c37ae0


fixing merge issue


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

Branch: refs/heads/4.0.0-grouping
Commit: 746c37ae022c5771b406b92e249cc4cb23f5515a
Parents: ff2e971
Author: reka <rthirunavukkarasu23@gmail.com>
Authored: Fri Oct 31 16:25:24 2014 +0530
Committer: reka <rthirunavukkarasu23@gmail.com>
Committed: Fri Oct 31 16:25:24 2014 +0530

----------------------------------------------------------------------
 .../ApplicationStatusTopicReceiver.java         |  7 ++
 .../controller/topology/TopologyBuilder.java    | 71 ++++++++--------
 .../topology/TopologyEventPublisher.java        | 23 ++++--
 .../messaging/domain/topology/Cluster.java      |  6 +-
 .../ClusterStatusClusterCreatedEvent.java       | 85 ++++++++++++++++++++
 ...lusterStatusClusterCreatedEventListener.java | 24 ++++++
 ...rStatusClusterActivatedMessageProcessor.java |  2 +-
 ...terStatusClusterCreatedMessageProcessor.java | 59 ++++++++++++++
 ...StatusClusterInactivateMessageProcessor.java |  2 +-
 ...usterStatusClusterResetMessageProcessor.java |  2 +-
 ...StatusClusterTerminatedMessageProcessor.java |  2 +-
 ...tatusClusterTerminatingMessageProcessor.java |  2 +-
 .../ClusterStatusMessageProcessorChain.java     | 16 ++--
 13 files changed, 249 insertions(+), 52 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/746c37ae/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/application/status/receiver/ApplicationStatusTopicReceiver.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/application/status/receiver/ApplicationStatusTopicReceiver.java
b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/application/status/receiver/ApplicationStatusTopicReceiver.java
index d75039d..1fe14fd 100644
--- a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/application/status/receiver/ApplicationStatusTopicReceiver.java
+++ b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/application/status/receiver/ApplicationStatusTopicReceiver.java
@@ -71,6 +71,13 @@ public class ApplicationStatusTopicReceiver implements Runnable {
             }
         });
 
+        statusEventReceiver.addEventListener(new ClusterStatusClusterCreatedEventListener()
{
+            @Override
+            protected void onEvent(Event event) {
+                TopologyBuilder.handleClusterCreated((ClusterStatusClusterResettedEvent)
event);
+            }
+        });
+
         statusEventReceiver.addEventListener(new ClusterStatusClusterActivatedEventListener()
{
             @Override
             protected void onEvent(Event event) {

http://git-wip-us.apache.org/repos/asf/stratos/blob/746c37ae/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 5c25297..e70d182 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
@@ -119,7 +119,42 @@ public class TopologyBuilder {
         }
     }
 
-    public static void handleClusterCreated(ClusterStatusClusterResettedEvent event) {
+    public static void handleClusterCreated(ClusterStatusClusterCreatedEvent event) {
+        TopologyManager.acquireWriteLock();
+        Cluster cluster;
+
+        try {
+            Topology topology = TopologyManager.getTopology();
+            Service service = topology.getService(event.getServiceName());
+            if (service == null) {
+                log.error("Service " + event.getServiceName() +
+                        " not found in Topology, unable to update the cluster status to Created");
+                return;
+            }
+
+            if (service.clusterExists(event.getClusterId())) {
+                log.warn("Cluster " + event.getClusterId() + " is already in the Topology
");
+                return;
+            } else {
+                cluster = new Cluster(event.getServiceName(),
+                        event.getClusterId(), event.getDeploymentPolicyName(),
+                        event.getAutosScalePolicyName(), event.getAppId());
+                //cluster.setStatus(Status.Created);
+                cluster.setHostNames(event.getHostNames());
+                cluster.setTenantRange(event.getTenantRange());
+                cluster.setStatus(ClusterStatus.Created);
+                service.addCluster(cluster);
+                TopologyManager.updateTopology(topology);
+            }
+        } finally {
+            TopologyManager.releaseWriteLock();
+        }
+
+        TopologyEventPublisher.sendClusterCreatedEvent(cluster);
+    }
+
+
+    public static void handleClusterReset(ClusterStatusClusterResettedEvent event) {
 
         TopologyManager.acquireWriteLock();
 
@@ -152,7 +187,7 @@ public class TopologyBuilder {
             TopologyManager.releaseWriteLock();
         }
 
-        TopologyEventPublisher.sendClusterCreatedEvent(event.getAppId(), event.getServiceName(),
+        TopologyEventPublisher.sendClusterResetEvent(event.getAppId(), event.getServiceName(),
                 event.getClusterId());
     }
 
@@ -231,38 +266,6 @@ public class TopologyBuilder {
         TopologyEventPublisher.sendClusterRemovedEvent(ctxt, deploymentPolicy);
     }
 
-    /*public static void handleClusterMaintenanceMode(ClusterContext ctxt) {
-
-        Topology topology = TopologyManager.getTopology();
-        Service service = topology.getService(ctxt.getCartridgeType());
-        if (service == null) {
-            log.warn(String.format("Service %s does not exist",
-                    ctxt.getCartridgeType()));
-            return;
-        }
-
-        if (!service.clusterExists(ctxt.getClusterId())) {
-            log.warn(String.format("Cluster %s does not exist for service %s",
-                    ctxt.getClusterId(),
-                    ctxt.getCartridgeType()));
-            return;
-        }
-
-        try {
-            TopologyManager.acquireWriteLock();
-            Cluster cluster = service.getCluster(ctxt.getClusterId());
-            if (!cluster.isStateTransitionValid(ClusterStatus.Inactive)) {
-                log.error("Invalid State Transition from " + cluster.getStatus() + " to "
+ ClusterStatus.Inactive);
-            }
-            cluster.setStatus(ClusterStatus.Inactive);
-            TopologyManager.updateTopology(topology);
-        } finally {
-            TopologyManager.releaseWriteLock();
-        }
-        TopologyEventPublisher.sendClusterMaintenanceModeEvent(ctxt);
-    }*/
-
-
     public static void handleMemberSpawned(String serviceName,
                                            String clusterId, String partitionId,
                                            String privateIp, String publicIp, MemberContext
context) {

http://git-wip-us.apache.org/repos/asf/stratos/blob/746c37ae/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/topology/TopologyEventPublisher.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/topology/TopologyEventPublisher.java
b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/topology/TopologyEventPublisher.java
index eb1fb7f..3f58080 100644
--- a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/topology/TopologyEventPublisher.java
+++ b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/topology/TopologyEventPublisher.java
@@ -77,13 +77,22 @@ public class TopologyEventPublisher {
         }
     }
 
-    public static void sendClusterCreatedEvent(String appId, String serviceName, String clusterId)
{
-//        ClusterCreatedEvent clusterCreatedEvent = new ClusterCreatedEvent(new Cluster());
-//
-//        if(log.isInfoEnabled()) {
-//            log.info("Publishing cluster created event: " +clusterId);
-//        }
-//        publishEvent(clusterCreatedEvent);
+    public static void sendClusterResetEvent(String appId, String serviceName, String clusterId)
{
+        ClusterResetEvent clusterResetEvent = new ClusterResetEvent(appId,serviceName, clusterId);
+
+        if(log.isInfoEnabled()) {
+            log.info("Publishing cluster reset event: " + clusterId);
+        }
+        publishEvent(clusterResetEvent);
+    }
+
+    public static void sendClusterCreatedEvent(Cluster cluster) {
+        ClusterCreatedEvent clusterCreatedEvent = new ClusterCreatedEvent(cluster);
+
+        if(log.isInfoEnabled()) {
+            log.info("Publishing cluster created event: " + cluster.getClusterId());
+        }
+        publishEvent(clusterCreatedEvent);
     }
 
     public static void sendApplicationCreatedEvent (ApplicationCreatedEvent applicationCreatedEvent)
{

http://git-wip-us.apache.org/repos/asf/stratos/blob/746c37ae/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 1f69fd6..eef5a76 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
@@ -65,7 +65,7 @@ public class Cluster implements Serializable, LifeCycleStateTransitionBehavior<C
         this.clusterId = clusterId;
         this.deploymentPolicyName = deploymentPolicyName;
         this.autoscalePolicyName = autoscalePolicyName;
-        this.hostNames = new ArrayList<String>();
+        this.setHostNames(new ArrayList<String>());
         this.memberMap = new HashMap<String, Member>();
         this.appId = appId;
         this.clusterStateManager = new LifeCycleStateManager<ClusterStatus>(ClusterStatus.Created,
clusterId);
@@ -250,6 +250,10 @@ public class Cluster implements Serializable, LifeCycleStateTransitionBehavior<C
         return appId;
     }
 
+    public void setHostNames(List<String> hostNames) {
+        this.hostNames = hostNames;
+    }
+
 //    public ClusterStatus getTempStatus() {
 //        return status;
 //    }

http://git-wip-us.apache.org/repos/asf/stratos/blob/746c37ae/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/cluster/status/ClusterStatusClusterCreatedEvent.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/cluster/status/ClusterStatusClusterCreatedEvent.java
b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/cluster/status/ClusterStatusClusterCreatedEvent.java
new file mode 100644
index 0000000..5004cd8
--- /dev/null
+++ b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/cluster/status/ClusterStatusClusterCreatedEvent.java
@@ -0,0 +1,85 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.stratos.messaging.event.cluster.status;
+
+import org.apache.stratos.messaging.event.Event;
+
+import java.util.List;
+
+/**
+ * This event is fired by cartridge agent when it has started the server and
+ * applications are ready to serve the incoming requests.
+ */
+public class ClusterStatusClusterCreatedEvent extends Event {
+    private static final long serialVersionUID = 2625412714611885089L;
+
+    private final String serviceName;
+    private final String clusterId;
+    private String appId;
+    private String autosScalePolicyName;
+    private String deploymentPolicyName;
+    private List<String> hostNames;
+    private String tenantRange;
+
+    public ClusterStatusClusterCreatedEvent(String appId, String serviceName, String clusterId,
+                                            String autosScalePolicyName, String deploymentPolicyName)
{
+        this.serviceName = serviceName;
+        this.clusterId = clusterId;
+        this.appId = appId;
+        this.deploymentPolicyName = deploymentPolicyName;
+        this.autosScalePolicyName = autosScalePolicyName;
+    }
+
+    public String getServiceName() {
+        return serviceName;
+    }
+
+    public String getClusterId() {
+        return clusterId;
+    }
+
+    public String getAppId() {
+        return appId;
+    }
+
+    public String getAutosScalePolicyName() {
+        return autosScalePolicyName;
+    }
+
+    public String getDeploymentPolicyName() {
+        return deploymentPolicyName;
+    }
+
+    public List<String> getHostNames() {
+        return hostNames;
+    }
+
+    public void setHostNames(List<String> hostNames) {
+        this.hostNames = hostNames;
+    }
+
+    public String getTenantRange() {
+        return tenantRange;
+    }
+
+    public void setTenantRange(String tenantRange) {
+        this.tenantRange = tenantRange;
+    }
+}

http://git-wip-us.apache.org/repos/asf/stratos/blob/746c37ae/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/cluster/status/ClusterStatusClusterCreatedEventListener.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/cluster/status/ClusterStatusClusterCreatedEventListener.java
b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/cluster/status/ClusterStatusClusterCreatedEventListener.java
new file mode 100644
index 0000000..6ca5476
--- /dev/null
+++ b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/cluster/status/ClusterStatusClusterCreatedEventListener.java
@@ -0,0 +1,24 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.stratos.messaging.listener.cluster.status;
+
+import org.apache.stratos.messaging.listener.EventListener;
+
+public abstract class ClusterStatusClusterCreatedEventListener extends EventListener{
+}

http://git-wip-us.apache.org/repos/asf/stratos/blob/746c37ae/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/cluster/status/ClusterStatusClusterActivatedMessageProcessor.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/cluster/status/ClusterStatusClusterActivatedMessageProcessor.java
b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/cluster/status/ClusterStatusClusterActivatedMessageProcessor.java
index 694c3f3..92fe910 100644
--- a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/cluster/status/ClusterStatusClusterActivatedMessageProcessor.java
+++ b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/cluster/status/ClusterStatusClusterActivatedMessageProcessor.java
@@ -42,7 +42,7 @@ public class ClusterStatusClusterActivatedMessageProcessor extends MessageProces
                     jsonToObject(message, ClusterStatusClusterActivatedEvent.class);
 
             if(log.isDebugEnabled()) {
-                log.debug("Received ClusterActivatedEvent: " + event.toString());
+                log.debug("Received ClusterStatusClusterActivatedEvent: " + event.toString());
             }
             // Notify event listeners
             notifyEventListeners(event);

http://git-wip-us.apache.org/repos/asf/stratos/blob/746c37ae/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/cluster/status/ClusterStatusClusterCreatedMessageProcessor.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/cluster/status/ClusterStatusClusterCreatedMessageProcessor.java
b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/cluster/status/ClusterStatusClusterCreatedMessageProcessor.java
new file mode 100644
index 0000000..d6bdcd7
--- /dev/null
+++ b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/cluster/status/ClusterStatusClusterCreatedMessageProcessor.java
@@ -0,0 +1,59 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.stratos.messaging.message.processor.cluster.status;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.stratos.messaging.event.cluster.status.ClusterStatusClusterCreatedEvent;
+import org.apache.stratos.messaging.event.cluster.status.ClusterStatusClusterResettedEvent;
+import org.apache.stratos.messaging.message.processor.MessageProcessor;
+import org.apache.stratos.messaging.util.Util;
+
+
+public class ClusterStatusClusterCreatedMessageProcessor extends MessageProcessor {
+    private static final Log log = LogFactory.getLog(ClusterStatusClusterCreatedMessageProcessor.class);
+    private MessageProcessor nextProcessor;
+
+    @Override
+    public void setNext(MessageProcessor nextProcessor) {
+        this.nextProcessor = nextProcessor;
+    }
+
+    @Override
+    public boolean process(String type, String message, Object object) {
+        if (ClusterStatusClusterCreatedEvent.class.getName().equals(type)) {
+            // Parse complete message and build event
+            ClusterStatusClusterCreatedEvent event = (ClusterStatusClusterCreatedEvent) Util.
+                    jsonToObject(message, ClusterStatusClusterCreatedEvent.class);
+
+            if(log.isDebugEnabled()) {
+                log.debug("Received ClusterStatusClusterCreatedEvent: " + event.toString());
+            }
+            // Notify event listeners
+            notifyEventListeners(event);
+            return true;
+        } else {
+            if (nextProcessor != null) {
+                return nextProcessor.process(type, message, object);
+            } else {
+                throw new RuntimeException(String.format("Failed to process cluster created
message using available message processors: [type] %s [body] %s", type, message));
+            }
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/stratos/blob/746c37ae/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/cluster/status/ClusterStatusClusterInactivateMessageProcessor.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/cluster/status/ClusterStatusClusterInactivateMessageProcessor.java
b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/cluster/status/ClusterStatusClusterInactivateMessageProcessor.java
index 69918e2..f169fa2 100644
--- a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/cluster/status/ClusterStatusClusterInactivateMessageProcessor.java
+++ b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/cluster/status/ClusterStatusClusterInactivateMessageProcessor.java
@@ -42,7 +42,7 @@ public class ClusterStatusClusterInactivateMessageProcessor extends MessageProce
                                                 jsonToObject(message, ClusterStatusClusterInactivateEvent.class);
 
             if(log.isDebugEnabled()) {
-                log.debug("Received ClusterInActivateEvent: " + event.toString());
+                log.debug("Received ClusterStatusClusterInactivateEvent: " + event.toString());
             }
             // Notify event listeners
             notifyEventListeners(event);

http://git-wip-us.apache.org/repos/asf/stratos/blob/746c37ae/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/cluster/status/ClusterStatusClusterResetMessageProcessor.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/cluster/status/ClusterStatusClusterResetMessageProcessor.java
b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/cluster/status/ClusterStatusClusterResetMessageProcessor.java
index b5bf301..75bc007 100644
--- a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/cluster/status/ClusterStatusClusterResetMessageProcessor.java
+++ b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/cluster/status/ClusterStatusClusterResetMessageProcessor.java
@@ -42,7 +42,7 @@ public class ClusterStatusClusterResetMessageProcessor extends MessageProcessor
                     jsonToObject(message, ClusterStatusClusterResettedEvent.class);
 
             if(log.isDebugEnabled()) {
-                log.debug("Received AppStatusClusterCreatedEvent: " + event.toString());
+                log.debug("Received ClusterStatusClusterResettedEvent: " + event.toString());
             }
             // Notify event listeners
             notifyEventListeners(event);

http://git-wip-us.apache.org/repos/asf/stratos/blob/746c37ae/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/cluster/status/ClusterStatusClusterTerminatedMessageProcessor.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/cluster/status/ClusterStatusClusterTerminatedMessageProcessor.java
b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/cluster/status/ClusterStatusClusterTerminatedMessageProcessor.java
index 64b6c7b..04c09db 100644
--- a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/cluster/status/ClusterStatusClusterTerminatedMessageProcessor.java
+++ b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/cluster/status/ClusterStatusClusterTerminatedMessageProcessor.java
@@ -42,7 +42,7 @@ public class ClusterStatusClusterTerminatedMessageProcessor extends MessageProce
                     jsonToObject(message, ClusterStatusClusterTerminatedEvent.class);
 
             if (log.isDebugEnabled()) {
-                log.debug("Received AppStatusClusterTerminatedEvent: " + event.toString());
+                log.debug("Received ClusterStatusClusterTerminatedEvent: " + event.toString());
             }
             // Notify event listeners
             notifyEventListeners(event);

http://git-wip-us.apache.org/repos/asf/stratos/blob/746c37ae/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/cluster/status/ClusterStatusClusterTerminatingMessageProcessor.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/cluster/status/ClusterStatusClusterTerminatingMessageProcessor.java
b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/cluster/status/ClusterStatusClusterTerminatingMessageProcessor.java
index c161dd5..0db1896 100644
--- a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/cluster/status/ClusterStatusClusterTerminatingMessageProcessor.java
+++ b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/cluster/status/ClusterStatusClusterTerminatingMessageProcessor.java
@@ -42,7 +42,7 @@ public class ClusterStatusClusterTerminatingMessageProcessor extends MessageProc
                                                 jsonToObject(message, ClusterStatusClusterTerminatingEvent.class);
 
             if(log.isDebugEnabled()) {
-                log.debug("Received AppStatusClusterTerminatingEvent: " + event.toString());
+                log.debug("Received ClusterStatusClusterTerminatingEvent: " + event.toString());
             }
             // Notify event listeners
             notifyEventListeners(event);

http://git-wip-us.apache.org/repos/asf/stratos/blob/746c37ae/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/cluster/status/ClusterStatusMessageProcessorChain.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/cluster/status/ClusterStatusMessageProcessorChain.java
b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/cluster/status/ClusterStatusMessageProcessorChain.java
index 42092bc..28689fb 100644
--- a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/cluster/status/ClusterStatusMessageProcessorChain.java
+++ b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/cluster/status/ClusterStatusMessageProcessorChain.java
@@ -20,6 +20,7 @@ package org.apache.stratos.messaging.message.processor.cluster.status;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.apache.stratos.messaging.event.cluster.status.ClusterStatusClusterCreatedEvent;
 import org.apache.stratos.messaging.listener.EventListener;
 import org.apache.stratos.messaging.listener.cluster.status.*;
 import org.apache.stratos.messaging.message.processor.MessageProcessorChain;
@@ -30,17 +31,20 @@ import org.apache.stratos.messaging.message.processor.MessageProcessorChain;
 public class ClusterStatusMessageProcessorChain extends MessageProcessorChain {
     private static final Log log = LogFactory.getLog(ClusterStatusMessageProcessorChain.class);
 
-
+    private ClusterStatusClusterCreatedMessageProcessor clusterCreatedMessageProcessor;
     private ClusterStatusClusterActivatedMessageProcessor clusterActivatedMessageProcessor;
-    private ClusterStatusClusterResetMessageProcessor clusterCreatedMessageProcessor;
+    private ClusterStatusClusterResetMessageProcessor clusterResetMessageProcessor;
     private ClusterStatusClusterInactivateMessageProcessor clusterInactivateMessageProcessor;
     private ClusterStatusClusterTerminatedMessageProcessor clusterTerminatedMessageProcessor;
     private ClusterStatusClusterTerminatingMessageProcessor clusterTerminatingMessageProcessor;
     @Override
     protected void initialize() {
-        clusterCreatedMessageProcessor = new ClusterStatusClusterResetMessageProcessor();
+        clusterCreatedMessageProcessor = new ClusterStatusClusterCreatedMessageProcessor();
         add(clusterCreatedMessageProcessor);
 
+        clusterResetMessageProcessor = new ClusterStatusClusterResetMessageProcessor();
+        add(clusterResetMessageProcessor);
+
         clusterActivatedMessageProcessor = new ClusterStatusClusterActivatedMessageProcessor();
         add(clusterActivatedMessageProcessor);
 
@@ -60,8 +64,10 @@ public class ClusterStatusMessageProcessorChain extends MessageProcessorChain
{
 
     @Override
     public void addEventListener(EventListener eventListener) {
-        if(eventListener instanceof ClusterStatusClusterResetEventListener) {
-            clusterCreatedMessageProcessor.addEventListener(eventListener);
+        if(eventListener instanceof ClusterStatusClusterCreatedEventListener) {
+            clusterResetMessageProcessor.addEventListener(eventListener);
+        } else if(eventListener instanceof ClusterStatusClusterResetEventListener) {
+            clusterResetMessageProcessor.addEventListener(eventListener);
         } else if (eventListener instanceof ClusterStatusClusterInactivateEventListener)
{
             clusterInactivateMessageProcessor.addEventListener(eventListener);
         } else if (eventListener instanceof ClusterStatusClusterActivatedEventListener) {


Mime
View raw message