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 2014/12/05 14:40:30 UTC

[4/5] stratos git commit: adding instance prefix to events, , processor and listener

adding instance prefix to events,, processor and listener


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

Branch: refs/heads/master
Commit: cf1b372724f2f4ae63878a24dd6e6fdbcc6be65a
Parents: 5f72e3d
Author: reka <rt...@gmail.com>
Authored: Fri Dec 5 12:35:13 2014 +0530
Committer: reka <rt...@gmail.com>
Committed: Fri Dec 5 12:35:35 2014 +0530

----------------------------------------------------------------------
 .../applications/topic/ApplicationBuilder.java  |  32 ++---
 .../topic/ApplicationsEventPublisher.java       |  48 ++++---
 .../AutoscalerTopologyEventReceiver.java        |  28 ++--
 .../monitor/cluster/AbstractClusterMonitor.java |  26 ++--
 .../monitor/cluster/ClusterMonitorFactory.java  |   2 +-
 .../cluster/ClusterStatusActiveProcessor.java   |   2 +-
 .../group/GroupStatusActiveProcessor.java       |   4 +-
 .../group/GroupStatusTerminatedProcessor.java   |   4 +-
 .../group/GroupStatusTerminatingProcessor.java  |   2 +-
 .../stratos/autoscaler/util/AutoscalerUtil.java |   4 +-
 .../application/ApplicationTopicReceiver.java   |   4 +-
 .../messaging/topology/TopologyBuilder.java     |  12 +-
 .../topology/TopologyEventPublisher.java        |   8 +-
 .../applications/ApplicationActivatedEvent.java |  46 ------
 .../ApplicationInstanceActivatedEvent.java      |  46 ++++++
 .../event/applications/GroupActivatedEvent.java |  54 -------
 .../applications/GroupInactivatedEvent.java     |  51 -------
 .../GroupInstanceActivatedEvent.java            |  54 +++++++
 .../applications/GroupInstanceCreatedEvent.java |  55 +++++++
 .../GroupInstanceInactivatedEvent.java          |  51 +++++++
 .../GroupInstanceTerminatedEvent.java           |  54 +++++++
 .../GroupInstanceTerminatingEvent.java          |  54 +++++++
 .../event/applications/GroupResetEvent.java     |  54 -------
 .../applications/GroupTerminatedEvent.java      |  54 -------
 .../applications/GroupTerminatingEvent.java     |  54 -------
 .../event/topology/ClusterActivatedEvent.java   |  63 --------
 .../event/topology/ClusterInactivateEvent.java  |  63 --------
 .../topology/ClusterInstanceActivatedEvent.java |  63 ++++++++
 .../ClusterInstanceInactivateEvent.java         |  63 ++++++++
 .../ClusterInstanceTerminatedEvent.java         |  63 ++++++++
 .../ClusterInstanceTerminatingEvent.java        |  61 ++++++++
 .../event/topology/ClusterTerminatedEvent.java  |  63 --------
 .../event/topology/ClusterTerminatingEvent.java |  61 --------
 .../ApplicationActivatedEventListener.java      |  27 ----
 .../ApplicationInactivatedEventListener.java    |  27 ----
 ...plicationInstanceActivatedEventListener.java |  27 ++++
 ...icationInstanceInactivatedEventListener.java |  27 ++++
 ...licationInstanceTerminatedEventListener.java |  27 ++++
 ...icationInstanceTerminatingEventListener.java |  27 ++++
 .../ApplicationTerminatedEventListener.java     |  27 ----
 .../ApplicationTerminatingEventListener.java    |  27 ----
 .../GroupActivatedEventListener.java            |  24 ----
 .../GroupInactivateEventListener.java           |  24 ----
 .../GroupInstanceActivatedEventListener.java    |  24 ++++
 .../GroupInstanceCreatedEventListener.java      |  24 ++++
 .../GroupInstanceInactivateEventListener.java   |  24 ++++
 .../GroupInstanceTerminatedEventListener.java   |  24 ++++
 .../GroupInstanceTerminatingEventListener.java  |  24 ++++
 .../applications/GroupResetEventListener.java   |  24 ----
 .../GroupTerminatedEventListener.java           |  24 ----
 .../GroupTerminatingEventListener.java          |  24 ----
 .../topology/ClusterActivatedEventListener.java |  24 ----
 .../ClusterInActivateEventListener.java         |  24 ----
 .../ClusterInstanceActivatedEventListener.java  |  24 ++++
 .../ClusterInstanceInActivateEventListener.java |  24 ++++
 .../ClusterInstanceTerminatedEventListener.java |  24 ++++
 ...ClusterInstanceTerminatingEventListener.java |  24 ++++
 .../ClusterTerminatedEventListener.java         |  24 ----
 .../ClusterTerminatingEventListener.java        |  24 ----
 .../ApplicationActivatedMessageProcessor.java   | 114 ---------------
 .../ApplicationInactivatedMessageProcessor.java | 114 ---------------
 ...cationInstanceActivatedMessageProcessor.java | 114 +++++++++++++++
 ...tionInstanceInactivatedMessageProcessor.java | 114 +++++++++++++++
 ...ationInstanceTerminatedMessageProcessor.java |  97 +++++++++++++
 ...tionInstanceTerminatingMessageProcessor.java | 113 +++++++++++++++
 .../ApplicationTerminatedMessageProcessor.java  |  97 -------------
 .../ApplicationTerminatingMessageProcessor.java | 113 ---------------
 .../ApplicationsMessageProcessorChain.java      |  54 +++----
 .../applications/GroupActivatedProcessor.java   | 120 ----------------
 .../applications/GroupInActivateProcessor.java  | 120 ----------------
 .../GroupInstanceActivatedProcessor.java        | 120 ++++++++++++++++
 .../GroupInstanceCreatedProcessor.java          | 116 +++++++++++++++
 .../GroupInstanceInActivateProcessor.java       | 120 ++++++++++++++++
 .../GroupInstanceTerminatingProcessor.java      | 122 ++++++++++++++++
 .../applications/GroupResetProcessor.java       | 121 ----------------
 .../applications/GroupTerminatedProcessor.java  | 121 ----------------
 .../applications/GroupTerminatingProcessor.java | 122 ----------------
 .../topology/ClusterActivatedProcessor.java     | 143 -------------------
 .../topology/ClusterInActivateProcessor.java    | 139 ------------------
 .../ClusterInstanceActivatedProcessor.java      | 143 +++++++++++++++++++
 .../ClusterInstanceInActivateProcessor.java     | 139 ++++++++++++++++++
 .../ClusterInstanceTerminatedProcessor.java     | 141 ++++++++++++++++++
 .../ClusterInstanceTerminatingProcessor.java    | 141 ++++++++++++++++++
 .../topology/ClusterTerminatedProcessor.java    | 141 ------------------
 .../topology/ClusterTerminatingProcessor.java   | 141 ------------------
 .../topology/TopologyMessageProcessorChain.java |  24 ++--
 86 files changed, 2498 insertions(+), 2617 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/cf1b3727/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/applications/topic/ApplicationBuilder.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/applications/topic/ApplicationBuilder.java b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/applications/topic/ApplicationBuilder.java
