stratos-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r...@apache.org
Subject git commit: adding cluster reset processor support
Date Fri, 31 Oct 2014 09:29:25 GMT
Repository: stratos
Updated Branches:
  refs/heads/4.0.0-grouping 696bc0d24 -> 4de85b55b


adding cluster reset processor support


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

Branch: refs/heads/4.0.0-grouping
Commit: 4de85b55bcce498cffcf3aa89a2d01c9215783d6
Parents: 696bc0d
Author: reka <rthirunavukkarasu23@gmail.com>
Authored: Fri Oct 31 14:59:14 2014 +0530
Committer: reka <rthirunavukkarasu23@gmail.com>
Committed: Fri Oct 31 14:59:14 2014 +0530

----------------------------------------------------------------------
 .../AutoscalerTopologyEventReceiver.java        | 16 +++++++++++--
 .../topology/ClusterResetEventListener.java     | 24 ++++++++++++++++++++
 .../topology/TopologyMessageProcessorChain.java |  6 +++++
 3 files changed, 44 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/4de85b55/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/message/receiver/topology/AutoscalerTopologyEventReceiver.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/message/receiver/topology/AutoscalerTopologyEventReceiver.java
b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/message/receiver/topology/AutoscalerTopologyEventReceiver.java
index aacc31c..4678250 100644
--- a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/message/receiver/topology/AutoscalerTopologyEventReceiver.java
+++ b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/message/receiver/topology/AutoscalerTopologyEventReceiver.java
@@ -168,13 +168,13 @@ public class AutoscalerTopologyEventReceiver implements Runnable {
             }
         });
 
-        topologyEventReceiver.addEventListener(new ClusterCreatedEventListener() {
+        topologyEventReceiver.addEventListener(new ClusterResetEventListener() {
             @Override
             protected void onEvent(Event event) {
 
                 log.info("[ClusterCreatedEvent] Received: " + event.getClass());
 
-                ClusterCreatedEvent clusterCreatedEvent = (ClusterCreatedEvent) event;
+                ClusterResetEvent clusterCreatedEvent = (ClusterResetEvent) event;
                 String clusterId = clusterCreatedEvent.getClusterId();
                 AbstractClusterMonitor clusterMonitor =
                         (AbstractClusterMonitor) AutoscalerContext.getInstance().getMonitor(clusterId);
@@ -186,6 +186,18 @@ public class AutoscalerTopologyEventReceiver implements Runnable {
             }
         });
 
+        topologyEventReceiver.addEventListener(new ClusterCreatedEventListener() {
+            @Override
+            protected void onEvent(Event event) {
+
+                log.info("[ClusterCreatedEvent] Received: " + event.getClass());
+
+                ClusterCreatedEvent clusterCreatedEvent = (ClusterCreatedEvent) event;
+                //TODO notify the monitor about cluster creation
+
+            }
+        });
+
         topologyEventReceiver.addEventListener(new ClusterInActivateEventListener() {
             @Override
             protected void onEvent(Event event) {

http://git-wip-us.apache.org/repos/asf/stratos/blob/4de85b55/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/topology/ClusterResetEventListener.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/topology/ClusterResetEventListener.java
b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/topology/ClusterResetEventListener.java
new file mode 100644
index 0000000..1516590
--- /dev/null
+++ b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/topology/ClusterResetEventListener.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.topology;
+
+import org.apache.stratos.messaging.listener.EventListener;
+
+public abstract class ClusterResetEventListener extends EventListener{
+}

http://git-wip-us.apache.org/repos/asf/stratos/blob/4de85b55/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/topology/TopologyMessageProcessorChain.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/topology/TopologyMessageProcessorChain.java
b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/topology/TopologyMessageProcessorChain.java
index 048e9a3..f5ada89 100644
--- a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/topology/TopologyMessageProcessorChain.java
+++ b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/topology/TopologyMessageProcessorChain.java
@@ -36,6 +36,7 @@ public class TopologyMessageProcessorChain extends MessageProcessorChain
{
     private ServiceCreatedMessageProcessor serviceCreatedMessageProcessor;
     private ServiceRemovedMessageProcessor serviceRemovedMessageProcessor;
     private ClusterCreatedMessageProcessor clusterCreatedMessageProcessor;
+    private ClusterResetMessageProcessor clusterResetMessageProcessor;
     private ClusterActivatedProcessor clusterActivatedProcessor;
     private ClusterInActivateProcessor clusterInActivateProcessor;
     private ClusterRemovedMessageProcessor clusterRemovedMessageProcessor;
@@ -75,6 +76,9 @@ public class TopologyMessageProcessorChain extends MessageProcessorChain
{
         clusterTerminatedProcessor = new ClusterTerminatedProcessor();
         add(clusterTerminatedProcessor);
 
+        clusterResetMessageProcessor = new ClusterResetMessageProcessor();
+        add(clusterResetMessageProcessor);
+
         clusterTerminatingProcessor = new ClusterTerminatingProcessor();
         add(clusterTerminatingProcessor);
 
@@ -117,6 +121,8 @@ public class TopologyMessageProcessorChain extends MessageProcessorChain
{
             clusterRemovedMessageProcessor.addEventListener(eventListener);
         } else if(eventListener instanceof ClusterTerminatedEventListener){
             clusterTerminatedProcessor.addEventListener(eventListener);
+        } else if(eventListener instanceof ClusterResetEventListener){
+            clusterResetMessageProcessor.addEventListener(eventListener);
         } else if(eventListener instanceof  ClusterTerminatingEventListener){
             clusterTerminatingProcessor.addEventListener(eventListener);
         }else if (eventListener instanceof InstanceSpawnedEventListener) {


Mime
View raw message