index 042497c..b0db089 100644
--- a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/applications/topic/ApplicationBuilder.java
+++ b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/applications/topic/ApplicationBuilder.java
@@ -107,7 +107,7 @@ public class ApplicationBuilder {
             application.addInstance(instanceId, applicationInstance);
             //updateApplicationMonitor(appId, status);
             ApplicationHolder.persistApplication(application);
-            //ApplicationsEventPublisher.sendApplicationActivatedEvent(appId);
+            ApplicationsEventPublisher.sendApplicationInstanceCreatedEvent(appId, applicationInstance);
         } else {
             log.warn(String.format("Application Instance Context already exists" +
                     " [appId] %s [ApplicationInstanceId] %s", appId, instanceId));
@@ -115,7 +115,7 @@ public class ApplicationBuilder {
         return applicationInstance;
     }
 
-    public static void handleApplicationActivatedEvent(String appId, String instanceId) {
+    public static void handleApplicationInstanceActivatedEvent(String appId, String instanceId) {
         if (log.isDebugEnabled()) {
             log.debug("Handling application activation event: [application-id] " + appId);
         }
@@ -136,7 +136,7 @@ public class ApplicationBuilder {
             application.setStatus(status, instanceId);
             updateApplicationMonitor(appId, status, instanceId);
             ApplicationHolder.persistApplication(application);
-            ApplicationsEventPublisher.sendApplicationActivatedEvent(appId, instanceId);
+            ApplicationsEventPublisher.sendApplicationInstanceActivatedEvent(appId, instanceId);
         } else {
             log.warn(String.format("Application state transition is not valid: [application-id] %s " +
                     " [instance-id] %s [current-status] %s [status-requested] %s",
@@ -201,7 +201,7 @@ public class ApplicationBuilder {
                     application.setStatus(status, context1.getInstanceId());
                     updateApplicationMonitor(appId, status, context1.getInstanceId());
                     ApplicationHolder.persistApplication(application);
-                    ApplicationsEventPublisher.sendApplicationTerminatingEvent(appId, context1.getInstanceId());
+                    ApplicationsEventPublisher.sendApplicationInstanceTerminatingEvent(appId, context1.getInstanceId());
                 } else {
                     log.warn(String.format("Application Instance state transition is not valid: [application-id] %s " +
                                     " [instance-id] %s [current-status] %s [status-requested] %s", appId,
@@ -241,7 +241,7 @@ public class ApplicationBuilder {
         return true;
     }
 
-    public static void handleApplicationTerminatedEvent(String appId, String instanceId) {
+    public static void handleApplicationInstanceTerminatedEvent(String appId, String instanceId) {
         if (log.isDebugEnabled()) {
             log.debug("Handling application terminated event: [application-id] " + appId);
         }
@@ -265,7 +265,7 @@ public class ApplicationBuilder {
                 ApplicationHolder.removeApplication(appId);
                 log.info("Application is removed: [application-id] " + appId);
 
-                ApplicationsEventPublisher.sendApplicationTerminatedEvent(appId, clusterData);
+                ApplicationsEventPublisher.sendApplicationInstanceTerminatedEvent(appId, clusterData);
             } else {
                 log.warn(String.format("Application state transition is not valid: [application-id] %s " +
                         " [current-status] %s [status-requested] %s", appId,
@@ -275,7 +275,7 @@ public class ApplicationBuilder {
         }
     }
 
-    public static void handleGroupTerminatedEvent(String appId, String groupId, String instanceId) {
+    public static void handleGroupInstanceTerminatedEvent(String appId, String groupId, String instanceId) {
         if (log.isDebugEnabled()) {
             log.debug("Handling group terminated event: [group-id] " + groupId +
                     " [application-id] " + appId);
@@ -304,7 +304,7 @@ public class ApplicationBuilder {
                 //setting the status, persist and publish
                 updateGroupMonitor(appId, groupId, status, instanceId);
                 ApplicationHolder.persistApplication(application);
-                ApplicationsEventPublisher.sendGroupTerminatedEvent(appId, groupId, instanceId);
+                ApplicationsEventPublisher.sendGroupInstanceTerminatedEvent(appId, groupId, instanceId);
             } else {
                 log.warn("Group state transition is not valid: [group-id] " + groupId +
                         " [instance-id] " + instanceId + " [current-state] " + context.getStatus()
@@ -318,7 +318,7 @@ public class ApplicationBuilder {
 
     }
 
-    public static void handleGroupActivatedEvent(String appId, String groupId, String instanceId) {
+    public static void handleGroupInstanceActivatedEvent(String appId, String groupId, String instanceId) {
         if (log.isDebugEnabled()) {
             log.debug("Handling group activation for the [group-id]: " + groupId +
                     " in the [application-id] " + appId);
@@ -347,7 +347,7 @@ public class ApplicationBuilder {
                 //setting the status, persist and publish
                 updateGroupMonitor(appId, groupId, status, instanceId);
                 ApplicationHolder.persistApplication(application);
-                ApplicationsEventPublisher.sendGroupActivatedEvent(appId, groupId, instanceId);
+                ApplicationsEventPublisher.sendGroupInstanceActivatedEvent(appId, groupId, instanceId);
             } else {
                 log.warn("Group state transition is not valid: [group-id] " + groupId +
                         " [instance-id] " + instanceId + " [current-state] " + context.getStatus()
@@ -360,7 +360,7 @@ public class ApplicationBuilder {
         }
     }
 
-    public static void handleGroupCreatedEvent(String appId, String groupId, String instanceId) {
+    public static void handleGroupInstanceCreatedEvent(String appId, String groupId, String instanceId) {
         if (log.isDebugEnabled()) {
             log.debug("Handling Group creation for the [group]: " + groupId +
                     " in the [application] " + appId);
@@ -387,7 +387,7 @@ public class ApplicationBuilder {
             //setting the status, persist and publish
             updateGroupMonitor(appId, groupId, status, instanceId);
             ApplicationHolder.persistApplication(application);
-            ApplicationsEventPublisher.sendGroupCreatedEvent(appId, groupId, instanceId);
+            ApplicationsEventPublisher.sendGroupInstanceCreatedEvent(appId, groupId, null);
         } else {
             log.warn("Group state transition is not valid: [group-id] " + groupId + " [current-state] " + group.getStatus(null)
                     + "[requested-state] " + status);
@@ -429,7 +429,7 @@ public class ApplicationBuilder {
             group.addInstance(instanceId, instance);
             //updateGroupMonitor(appId, groupId, status);
             ApplicationHolder.persistApplication(application);
-            //ApplicationsEventPublisher.sendGroupCreatedEvent(appId, groupId);
+            //ApplicationsEventPublisher.sendGroupInstanceCreatedEvent(appId, groupId);
         } else {
             log.warn("Group Instance Context already exists: [group-id] " + groupId +
                     " [Group-Instance-Id] " + instanceId);
@@ -468,7 +468,7 @@ public class ApplicationBuilder {
                 //setting the status, persist and publish
                 updateGroupMonitor(appId, groupId, status, instanceId);
                 ApplicationHolder.persistApplication(application);
-                ApplicationsEventPublisher.sendGroupInActivateEvent(appId, groupId, instanceId);
+                ApplicationsEventPublisher.sendGroupInstanceInActivateEvent(appId, groupId, instanceId);
             } else {
                 log.warn("Group state transition is not valid: [group-id] " + groupId +
                         " [instance-id] " + instanceId + " [current-state] " + context.getStatus()
@@ -512,7 +512,7 @@ public class ApplicationBuilder {
                     //setting the status, persist and publish
                     updateGroupMonitor(appId, groupId, status, instanceId);
                     ApplicationHolder.persistApplication(application);
-                    ApplicationsEventPublisher.sendGroupTerminatingEvent(appId, groupId, instanceId);
+                    ApplicationsEventPublisher.sendGroupInstanceTerminatingEvent(appId, groupId, instanceId);
                 } else {
                     log.warn("Group state transition is not valid: [group-id] " + groupId +
                             " [instance-id] " + instanceId + " [current-state] " + context.getStatus()
@@ -535,7 +535,7 @@ public class ApplicationBuilder {
                 log.error("Invalid state transfer from " + group.getStatus(null) + " to " + groupStatus);
             }
             // force update for now
-            //group.setStatus(groupStatus, null);
+            //group.notifyParentMonitor(groupStatus, null);
 
             // go recursively and update
             if (group.getGroups() != null) {

http://git-wip-us.apache.org/repos/asf/stratos/blob/cf1b3727/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/applications/topic/ApplicationsEventPublisher.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/applications/topic/ApplicationsEventPublisher.java b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/applications/topic/ApplicationsEventPublisher.java
index 1f4f6ca..305b4e7 100644
--- a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/applications/topic/ApplicationsEventPublisher.java
+++ b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/applications/topic/ApplicationsEventPublisher.java
@@ -7,6 +7,8 @@ import org.apache.stratos.messaging.broker.publish.EventPublisherPool;
 import org.apache.stratos.messaging.domain.applications.Application;
 import org.apache.stratos.messaging.domain.applications.Applications;
 import org.apache.stratos.messaging.domain.applications.ClusterDataHolder;
+import org.apache.stratos.messaging.domain.instance.ApplicationInstance;
+import org.apache.stratos.messaging.domain.instance.GroupInstance;
 import org.apache.stratos.messaging.event.Event;
 import org.apache.stratos.messaging.event.applications.*;
 import org.apache.stratos.messaging.util.Util;
@@ -29,70 +31,76 @@ public class ApplicationsEventPublisher {
         publishEvent(new ApplicationCreatedEvent(application));
     }
 
-    public static void sendGroupCreatedEvent(String appId, String groupId, String instanceId) {
+    public static void sendApplicationInstanceCreatedEvent(String appId,
+                                                           ApplicationInstance applicationInstance) {
+
+        publishEvent(new ApplicationInstanceCreatedEvent(appId, applicationInstance));
+    }
+    public static void sendGroupInstanceCreatedEvent(String appId, String groupId,
+                                                     GroupInstance groupInstance) {
         if (log.isInfoEnabled()) {
             log.info("Publishing Group created event for [application]: " + appId +
                     " [group]: " + groupId);
         }
-        GroupResetEvent groupCreatedEvent =
-                new GroupResetEvent(appId, groupId, instanceId);
+        GroupInstanceCreatedEvent groupCreatedEvent =
+                new GroupInstanceCreatedEvent(appId, groupId, groupInstance);
 
         publishEvent(groupCreatedEvent);
     }
 
-    public static void sendGroupActivatedEvent(String appId, String groupId, String instanceId) {
+    public static void sendGroupInstanceActivatedEvent(String appId, String groupId, String instanceId) {
         if (log.isInfoEnabled()) {
             log.info("Publishing Group activated event for [application]: " + appId +
                     " [group]: " + groupId);
         }
-        GroupActivatedEvent groupActivatedEvent =
-                new GroupActivatedEvent(appId, groupId, instanceId);
+        GroupInstanceActivatedEvent groupActivatedEvent =
+                new GroupInstanceActivatedEvent(appId, groupId, instanceId);
 
         publishEvent(groupActivatedEvent);
     }
 
-    public static void sendGroupInActivateEvent(String appId, String groupId, String instanceId) {
+    public static void sendGroupInstanceInActivateEvent(String appId, String groupId, String instanceId) {
         if (log.isInfoEnabled()) {
             log.info("Publishing Group in-activate event for [application]: " + appId +
                     " [group]: " + groupId);
         }
-        GroupInactivatedEvent groupInactivateEvent = new GroupInactivatedEvent(appId, groupId, instanceId);
+        GroupInstanceInactivatedEvent groupInactivateEvent = new GroupInstanceInactivatedEvent(appId, groupId, instanceId);
 
         publishEvent(groupInactivateEvent);
     }
 
-    public static void sendGroupTerminatingEvent(String appId, String groupId, String instanceId) {
+    public static void sendGroupInstanceTerminatingEvent(String appId, String groupId, String instanceId) {
         if (log.isInfoEnabled()) {
             log.info("Publishing Group terminating event for [application]: " + appId +
                     " [group]: " + groupId);
         }
-        GroupTerminatingEvent groupInTerminatingEvent =
-                new GroupTerminatingEvent(appId, groupId, instanceId);
+        GroupInstanceTerminatingEvent groupInTerminatingEvent =
+                new GroupInstanceTerminatingEvent(appId, groupId, instanceId);
         publishEvent(groupInTerminatingEvent);
     }
 
-    public static void sendGroupTerminatedEvent(String appId, String groupId, String instanceId) {
+    public static void sendGroupInstanceTerminatedEvent(String appId, String groupId, String instanceId) {
 
         if (log.isInfoEnabled()) {
             log.info("Publishing Group terminated event for [application]: " + appId +
                     " [group]: " + groupId);
         }
-        GroupTerminatedEvent groupInTerminatedEvent =
-                new GroupTerminatedEvent(appId, groupId, instanceId);
+        GroupInstanceTerminatedEvent groupInTerminatedEvent =
+                new GroupInstanceTerminatedEvent(appId, groupId, instanceId);
         publishEvent(groupInTerminatedEvent);
     }
 
-    public static void sendApplicationActivatedEvent(String appId, String instanceId) {
+    public static void sendApplicationInstanceActivatedEvent(String appId, String instanceId) {
         if (log.isInfoEnabled()) {
             log.info("Publishing Application activated event for [application]: " + appId);
         }
-        ApplicationActivatedEvent applicationActivatedEvent =
-                new ApplicationActivatedEvent(appId, instanceId);
+        ApplicationInstanceActivatedEvent applicationActivatedEvent =
+                new ApplicationInstanceActivatedEvent(appId, instanceId);
 
         publishEvent(applicationActivatedEvent);
     }
 
-    public static void sendApplicationInactivatedEvent(String appId, String instanceId) {
+    public static void sendApplicationInstanceInactivatedEvent(String appId, String instanceId) {
         if (log.isInfoEnabled()) {
             log.info("Publishing Application In-activated event for [application]: " + appId);
         }
@@ -102,7 +110,7 @@ public class ApplicationsEventPublisher {
 
     }
 
-    public static void sendApplicationTerminatingEvent(String appId, String instanceId) {
+    public static void sendApplicationInstanceTerminatingEvent(String appId, String instanceId) {
         if (log.isInfoEnabled()) {
             log.info("Publishing Application terminating event for [application]: " + appId);
         }
@@ -111,7 +119,7 @@ public class ApplicationsEventPublisher {
         publishEvent(applicationTerminatingEvent);
     }
 
-    public static void sendApplicationTerminatedEvent(String appId, Set<ClusterDataHolder> clusterData) {
+    public static void sendApplicationInstanceTerminatedEvent(String appId, Set<ClusterDataHolder> clusterData) {
         if (log.isInfoEnabled()) {
             log.info("Publishing Application terminated event for [application]: " + appId);
         }

http://git-wip-us.apache.org/repos/asf/stratos/blob/cf1b3727/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/event/receiver/topology/AutoscalerTopologyEventReceiver.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/event/receiver/topology/AutoscalerTopologyEventReceiver.java b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/event/receiver/topology/AutoscalerTopologyEventReceiver.java
index abc829c..e1357f5 100644
--- a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/event/receiver/topology/AutoscalerTopologyEventReceiver.java
+++ b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/event/receiver/topology/AutoscalerTopologyEventReceiver.java
@@ -159,12 +159,13 @@ public class AutoscalerTopologyEventReceiver {
             }
         });
 
-        topologyEventReceiver.addEventListener(new ClusterActivatedEventListener() {
+        topologyEventReceiver.addEventListener(new ClusterInstanceActivatedEventListener() {
             @Override
             protected void onEvent(Event event) {
                 log.info("[ClusterActivatedEvent] Received: " + event.getClass());
-                ClusterActivatedEvent clusterActivatedEvent = (ClusterActivatedEvent) event;
+                ClusterInstanceActivatedEvent clusterActivatedEvent = (ClusterInstanceActivatedEvent) event;
                 String clusterId = clusterActivatedEvent.getClusterId();
+                String instanceId = clusterActivatedEvent.getInstanceId();
                 AutoscalerContext asCtx = AutoscalerContext.getInstance();
                 AbstractClusterMonitor monitor;
                 monitor = asCtx.getClusterMonitor(clusterId);
@@ -176,6 +177,7 @@ public class AutoscalerTopologyEventReceiver {
                     return;
                 }
                 //changing the status in the monitor, will notify its parent monitor
+                monitor.notifyParentMonitor(ClusterStatus.Active, instanceId);
 
             }
         });
@@ -199,7 +201,7 @@ public class AutoscalerTopologyEventReceiver {
                 }
                 //changing the status in the monitor, will notify its parent monitor
                 monitor.destroy();
-                monitor.setStatus(ClusterStatus.Created, instanceId);
+                monitor.notifyParentMonitor(ClusterStatus.Created, instanceId);
 
             }
         });
@@ -211,11 +213,11 @@ public class AutoscalerTopologyEventReceiver {
             }
         });
 
-        topologyEventReceiver.addEventListener(new ClusterInActivateEventListener() {
+        topologyEventReceiver.addEventListener(new ClusterInstanceInActivateEventListener() {
             @Override
             protected void onEvent(Event event) {
                 log.info("[ClusterInActivateEvent] Received: " + event.getClass());
-                ClusterInactivateEvent clusterInactivateEvent = (ClusterInactivateEvent) event;
+                ClusterInstanceInactivateEvent clusterInactivateEvent = (ClusterInstanceInactivateEvent) event;
                 String clusterId = clusterInactivateEvent.getClusterId();
                 String instanceId = clusterInactivateEvent.getInstanceId();
                 AutoscalerContext asCtx = AutoscalerContext.getInstance();
@@ -229,15 +231,15 @@ public class AutoscalerTopologyEventReceiver {
                     return;
                 }
                 //changing the status in the monitor, will notify its parent monitor
-                monitor.setStatus(ClusterStatus.Inactive, instanceId);
+                monitor.notifyParentMonitor(ClusterStatus.Inactive, instanceId);
             }
         });
 
-        topologyEventReceiver.addEventListener(new ClusterTerminatingEventListener() {
+        topologyEventReceiver.addEventListener(new ClusterInstanceTerminatingEventListener() {
             @Override
             protected void onEvent(Event event) {
                 log.info("[ClusterTerminatingEvent] Received: " + event.getClass());
-                ClusterTerminatingEvent clusterTerminatingEvent = (ClusterTerminatingEvent) event;
+                ClusterInstanceTerminatingEvent clusterTerminatingEvent = (ClusterInstanceTerminatingEvent) event;
                 String clusterId = clusterTerminatingEvent.getClusterId();
                 String instanceId = clusterTerminatingEvent.getInstanceId();
                 AutoscalerContext asCtx = AutoscalerContext.getInstance();
@@ -257,10 +259,10 @@ public class AutoscalerTopologyEventReceiver {
                 ClusterInstance clusterInstance = (ClusterInstance) monitor.getInstance(instanceId);
                 if (clusterInstance.getCurrentState() == ClusterStatus.Active) {
                     // terminated gracefully
-                    monitor.setStatus(ClusterStatus.Terminating, instanceId);
+                    monitor.notifyParentMonitor(ClusterStatus.Terminating, instanceId);
                     InstanceNotificationPublisher.sendInstanceCleanupEventForCluster(clusterId, instanceId);
                 } else {
-                    monitor.setStatus(ClusterStatus.Terminating, instanceId);
+                    monitor.notifyParentMonitor(ClusterStatus.Terminating, instanceId);
                     monitor.terminateAllMembers(instanceId, clusterInstance.getNetworkPartitionId());
                 }
                 ServiceReferenceHolder.getInstance().getClusterStatusProcessorChain().
@@ -268,11 +270,11 @@ public class AutoscalerTopologyEventReceiver {
             }
         });
 
-        topologyEventReceiver.addEventListener(new ClusterTerminatedEventListener() {
+        topologyEventReceiver.addEventListener(new ClusterInstanceTerminatedEventListener() {
             @Override
             protected void onEvent(Event event) {
                 log.info("[ClusterTerminatedEvent] Received: " + event.getClass());
-                ClusterTerminatedEvent clusterTerminatedEvent = (ClusterTerminatedEvent) event;
+                ClusterInstanceTerminatedEvent clusterTerminatedEvent = (ClusterInstanceTerminatedEvent) event;
                 String clusterId = clusterTerminatedEvent.getClusterId();
                 String instanceId = clusterTerminatedEvent.getInstanceId();
                 AutoscalerContext asCtx = AutoscalerContext.getInstance();
@@ -294,7 +296,7 @@ public class AutoscalerTopologyEventReceiver {
                     return;
                 }
                 //changing the status in the monitor, will notify its parent monitor
-                monitor.setStatus(ClusterStatus.Terminated, instanceId);
+                monitor.notifyParentMonitor(ClusterStatus.Terminated, instanceId);
                 monitor.removeInstance(instanceId);
                 if (!monitor.hasInstance() && appMonitor.isTerminating()) {
                     //Destroying and Removing the Cluster monitor

http://git-wip-us.apache.org/repos/asf/stratos/blob/cf1b3727/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/monitor/cluster/AbstractClusterMonitor.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/monitor/cluster/AbstractClusterMonitor.java b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/monitor/cluster/AbstractClusterMonitor.java
index 4c7498b..19905b1 100644
--- a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/monitor/cluster/AbstractClusterMonitor.java
+++ b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/monitor/cluster/AbstractClusterMonitor.java
@@ -34,6 +34,7 @@ import org.apache.stratos.messaging.domain.applications.Application;
 import org.apache.stratos.messaging.domain.applications.ApplicationStatus;
 import org.apache.stratos.messaging.domain.applications.Group;
 import org.apache.stratos.messaging.domain.applications.GroupStatus;
+import org.apache.stratos.messaging.domain.instance.ClusterInstance;
 import org.apache.stratos.messaging.domain.topology.ClusterStatus;
 import org.apache.stratos.messaging.event.health.stat.*;
 import org.apache.stratos.messaging.event.topology.*;
@@ -206,28 +207,23 @@ public abstract class AbstractClusterMonitor extends Monitor implements Runnable
         return status;
     }
 
-    public void setStatus(ClusterStatus status, String instanceId) {
-
-//        this.clusterContext.getClusterInstance(instanceId).setStatus(status);
+    public void notifyParentMonitor(ClusterStatus status, String instanceId) {
         /**
          * notifying the parent monitor about the state change
          * If the cluster in_active and if it is a in_dependent cluster,
          * then won't send the notification to parent.
          */
-        if (status == ClusterStatus.Inactive && !this.hasStartupDependents) {
-            log.info("[Cluster] " + clusterId + "is not notifying the parent, " +
-                    "since it is identified as the independent unit");
-
-            /*} else if (status == ClusterStatus.Terminating) {
-                // notify parent
-                log.info("[Cluster] " + clusterId + " is not notifying the parent, " +
-                        "since it is in Terminating State");
-*/
+        ClusterInstance instance = (ClusterInstance) this.instanceIdToInstanceMap.get(instanceId);
+        if(instance == null) {
+            log.warn("The required cluster [instance] " + instanceId + " not found in the ClusterMonitor");
         } else {
-            MonitorStatusEventBuilder.handleClusterStatusEvent(this.parent, status, this.clusterId, instanceId);
+            if (instance.getStatus() == ClusterStatus.Inactive && !this.hasStartupDependents) {
+                log.info("[Cluster] " + clusterId + "is not notifying the parent, " +
+                        "since it is identified as the independent unit");
+            } else {
+                MonitorStatusEventBuilder.handleClusterStatusEvent(this.parent, status, this.clusterId, instanceId);
+            }
         }
-
-
     }
 
     public int getMonitorIntervalMilliseconds() {

http://git-wip-us.apache.org/repos/asf/stratos/blob/cf1b3727/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/monitor/cluster/ClusterMonitorFactory.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/monitor/cluster/ClusterMonitorFactory.java b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/monitor/cluster/ClusterMonitorFactory.java
index e33e04c..f906f64 100644
--- a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/monitor/cluster/ClusterMonitorFactory.java
+++ b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/monitor/cluster/ClusterMonitorFactory.java
@@ -97,7 +97,7 @@ public class ClusterMonitorFactory {
 //
 //        VMLbClusterMonitor clusterMonitor =
 //                new VMLbClusterMonitor(cluster.getServiceName(), cluster.getClusterId());
-//        clusterMonitor.setStatus(ClusterStatus.Created);
+//        clusterMonitor.notifyParentMonitor(ClusterStatus.Created);
 //
 //        log.info("VMLbClusterMonitor created: " + clusterMonitor.toString());
 //        return clusterMonitor;

http://git-wip-us.apache.org/repos/asf/stratos/blob/cf1b3727/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/status/processor/cluster/ClusterStatusActiveProcessor.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/status/processor/cluster/ClusterStatusActiveProcessor.java b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/status/processor/cluster/ClusterStatusActiveProcessor.java
index b80cbdf..c007a46 100644
--- a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/status/processor/cluster/ClusterStatusActiveProcessor.java
+++ b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/status/processor/cluster/ClusterStatusActiveProcessor.java
@@ -69,7 +69,7 @@ public class ClusterStatusActiveProcessor extends ClusterStatusProcessor {
             //minimum check per partition
             ClusterInstanceContext instanceContext = clusterLevelNetworkPartitionContext.getClusterInstanceContext(instanceId);
             if (instanceContext != null) {
-                if (instanceContext.getActiveMembers() >= instanceContext.getMaxInstanceCount()) {
+                if (instanceContext.getActiveMembers() >= instanceContext.getMinInstanceCount()) {
                     clusterActive = true;
                 } else {
                     clusterActive = false;

http://git-wip-us.apache.org/repos/asf/stratos/blob/cf1b3727/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/status/processor/group/GroupStatusActiveProcessor.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/status/processor/group/GroupStatusActiveProcessor.java b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/status/processor/group/GroupStatusActiveProcessor.java
index 9e60357..c59736d 100644
--- a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/status/processor/group/GroupStatusActiveProcessor.java
+++ b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/status/processor/group/GroupStatusActiveProcessor.java
@@ -91,12 +91,12 @@ public class GroupStatusActiveProcessor extends GroupStatusProcessor {
                     if (component instanceof Application) {
                         //send application activated event
                         log.info("sending app activate: " + appId);
-                        ApplicationBuilder.handleApplicationActivatedEvent(appId, instanceId);
+                        ApplicationBuilder.handleApplicationInstanceActivatedEvent(appId, instanceId);
                         return true;
                     } else if (component instanceof Group) {
                         //send activation to the parent
                         log.info("sending group activate: " + component.getUniqueIdentifier());
-                        ApplicationBuilder.handleGroupActivatedEvent(appId, component.getUniqueIdentifier(), instanceId);
+                        ApplicationBuilder.handleGroupInstanceActivatedEvent(appId, component.getUniqueIdentifier(), instanceId);
                         return true;
                     }
 

http://git-wip-us.apache.org/repos/asf/stratos/blob/cf1b3727/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/status/processor/group/GroupStatusTerminatedProcessor.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/status/processor/group/GroupStatusTerminatedProcessor.java b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/status/processor/group/GroupStatusTerminatedProcessor.java
index e2a6368..9c01b9a 100644
--- a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/status/processor/group/GroupStatusTerminatedProcessor.java
+++ b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/status/processor/group/GroupStatusTerminatedProcessor.java
@@ -93,13 +93,13 @@ public class GroupStatusTerminatedProcessor extends GroupStatusProcessor {
                     //send the terminated event
                     if (component instanceof Application) {
                         log.info("sending app terminated: " + appId);
-                        ApplicationBuilder.handleApplicationTerminatedEvent(appId, instanceId);
+                        ApplicationBuilder.handleApplicationInstanceTerminatedEvent(appId, instanceId);
                         return true;
                     } else if (component instanceof Group) {
                         //send activation to the parent
                         if (((Group) component).getStatus(null) != GroupStatus.Terminated) {
                             log.info("sending group terminated : " + component.getUniqueIdentifier());
-                            ApplicationBuilder.handleGroupTerminatedEvent(appId,
+                            ApplicationBuilder.handleGroupInstanceTerminatedEvent(appId,
                                     component.getUniqueIdentifier(), instanceId);
                             return true;
                         }

http://git-wip-us.apache.org/repos/asf/stratos/blob/cf1b3727/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/status/processor/group/GroupStatusTerminatingProcessor.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/status/processor/group/GroupStatusTerminatingProcessor.java b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/status/processor/group/GroupStatusTerminatingProcessor.java
index 37b2a2d..86a8cc2 100644
--- a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/status/processor/group/GroupStatusTerminatingProcessor.java
+++ b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/status/processor/group/GroupStatusTerminatingProcessor.java
@@ -94,7 +94,7 @@ public class GroupStatusTerminatingProcessor extends GroupStatusProcessor {
                     //send the terminated event
                     if (component instanceof Application) {
                         log.info("sending app terminated: " + appId);
-                        ApplicationBuilder.handleApplicationTerminatedEvent(appId, instanceId);
+                        ApplicationBuilder.handleApplicationInstanceTerminatedEvent(appId, instanceId);
                         return true;
                     } else if (component instanceof Group) {
                         //send activation to the parent

http://git-wip-us.apache.org/repos/asf/stratos/blob/cf1b3727/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/util/AutoscalerUtil.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/util/AutoscalerUtil.java b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/util/AutoscalerUtil.java
index 2ed1074..7e2ac38 100644
--- a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/util/AutoscalerUtil.java
+++ b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/util/AutoscalerUtil.java
@@ -173,7 +173,7 @@ public class AutoscalerUtil {
                                         new LbClusterMonitor(clusterId,
                                                            cluster.getServiceName(),
                                                            deploymentPolicy, policy);
-        clusterMonitor.setStatus(Status.Created);
+        clusterMonitor.notifyParentMonitor(Status.Created);
         // partition group = network partition context
         for (NetworkPartition partitionGroup : deploymentPolicy.gNetworkPartitionups()) {
 
@@ -386,7 +386,7 @@ public class AutoscalerUtil {
                 try {
                     long start = System.currentTimeMillis();
                     log.info("application monitor is going to be started for [application] " +
-                                appId);
+                            appId);
                     try {
                         applicationMonitor = MonitorFactory.getApplicationMonitor(appId);
                     } catch (PolicyValidationException e) {

http://git-wip-us.apache.org/repos/asf/stratos/blob/cf1b3727/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/messaging/receiver/application/ApplicationTopicReceiver.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/messaging/receiver/application/ApplicationTopicReceiver.java b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/messaging/receiver/application/ApplicationTopicReceiver.java
index e8d3674..445df42 100644
--- a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/messaging/receiver/application/ApplicationTopicReceiver.java
+++ b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/messaging/receiver/application/ApplicationTopicReceiver.java
@@ -23,7 +23,7 @@ import org.apache.commons.logging.LogFactory;
 import org.apache.stratos.cloud.controller.messaging.topology.TopologyBuilder;
 import org.apache.stratos.messaging.event.Event;
 import org.apache.stratos.messaging.event.applications.ApplicationInstanceTerminatedEvent;
-import org.apache.stratos.messaging.listener.applications.ApplicationTerminatedEventListener;
+import org.apache.stratos.messaging.listener.applications.ApplicationInstanceTerminatedEventListener;
 import org.apache.stratos.messaging.message.receiver.applications.ApplicationsEventReceiver;
 
 import java.util.concurrent.ExecutorService;
@@ -67,7 +67,7 @@ public class ApplicationTopicReceiver {
 	}
 
     private void addEventListeners() {
-        applicationsEventReceiver.addEventListener(new ApplicationTerminatedEventListener() {
+        applicationsEventReceiver.addEventListener(new ApplicationInstanceTerminatedEventListener() {
             @Override
             protected void onEvent(Event event) {
                 //Remove the application related data

http://git-wip-us.apache.org/repos/asf/stratos/blob/cf1b3727/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/messaging/topology/TopologyBuilder.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/messaging/topology/TopologyBuilder.java b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/messaging/topology/TopologyBuilder.java
index f49cda2..743ab73 100644
--- a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/messaging/topology/TopologyBuilder.java
+++ b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/messaging/topology/TopologyBuilder.java
@@ -781,8 +781,8 @@ public class TopologyBuilder {
             return;
         }
 
-        org.apache.stratos.messaging.event.topology.ClusterActivatedEvent clusterActivatedEvent1 =
-                new org.apache.stratos.messaging.event.topology.ClusterActivatedEvent(
+        ClusterInstanceActivatedEvent clusterActivatedEvent1 =
+                new ClusterInstanceActivatedEvent(
                         clusterActivatedEvent.getAppId(),
                         clusterActivatedEvent.getServiceName(),
                         clusterActivatedEvent.getClusterId(),
@@ -833,8 +833,8 @@ public class TopologyBuilder {
             return;
         }
 
-        ClusterInactivateEvent clusterInActivatedEvent1 =
-                new ClusterInactivateEvent(
+        ClusterInstanceInactivateEvent clusterInActivatedEvent1 =
+                new ClusterInstanceInactivateEvent(
                         clusterInActivateEvent.getAppId(),
                         clusterInActivateEvent.getServiceName(),
                         clusterInActivateEvent.getClusterId(),
@@ -902,7 +902,7 @@ public class TopologyBuilder {
                 log.info("Cluster Terminated adding status started for" + cluster.getClusterId());
                 TopologyManager.updateTopology(topology);
                 //publishing data
-                ClusterTerminatedEvent clusterTerminatedEvent = new ClusterTerminatedEvent(event.getAppId(),
+                ClusterInstanceTerminatedEvent clusterTerminatedEvent = new ClusterInstanceTerminatedEvent(event.getAppId(),
                         event.getServiceName(), event.getClusterId(), event.getInstanceId());
 
                 TopologyEventPublisher.sendClusterTerminatedEvent(clusterTerminatedEvent);
@@ -945,7 +945,7 @@ public class TopologyBuilder {
                 log.info("Cluster Terminating adding status started for" + cluster.getClusterId());
                 TopologyManager.updateTopology(topology);
                 //publishing data
-                ClusterTerminatingEvent clusterTerminaingEvent = new ClusterTerminatingEvent(event.getAppId(),
+                ClusterInstanceTerminatingEvent clusterTerminaingEvent = new ClusterInstanceTerminatingEvent(event.getAppId(),
                         event.getServiceName(), event.getClusterId(), event.getInstanceId());
 
                 TopologyEventPublisher.sendClusterTerminatingEvent(clusterTerminaingEvent);

http://git-wip-us.apache.org/repos/asf/stratos/blob/cf1b3727/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/messaging/topology/TopologyEventPublisher.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/messaging/topology/TopologyEventPublisher.java b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/messaging/topology/TopologyEventPublisher.java
index eea941c..2965a6f 100644
--- a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/messaging/topology/TopologyEventPublisher.java
+++ b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/messaging/topology/TopologyEventPublisher.java
@@ -228,7 +228,7 @@ public class TopologyEventPublisher {
         publishEvent(memberMaintenanceModeEvent);
     }
 
-    public static void sendClusterActivatedEvent(ClusterActivatedEvent clusterActivatedEvent) {
+    public static void sendClusterActivatedEvent(ClusterInstanceActivatedEvent clusterActivatedEvent) {
         if (log.isInfoEnabled()) {
             log.info(String.format("Publishing cluster activated event: [service] %s [cluster] %s " +
                             " [instance-id] %s [appId] %s",
@@ -240,7 +240,7 @@ public class TopologyEventPublisher {
         publishEvent(clusterActivatedEvent);
     }
 
-    public static void sendClusterInactivateEvent(ClusterInactivateEvent clusterInactiveEvent) {
+    public static void sendClusterInactivateEvent(ClusterInstanceInactivateEvent clusterInactiveEvent) {
         if (log.isInfoEnabled()) {
             log.info(String.format("Publishing cluster in-active event: [service] %s [cluster] %s " +
                             "[instance-id] %s [appId] %s",
@@ -289,7 +289,7 @@ public class TopologyEventPublisher {
         publishEvent(completeTopologyEvent);
     }
 
-    public static void sendClusterTerminatingEvent(ClusterTerminatingEvent clusterTerminatingEvent) {
+    public static void sendClusterTerminatingEvent(ClusterInstanceTerminatingEvent clusterTerminatingEvent) {
 
         if (log.isInfoEnabled()) {
             log.info(String.format("Publishing Cluster terminating event: [appId] %s [cluster id] %s" +
@@ -301,7 +301,7 @@ public class TopologyEventPublisher {
         publishEvent(clusterTerminatingEvent);
     }
 
-    public static void sendClusterTerminatedEvent(ClusterTerminatedEvent clusterTerminatedEvent) {
+    public static void sendClusterTerminatedEvent(ClusterInstanceTerminatedEvent clusterTerminatedEvent) {
 
         if (log.isInfoEnabled()) {
             log.info(String.format("Publishing Cluster terminated event: [appId] %s [cluster id] %s" +

http://git-wip-us.apache.org/repos/asf/stratos/blob/cf1b3727/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/applications/ApplicationActivatedEvent.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/applications/ApplicationActivatedEvent.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/applications/ApplicationActivatedEvent.java
deleted file mode 100644
index 68a63a8..0000000
--- a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/applications/ApplicationActivatedEvent.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * 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.applications;
-
-import org.apache.stratos.messaging.event.Event;
-
-import java.io.Serializable;
-
-/**
- * This event will be fired upon the application activated is detected.
- */
-public class ApplicationActivatedEvent extends Event implements Serializable {
-    private static final long serialVersionUID = 2625412714611885089L;
-
-    private String appId;
-    private String instanceId;
-
-    public ApplicationActivatedEvent(String appId, String instanceId) {
-        this.appId = appId;
-        this.instanceId = instanceId;
-    }
-
-    public String getAppId() {
-        return appId;
-    }
-
-    public String getInstanceId() {
-        return instanceId;
-    }
-}

http://git-wip-us.apache.org/repos/asf/stratos/blob/cf1b3727/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/applications/ApplicationInstanceActivatedEvent.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/applications/ApplicationInstanceActivatedEvent.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/applications/ApplicationInstanceActivatedEvent.java
new file mode 100644
index 0000000..855f07e
--- /dev/null
+++ b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/applications/ApplicationInstanceActivatedEvent.java
@@ -0,0 +1,46 @@
+/*
+ * 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.applications;
+
+import org.apache.stratos.messaging.event.Event;
+
+import java.io.Serializable;
+
+/**
+ * This event will be fired upon the application activated is detected.
+ */
+public class ApplicationInstanceActivatedEvent extends Event implements Serializable {
+    private static final long serialVersionUID = 2625412714611885089L;
+
+    private String appId;
+    private String instanceId;
+
+    public ApplicationInstanceActivatedEvent(String appId, String instanceId) {
+        this.appId = appId;
+        this.instanceId = instanceId;
+    }
+
+    public String getAppId() {
+        return appId;
+    }
+
+    public String getInstanceId() {
+        return instanceId;
+    }
+}

http://git-wip-us.apache.org/repos/asf/stratos/blob/cf1b3727/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/applications/GroupActivatedEvent.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/applications/GroupActivatedEvent.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/applications/GroupActivatedEvent.java
deleted file mode 100644
index c106949..0000000
--- a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/applications/GroupActivatedEvent.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * 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.applications;
-
-import org.apache.stratos.messaging.event.Event;
-
-import java.io.Serializable;
-
-/**
- * This event is fired by cartridge agent when it has started the server and
- * applications are ready to serve the incoming requests.
- */
-public class GroupActivatedEvent extends Event implements Serializable {
-    private static final long serialVersionUID = 2625412714611885089L;
-
-    private String groupId;
-    private String appId;
-    private String instanceId;
-
-    public GroupActivatedEvent(String appId, String groupId, String instanceId) {
-        this.appId = appId;
-        this.groupId = groupId;
-        this.instanceId = instanceId;
-    }
-
-    public String getGroupId() {
-        return this.groupId;
-    }
-
-    public String getAppId() {
-        return appId;
-    }
-
-    public String getInstanceId() {
-        return instanceId;
-    }
-}

http://git-wip-us.apache.org/repos/asf/stratos/blob/cf1b3727/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/applications/GroupInactivatedEvent.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/applications/GroupInactivatedEvent.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/applications/GroupInactivatedEvent.java
deleted file mode 100644
index 9160e54..0000000
--- a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/applications/GroupInactivatedEvent.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * 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.applications;
-
-import org.apache.stratos.messaging.event.Event;
-
-import java.io.Serializable;
-
-public class GroupInactivatedEvent extends Event implements Serializable {
-
-    private static final long serialVersionUID = 2625412714611885089L;
-
-    private String groupId;
-    private String appId;
-    private String instanceId;
-
-    public GroupInactivatedEvent(String appId, String groupId, String instanceId) {
-        this.appId = appId;
-        this.groupId = groupId;
-        this.instanceId = instanceId;
-    }
-
-    public String getGroupId() {
-        return this.groupId;
-    }
-
-    public String getAppId() {
-        return appId;
-    }
-
-    public String getInstanceId() {
-        return instanceId;
-    }
-}

http://git-wip-us.apache.org/repos/asf/stratos/blob/cf1b3727/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/applications/GroupInstanceActivatedEvent.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/applications/GroupInstanceActivatedEvent.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/applications/GroupInstanceActivatedEvent.java
new file mode 100644
index 0000000..02b343d
--- /dev/null
+++ b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/applications/GroupInstanceActivatedEvent.java
@@ -0,0 +1,54 @@
+/*
+ * 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.applications;
+
+import org.apache.stratos.messaging.event.Event;
+
+import java.io.Serializable;
+
+/**
+ * This event is fired by cartridge agent when it has started the server and
+ * applications are ready to serve the incoming requests.
+ */
+public class GroupInstanceActivatedEvent extends Event implements Serializable {
+    private static final long serialVersionUID = 2625412714611885089L;
+
+    private String groupId;
+    private String appId;
+    private String instanceId;
+
+    public GroupInstanceActivatedEvent(String appId, String groupId, String instanceId) {
+        this.appId = appId;
+        this.groupId = groupId;
+        this.instanceId = instanceId;
+    }
+
+    public String getGroupId() {
+        return this.groupId;
+    }
+
+    public String getAppId() {
+        return appId;
+    }
+
+    public String getInstanceId() {
+        return instanceId;
+    }
+}

http://git-wip-us.apache.org/repos/asf/stratos/blob/cf1b3727/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/applications/GroupInstanceCreatedEvent.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/applications/GroupInstanceCreatedEvent.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/applications/GroupInstanceCreatedEvent.java
new file mode 100644
index 0000000..a4b3c5a
--- /dev/null
+++ b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/applications/GroupInstanceCreatedEvent.java
@@ -0,0 +1,55 @@
+/*
+ * 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.applications;
+
+import org.apache.stratos.messaging.domain.instance.GroupInstance;
+import org.apache.stratos.messaging.event.Event;
+
+import java.io.Serializable;
+
+/**
+ * This event is fired by cartridge agent when it has started the server and
+ * applications are ready to serve the incoming requests.
+ */
+public class GroupInstanceCreatedEvent extends Event implements Serializable {
+    private static final long serialVersionUID = 2625412714611885089L;
+
+    private String groupId;
+    private String appId;
+    private GroupInstance groupInstance;
+
+    public GroupInstanceCreatedEvent(String appId, String groupId, GroupInstance groupInstance) {
+        this.appId = appId;
+        this.groupId = groupId;
+        this.groupInstance = groupInstance;
+    }
+
+    public String getGroupId() {
+        return this.groupId;
+    }
+
+    public String getAppId() {
+        return appId;
+    }
+
+    public GroupInstance getGroupInstance() {
+        return groupInstance;
+    }
+}

http://git-wip-us.apache.org/repos/asf/stratos/blob/cf1b3727/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/applications/GroupInstanceInactivatedEvent.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/applications/GroupInstanceInactivatedEvent.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/applications/GroupInstanceInactivatedEvent.java
new file mode 100644
index 0000000..d57b3c5
--- /dev/null
+++ b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/applications/GroupInstanceInactivatedEvent.java
@@ -0,0 +1,51 @@
+/*
+ * 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.applications;
+
+import org.apache.stratos.messaging.event.Event;
+
+import java.io.Serializable;
+
+public class GroupInstanceInactivatedEvent extends Event implements Serializable {
+
+    private static final long serialVersionUID = 2625412714611885089L;
+
+    private String groupId;
+    private String appId;
+    private String instanceId;
+
+    public GroupInstanceInactivatedEvent(String appId, String groupId, String instanceId) {
+        this.appId = appId;
+        this.groupId = groupId;
+        this.instanceId = instanceId;
+    }
+
+    public String getGroupId() {
+        return this.groupId;
+    }
+
+    public String getAppId() {
+        return appId;
+    }
+
+    public String getInstanceId() {
+        return instanceId;
+    }
+}

http://git-wip-us.apache.org/repos/asf/stratos/blob/cf1b3727/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/applications/GroupInstanceTerminatedEvent.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/applications/GroupInstanceTerminatedEvent.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/applications/GroupInstanceTerminatedEvent.java
new file mode 100644
index 0000000..3c8ffb2
--- /dev/null
+++ b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/applications/GroupInstanceTerminatedEvent.java
@@ -0,0 +1,54 @@
+/*
+ * 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.applications;
+
+import org.apache.stratos.messaging.event.Event;
+
+import java.io.Serializable;
+
+/**
+ * This event is fired by cartridge agent when it has started the server and
+ * applications are ready to serve the incoming requests.
+ */
+public class GroupInstanceTerminatedEvent extends Event implements Serializable {
+    private static final long serialVersionUID = 2625412714611885089L;
+
+    private String groupId;
+    private String appId;
+    private String instanceId;
+
+    public GroupInstanceTerminatedEvent(String appId, String groupId, String instanceId) {
+        this.appId = appId;
+        this.groupId = groupId;
+        this.instanceId = instanceId;
+    }
+
+    public String getGroupId() {
+        return this.groupId;
+    }
+
+    public String getAppId() {
+        return appId;
+    }
+
+    public String getInstanceId() {
+        return instanceId;
+    }
+}

http://git-wip-us.apache.org/repos/asf/stratos/blob/cf1b3727/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/applications/GroupInstanceTerminatingEvent.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/applications/GroupInstanceTerminatingEvent.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/applications/GroupInstanceTerminatingEvent.java
new file mode 100644
index 0000000..65b069b
--- /dev/null
+++ b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/applications/GroupInstanceTerminatingEvent.java
@@ -0,0 +1,54 @@
+/*
+ * 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.applications;
+
+import org.apache.stratos.messaging.event.Event;
+
+import java.io.Serializable;
+
+/**
+ * This event is fired by cartridge agent when it has started the server and
+ * applications are ready to serve the incoming requests.
+ */
+public class GroupInstanceTerminatingEvent extends Event implements Serializable {
+    private static final long serialVersionUID = 2625412714611885089L;
+
+    private String groupId;
+    private String appId;
+    private String instanceId;
+
+    public GroupInstanceTerminatingEvent(String appId, String groupId, String instanceId) {
+        this.appId = appId;
+        this.groupId = groupId;
+        this.instanceId = instanceId;
+    }
+
+    public String getGroupId() {
+        return this.groupId;
+    }
+
+    public String getAppId() {
+        return appId;
+    }
+
+    public String getInstanceId() {
+        return instanceId;
+    }
+}

http://git-wip-us.apache.org/repos/asf/stratos/blob/cf1b3727/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/applications/GroupResetEvent.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/applications/GroupResetEvent.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/applications/GroupResetEvent.java
deleted file mode 100644
index 206b526..0000000
--- a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/applications/GroupResetEvent.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * 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.applications;
-
-import org.apache.stratos.messaging.event.Event;
-
-import java.io.Serializable;
-
-/**
- * This event is fired by cartridge agent when it has started the server and
- * applications are ready to serve the incoming requests.
- */
-public class GroupResetEvent extends Event implements Serializable {
-    private static final long serialVersionUID = 2625412714611885089L;
-
-    private String groupId;
-    private String appId;
-    private String instanceId;
-
-    public GroupResetEvent(String appId, String groupId, String instanceId) {
-        this.appId = appId;
-        this.groupId = groupId;
-        this.instanceId = instanceId;
-    }
-
-    public String getGroupId() {
-        return this.groupId;
-    }
-
-    public String getAppId() {
-        return appId;
-    }
-
-    public String getInstanceId() {
-        return instanceId;
-    }
-}

http://git-wip-us.apache.org/repos/asf/stratos/blob/cf1b3727/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/applications/GroupTerminatedEvent.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/applications/GroupTerminatedEvent.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/applications/GroupTerminatedEvent.java
deleted file mode 100644
index a7bf347..0000000
--- a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/applications/GroupTerminatedEvent.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * 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.applications;
-
-import org.apache.stratos.messaging.event.Event;
-
-import java.io.Serializable;
-
-/**
- * This event is fired by cartridge agent when it has started the server and
- * applications are ready to serve the incoming requests.
- */
-public class GroupTerminatedEvent extends Event implements Serializable {
-    private static final long serialVersionUID = 2625412714611885089L;
-
-    private String groupId;
-    private String appId;
-    private String instanceId;
-
-    public GroupTerminatedEvent(String appId, String groupId, String instanceId) {
-        this.appId = appId;
-        this.groupId = groupId;
-        this.instanceId = instanceId;
-    }
-
-    public String getGroupId() {
-        return this.groupId;
-    }
-
-    public String getAppId() {
-        return appId;
-    }
-
-    public String getInstanceId() {
-        return instanceId;
-    }
-}

http://git-wip-us.apache.org/repos/asf/stratos/blob/cf1b3727/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/applications/GroupTerminatingEvent.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/applications/GroupTerminatingEvent.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/applications/GroupTerminatingEvent.java
deleted file mode 100644
index 6f79b15..0000000
--- a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/applications/GroupTerminatingEvent.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * 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.applications;
-
-import org.apache.stratos.messaging.event.Event;
-
-import java.io.Serializable;
-
-/**
- * This event is fired by cartridge agent when it has started the server and
- * applications are ready to serve the incoming requests.
- */
-public class GroupTerminatingEvent extends Event implements Serializable {
-    private static final long serialVersionUID = 2625412714611885089L;
-
-    private String groupId;
-    private String appId;
-    private String instanceId;
-
-    public GroupTerminatingEvent(String appId, String groupId, String instanceId) {
-        this.appId = appId;
-        this.groupId = groupId;
-        this.instanceId = instanceId;
-    }
-
-    public String getGroupId() {
-        return this.groupId;
-    }
-
-    public String getAppId() {
-        return appId;
-    }
-
-    public String getInstanceId() {
-        return instanceId;
-    }
-}

http://git-wip-us.apache.org/repos/asf/stratos/blob/cf1b3727/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/topology/ClusterActivatedEvent.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/topology/ClusterActivatedEvent.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/topology/ClusterActivatedEvent.java
deleted file mode 100644
index c3f6adf..0000000
--- a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/topology/ClusterActivatedEvent.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * 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.topology;
-
-import org.apache.stratos.messaging.domain.topology.ClusterStatus;
-import org.apache.stratos.messaging.event.Event;
-
-/**
- * Cluster activated event will be sent by Autoscaler
- */
-public class ClusterActivatedEvent extends Event {
-
-    private final String serviceName;
-    private final String clusterId;
-    private String appId;
-    private String instanceId;
-
-    public ClusterActivatedEvent(String appId, String serviceName, String clusterId, String instanceId) {
-        this.serviceName = serviceName;
-        this.clusterId = clusterId;
-        this.appId = appId;
-        this.instanceId = instanceId;
-    }
-
-    public String getServiceName() {
-        return serviceName;
-    }
-
-    @Override
-    public String toString() {
-        return "ClusterActivatedEvent [serviceName=" + serviceName + ", clusterStatus=" +
-                "]";
-    }
-
-    public String getClusterId() {
-        return clusterId;
-    }
-
-    public String getAppId() {
-        return appId;
-    }
-
-    public String getInstanceId() {
-        return instanceId;
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/stratos/blob/cf1b3727/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/topology/ClusterInactivateEvent.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/topology/ClusterInactivateEvent.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/topology/ClusterInactivateEvent.java
deleted file mode 100644
index 4ace80e..0000000
--- a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/topology/ClusterInactivateEvent.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * 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.topology;
-
-import org.apache.stratos.messaging.event.Event;
-
-/**
- * Cluster activated event will be sent by Autoscaler
- */
-public class ClusterInactivateEvent extends Event {
-
-    private final String serviceName;
-    private final String clusterId;
-    private String appId;
-    private String instanceId;
-
-
-    public ClusterInactivateEvent(String appId, String serviceName, String clusterId, String instanceId) {
-        this.serviceName = serviceName;
-        this.clusterId = clusterId;
-        this.appId = appId;
-        this.instanceId = instanceId;
-
-    }
-
-    public String getServiceName() {
-        return serviceName;
-    }
-
-    @Override
-    public String toString() {
-        return "ClusterActivatedEvent [serviceName=" + serviceName + ", clusterStatus=" +
-                "]";
-    }
-
-    public String getClusterId() {
-        return clusterId;
-    }
-
-    public String getAppId() {
-        return appId;
-    }
-
-    public String getInstanceId() {
-        return instanceId;
-    }
-}