Repository: stratos
Updated Branches:
  refs/heads/master 531517a1d -> 5f0ce17cd


updating monitors to function in the restart of stratos


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

Branch: refs/heads/master
Commit: 5f0ce17cd133cffced7c3d4ec598ae9a532c8832
Parents: 531517a
Author: reka <[email protected]>
Authored: Sat Nov 29 15:41:31 2014 +0530
Committer: reka <[email protected]>
Committed: Sat Nov 29 15:41:31 2014 +0530

----------------------------------------------------------------------
 .../autoscaler/monitor/MonitorFactory.java      | 126 +++++++++++++------
 .../monitor/component/ApplicationMonitor.java   |   7 +-
 .../monitor/component/GroupMonitor.java         |   5 +-
 .../group/GroupStatusActiveProcessor.java       |  10 +-
 .../group/GroupStatusInActiveProcessor.java     |  10 +-
 .../processor/group/GroupStatusProcessor.java   |   4 +-
 .../group/GroupStatusProcessorChain.java        |   4 +-
 .../group/GroupStatusTerminatedProcessor.java   |  10 +-
 .../group/GroupStatusTerminatingProcessor.java  |  10 +-
 9 files changed, 122 insertions(+), 64 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/5f0ce17c/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/monitor/MonitorFactory.java
----------------------------------------------------------------------
diff --git 
a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/monitor/MonitorFactory.java
 
b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/monitor/MonitorFactory.java
index 6fbcaab..7015236 100644
--- 
a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/monitor/MonitorFactory.java
+++ 
b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/monitor/MonitorFactory.java
@@ -18,23 +18,26 @@
  */
 package org.apache.stratos.autoscaler.monitor;
 
-import org.apache.stratos.autoscaler.context.AutoscalerContext;
 import org.apache.stratos.autoscaler.applications.ApplicationHolder;
 import 
org.apache.stratos.autoscaler.applications.dependency.context.ApplicationChildContext;
 import 
org.apache.stratos.autoscaler.applications.dependency.context.ClusterChildContext;
 import 
org.apache.stratos.autoscaler.applications.dependency.context.GroupChildContext;
 import org.apache.stratos.autoscaler.client.CloudControllerClient;
+import org.apache.stratos.autoscaler.context.AutoscalerContext;
 import 
org.apache.stratos.autoscaler.exception.application.DependencyBuilderException;
+import 
org.apache.stratos.autoscaler.exception.application.TopologyInConsistentException;
 import 
org.apache.stratos.autoscaler.exception.partition.PartitionValidationException;
 import 
org.apache.stratos.autoscaler.exception.policy.PolicyValidationException;
-import 
org.apache.stratos.autoscaler.exception.application.TopologyInConsistentException;
 import org.apache.stratos.autoscaler.monitor.cluster.AbstractClusterMonitor;
 import org.apache.stratos.autoscaler.monitor.cluster.ClusterMonitorFactory;
 import org.apache.stratos.autoscaler.monitor.component.ApplicationMonitor;
 import org.apache.stratos.autoscaler.monitor.component.GroupMonitor;
 import org.apache.stratos.autoscaler.monitor.component.ParentComponentMonitor;
+import org.apache.stratos.autoscaler.util.ServiceReferenceHolder;
 import org.apache.stratos.messaging.domain.applications.Application;
 import org.apache.stratos.messaging.domain.applications.Group;
+import org.apache.stratos.messaging.domain.instance.ApplicationInstance;
+import org.apache.stratos.messaging.domain.instance.GroupInstance;
 import org.apache.stratos.messaging.domain.topology.Cluster;
 import org.apache.stratos.messaging.domain.topology.Service;
 import org.apache.stratos.messaging.domain.topology.Topology;
@@ -60,30 +63,30 @@ public class MonitorFactory {
      * @throws PartitionValidationException  throws while validating the 
partition used in a cluster
      */
     public static Monitor getMonitor(ParentComponentMonitor parentMonitor,
-                                     ApplicationChildContext context, String 
appId, List<String> instanceId)
+                                     ApplicationChildContext context, String 
appId, List<String> instanceIds)
             throws TopologyInConsistentException,
             DependencyBuilderException, PolicyValidationException, 
PartitionValidationException {
-       
+
         Monitor monitor;
         if (context instanceof GroupChildContext) {
-            monitor = getGroupMonitor(parentMonitor, context, appId, 
instanceId);
+            monitor = getGroupMonitor(parentMonitor, context, appId, 
instanceIds);
         } else if (context instanceof ClusterChildContext) {
             monitor = getClusterMonitor(parentMonitor, (ClusterChildContext) 
context);
             if (monitor != null) {
-               //((AbstractClusterMonitor)monitor).startScheduler();
+                //((AbstractClusterMonitor)monitor).startScheduler();
                 ClusterChildContext clusterChildCtxt = (ClusterChildContext) 
context;
-                AbstractClusterMonitor clusterMonitor = 
(AbstractClusterMonitor)monitor;
+                AbstractClusterMonitor clusterMonitor = 
(AbstractClusterMonitor) monitor;
                 // FIXME: passing null as alias for cluster instance 
temporarily. should be removed.
-                createClusterInstance(clusterChildCtxt.getServiceName(), 
clusterMonitor.getClusterId(), null, instanceId.get(0));
-               
AutoscalerContext.getInstance().addClusterMonitor((AbstractClusterMonitor)monitor);
-                       }
+                createClusterInstance(clusterChildCtxt.getServiceName(), 
clusterMonitor.getClusterId(), null, instanceIds.get(0));
+                
AutoscalerContext.getInstance().addClusterMonitor((AbstractClusterMonitor) 
monitor);
+            }
         } else {
             monitor = getApplicationMonitor(appId);
         }
         return monitor;
     }
 
-    private static void createClusterInstance (String serviceType, String 
clusterId, String alias, String instanceId) {
+    private static void createClusterInstance(String serviceType, String 
clusterId, String alias, String instanceId) {
         CloudControllerClient.getInstance().createClusterInstance(serviceType, 
clusterId, alias, instanceId);
     }
 
@@ -102,8 +105,9 @@ public class MonitorFactory {
             throws DependencyBuilderException,
             TopologyInConsistentException {
         GroupMonitor groupMonitor;
+        boolean initialStartup = false;
+        //acquiring read lock to create the monitor
         ApplicationHolder.acquireReadLock();
-
         try {
             Group group = ApplicationHolder.getApplications().
                     getApplication(appId).getGroupRecursively(context.getId());
@@ -117,31 +121,51 @@ public class MonitorFactory {
                 } else {
                     groupMonitor.setHasStartupDependents(false);
                 }
-
-                if(group.isGroupScalingEnabled()) {
-                    groupMonitor.setGroupScalingEnabled(true);
-                } else if(parentMonitor instanceof GroupMonitor) {
-                    if(((GroupMonitor)parentMonitor).isGroupScalingEnabled() ||
-                            parentMonitor.hasGroupScalingDependent()) {
-                        groupMonitor.setHasGroupScalingDependent(true);
-                    }
+            }
+            if (group.isGroupScalingEnabled()) {
+                groupMonitor.setGroupScalingEnabled(true);
+            } else if (parentMonitor instanceof GroupMonitor) {
+                if (((GroupMonitor) parentMonitor).isGroupScalingEnabled() ||
+                        parentMonitor.hasGroupScalingDependent()) {
+                    groupMonitor.setHasGroupScalingDependent(true);
                 }
-
-                //Starting the minimum dependencies
-                groupMonitor.startMinimumDependencies(group, instanceIds);
-                //TODO*********** make it sync with the topology in the restart
-
-                /*if (group.getStatus() != groupMonitor.getStatus()) {
-                    //updating the status, if the group is not in created 
state when creating group Monitor
-                    //so that groupMonitor will notify the parent (useful when 
restarting stratos)
-                    groupMonitor.setStatus(group.getStatus());
-                }*/
             }
-
         } finally {
             ApplicationHolder.releaseReadLock();
 
         }
+
+        //acquiring write lock to add the group instances
+        ApplicationHolder.acquireWriteLock();
+        try {
+            Group group = ApplicationHolder.getApplications().
+                    getApplication(appId).getGroupRecursively(context.getId());
+            //Starting the minimum dependencies
+            initialStartup = groupMonitor.startMinimumDependencies(group, 
instanceIds);
+        } finally {
+            ApplicationHolder.releaseWriteLock();
+        }
+
+        /**
+         * If not first app deployment, acquiring read lock to check current 
the status of the group,
+         * when the stratos got to restarted
+         */
+        if(!initialStartup) {
+            ApplicationHolder.acquireReadLock();
+            try {
+                Group group = ApplicationHolder.getApplications().
+                        
getApplication(appId).getGroupRecursively(context.getId());
+                //Starting statusChecking to make it sync with the Topology in 
the restart of stratos.
+                for (GroupInstance instance : 
group.getInstanceIdToInstanceContextMap().values()) {
+                    ServiceReferenceHolder.getInstance().
+                            getGroupStatusProcessorChain().
+                            process(group.getUniqueIdentifier(), appId, 
instance.getInstanceId());
+                }
+            } finally {
+                ApplicationHolder.releaseReadLock();
+            }
+        }
+
         return groupMonitor;
 
     }
@@ -159,13 +183,15 @@ public class MonitorFactory {
             throws DependencyBuilderException,
             TopologyInConsistentException, PolicyValidationException {
         ApplicationMonitor applicationMonitor;
+        boolean initialStartup = false;
+        //acquiring read lock to start the monitor
         ApplicationHolder.acquireReadLock();
         try {
             Application application = 
ApplicationHolder.getApplications().getApplication(appId);
             if (application != null) {
                 applicationMonitor = new ApplicationMonitor(application);
                 applicationMonitor.setHasStartupDependents(false);
-                applicationMonitor.startMinimumDependencies(application);
+
 
             } else {
                 String msg = "[Application] " + appId + " cannot be found in 
the Topology";
@@ -176,6 +202,32 @@ public class MonitorFactory {
 
         }
 
+        //acquiring write lock to add the required instances
+        ApplicationHolder.acquireWriteLock();
+        try {
+            Application application = 
ApplicationHolder.getApplications().getApplication(appId);
+            initialStartup = 
applicationMonitor.startMinimumDependencies(application);
+        } finally {
+            ApplicationHolder.releaseWriteLock();
+        }
+
+        //If not first app deployment, then calculate the current status of 
the app instance.
+        if(!initialStartup) {
+            ApplicationHolder.acquireReadLock();
+            try {
+                Application application = 
ApplicationHolder.getApplications().getApplication(appId);
+                for(ApplicationInstance instance : 
application.getInstanceIdToInstanceContextMap().values()) {
+                    //Starting statusChecking to make it sync with the 
Topology in the restart of stratos.
+                    ServiceReferenceHolder.getInstance().
+                            getGroupStatusProcessorChain().
+                            process(appId, appId, instance.getInstanceId());
+
+                }
+            } finally {
+                ApplicationHolder.releaseReadLock();
+            }
+        }
+
         return applicationMonitor;
 
     }
@@ -190,11 +242,11 @@ public class MonitorFactory {
      * @throws 
org.apache.stratos.autoscaler.exception.partition.PartitionValidationException
      */
     public static AbstractClusterMonitor 
getClusterMonitor(ParentComponentMonitor parentMonitor,
-                                                            
ClusterChildContext context)
+                                                           ClusterChildContext 
context)
             throws PolicyValidationException,
             PartitionValidationException,
             TopologyInConsistentException {
-       
+
         //Retrieving the Cluster from Topology
         String clusterId = context.getId();
         String serviceName = context.getServiceName();
@@ -222,14 +274,14 @@ public class MonitorFactory {
             clusterMonitor.setId(clusterId);
 
             //setting the startup dependent behaviour of the cluster monitor
-            if(parentMonitor.hasStartupDependents() || 
(context.hasStartupDependents() && context.hasChild())) {
+            if (parentMonitor.hasStartupDependents() || 
(context.hasStartupDependents() && context.hasChild())) {
                 clusterMonitor.setHasStartupDependents(true);
             } else {
                 clusterMonitor.setHasStartupDependents(false);
             }
 
             //setting the scaling dependent behaviour of the cluster monitor
-            if(parentMonitor.hasGroupScalingDependent() || 
(context.isGroupScalingEnabled())) {
+            if (parentMonitor.hasGroupScalingDependent() || 
(context.isGroupScalingEnabled())) {
                 clusterMonitor.setHasGroupScalingDependent(true);
             } else {
                 clusterMonitor.setHasGroupScalingDependent(false);
@@ -244,7 +296,7 @@ public class MonitorFactory {
                     
StatusChecker.getInstance().onMemberStatusChange(clusterId);
                 }
             }*/
-            if(cluster.getInstanceContextCount() > 0) {
+            if (cluster.getInstanceContextCount() > 0) {
                 //Starting the cluster monitor as existing instances are found
             }
             return clusterMonitor;

http://git-wip-us.apache.org/repos/asf/stratos/blob/5f0ce17c/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/monitor/component/ApplicationMonitor.java
----------------------------------------------------------------------
diff --git 
a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/monitor/component/ApplicationMonitor.java
 
b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/monitor/component/ApplicationMonitor.java
index 00fb406..63e4a03 100644
--- 
a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/monitor/component/ApplicationMonitor.java
+++ 
b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/monitor/component/ApplicationMonitor.java
@@ -180,8 +180,9 @@ public class ApplicationMonitor extends 
ParentComponentMonitor {
 
     }
 
-    public void startMinimumDependencies(Application application)
+    public boolean startMinimumDependencies(Application application)
             throws TopologyInConsistentException, PolicyValidationException {
+        boolean initialStartup = false;
         //There will be one application instance
         //FIXME when having multiple network partitions
         if (application.getInstanceContextCount() > 0) {
@@ -189,7 +190,9 @@ public class ApplicationMonitor extends 
ParentComponentMonitor {
         } else {
             //No available instances in the Applications. Need to start them 
all
             createInstanceAndStartDependency(application);
+            initialStartup = true;
         }
+        return initialStartup;
     }
 
     private void createInstanceAndStartDependency(Application application)
@@ -207,6 +210,8 @@ public class ApplicationMonitor extends 
ParentComponentMonitor {
                 this.networkPartitionCtxts.put(context.getId(), context);
 
                 instanceIds.add(instanceId);
+                log.info("Application instance has been added for the [network 
partition] " +
+                        networkPartition.getId() + " [appInstanceId] " + 
instanceId);
             }
 
         }

http://git-wip-us.apache.org/repos/asf/stratos/blob/5f0ce17c/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/monitor/component/GroupMonitor.java
----------------------------------------------------------------------
diff --git 
a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/monitor/component/GroupMonitor.java
 
b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/monitor/component/GroupMonitor.java
index a072a8a..cccc0cc 100644
--- 
a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/monitor/component/GroupMonitor.java
+++ 
b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/monitor/component/GroupMonitor.java
@@ -247,8 +247,9 @@ public class GroupMonitor extends ParentComponentMonitor 
implements EventHandler
         this.groupScalingEnabled = groupScalingEnabled;
     }
 
-    public void startMinimumDependencies(Group group, List<String> 
parentInstanceIds)
+    public boolean startMinimumDependencies(Group group, List<String> 
parentInstanceIds)
             throws TopologyInConsistentException {
+        boolean initialStartup = false;
         int min = group.getGroupMinInstances();
         if (group.getInstanceContextCount() >= min) {
             startDependency(group);
@@ -272,8 +273,10 @@ public class GroupMonitor extends ParentComponentMonitor 
implements EventHandler
             } else {
                 //No available instances in the Applications. Need to start 
them all
                 createInstanceAndStartDependency(group, parentInstanceIds);
+                initialStartup = true;
             }
         }
+        return initialStartup;
     }
 
     public void createInstanceAndStartDependency(Group group, List<String> 
parentInstanceIds)

http://git-wip-us.apache.org/repos/asf/stratos/blob/5f0ce17c/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 8e44816..fa2ffa8 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
@@ -41,17 +41,17 @@ public class GroupStatusActiveProcessor extends 
GroupStatusProcessor {
     }
 
     @Override
-    public boolean process(String idOfChild, String idOfComponent, String 
appId,
+    public boolean process(String idOfComponent, String appId,
                            String instanceId) {
         boolean statusChanged;
-        statusChanged = doProcess(idOfChild, idOfComponent, appId, instanceId);
+        statusChanged = doProcess(idOfComponent, appId, instanceId);
         if (statusChanged) {
             return statusChanged;
         }
 
         if (nextProcessor != null) {
             // ask the next processor to take care of the message.
-            return nextProcessor.process(idOfChild, idOfComponent, appId, 
instanceId);
+            return nextProcessor.process(idOfComponent, appId, instanceId);
         } else {
             throw new RuntimeException(String.format("Failed to process 
message using " +
                             "available message processors: [component] %s 
[instance]",
@@ -60,13 +60,13 @@ public class GroupStatusActiveProcessor extends 
GroupStatusProcessor {
     }
 
 
-    private boolean doProcess(String idOfChild, String idOfComponent, String 
appId, String instanceId) {
+    private boolean doProcess(String idOfComponent, String appId, String 
instanceId) {
         ParentComponent component;
         Map<String, Group> groups;
         Map<String, ClusterDataHolder> clusterData;
 
         if (log.isInfoEnabled()) {
-            log.info("StatusChecker calculating the status for the group [ " + 
idOfChild + " ]");
+            log.info("StatusChecker calculating the status for the group [ " + 
idOfComponent + " ]");
         }
 
         try {

http://git-wip-us.apache.org/repos/asf/stratos/blob/5f0ce17c/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/status/processor/group/GroupStatusInActiveProcessor.java
----------------------------------------------------------------------
diff --git 
a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/status/processor/group/GroupStatusInActiveProcessor.java
 
b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/status/processor/group/GroupStatusInActiveProcessor.java
index eb201f2..84fcf8f 100644
--- 
a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/status/processor/group/GroupStatusInActiveProcessor.java
+++ 
b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/status/processor/group/GroupStatusInActiveProcessor.java
@@ -46,17 +46,17 @@ public class GroupStatusInActiveProcessor extends 
GroupStatusProcessor {
     }
 
     @Override
-    public boolean process(String idOfChild, String idOfComponent, String 
appId,
+    public boolean process(String idOfComponent, String appId,
                            String instanceId) {
         boolean statusChanged;
-        statusChanged = doProcess(idOfChild, idOfComponent, appId, instanceId);
+        statusChanged = doProcess(idOfComponent, appId, instanceId);
         if (statusChanged) {
             return statusChanged;
         }
 
         if (nextProcessor != null) {
             // ask the next processor to take care of the message.
-            return nextProcessor.process(idOfChild, idOfComponent, appId, 
instanceId);
+            return nextProcessor.process(idOfComponent, appId, instanceId);
         } else {
             throw new RuntimeException(String.format("Failed to process 
message using " +
                             "available message processors: [component] %s 
[instance]",
@@ -65,13 +65,13 @@ public class GroupStatusInActiveProcessor extends 
GroupStatusProcessor {
     }
 
 
-    private boolean doProcess(String idOfChild, String idOfComponent, String 
appId, String instanceId) {
+    private boolean doProcess(String idOfComponent, String appId, String 
instanceId) {
         ParentComponent component;
         Map<String, Group> groups;
         Map<String, ClusterDataHolder> clusterData;
 
         if (log.isInfoEnabled()) {
-            log.info("StatusChecker calculating the status for the group [ " + 
idOfChild + " ]");
+            log.info("StatusChecker calculating the status for the group [ " + 
idOfComponent + " ]");
         }
 
         try {

http://git-wip-us.apache.org/repos/asf/stratos/blob/5f0ce17c/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/status/processor/group/GroupStatusProcessor.java
----------------------------------------------------------------------
diff --git 
a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/status/processor/group/GroupStatusProcessor.java
 
b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/status/processor/group/GroupStatusProcessor.java
index 7687294..66fb838 100644
--- 
a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/status/processor/group/GroupStatusProcessor.java
+++ 
b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/status/processor/group/GroupStatusProcessor.java
@@ -40,12 +40,10 @@ public abstract class GroupStatusProcessor extends 
StatusProcessor {
 
     /**
      * Message processing and delegating logic.
-     * @param idOfChild real message body.
      * @param instanceId Object that will get updated.
      * @return whether the processing was successful or not.
      */
-    public abstract boolean process(String idOfChild, String idOfComponent, 
String appId,
-                                                                               
 String instanceId);
+    public abstract boolean process(String idOfComponent, String appId, String 
instanceId);
 
     /**
      * Find out whether all the groups of a group in the same state or not

http://git-wip-us.apache.org/repos/asf/stratos/blob/5f0ce17c/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/status/processor/group/GroupStatusProcessorChain.java
----------------------------------------------------------------------
diff --git 
a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/status/processor/group/GroupStatusProcessorChain.java
 
b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/status/processor/group/GroupStatusProcessorChain.java
index 61cded0..0e8c7cc 100644
--- 
a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/status/processor/group/GroupStatusProcessorChain.java
+++ 
b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/status/processor/group/GroupStatusProcessorChain.java
@@ -45,13 +45,13 @@ public class GroupStatusProcessorChain extends 
StatusProcessorChain {
 
     }
 
-    public boolean process(String idOfChild, String idOfComponent, String 
appId,
+    public boolean process(String idOfComponent, String appId,
                            String instanceId) {
         GroupStatusProcessor root = (GroupStatusProcessor) list.getFirst();
         if (root == null) {
             throw new RuntimeException("Message processor chain is not 
initialized");
         }
-        return root.process(idOfChild, idOfComponent, appId, instanceId);
+        return root.process(idOfComponent, appId, instanceId);
     }
 
 }

http://git-wip-us.apache.org/repos/asf/stratos/blob/5f0ce17c/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 0592dc6..329a901 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
@@ -40,17 +40,17 @@ public class GroupStatusTerminatedProcessor extends 
GroupStatusProcessor {
         this.nextProcessor = (GroupStatusProcessor) nextProcessor;
     }
     @Override
-    public boolean process(String idOfChild, String idOfComponent, String 
appId,
+    public boolean process(String idOfComponent, String appId,
                            String instanceId) {
         boolean statusChanged;
-        statusChanged = doProcess(idOfChild, idOfComponent, appId, instanceId);
+        statusChanged = doProcess(idOfComponent, appId, instanceId);
         if (statusChanged) {
             return statusChanged;
         }
 
         if (nextProcessor != null) {
             // ask the next processor to take care of the message.
-            return nextProcessor.process(idOfChild, idOfComponent, appId, 
instanceId);
+            return nextProcessor.process(idOfComponent, appId, instanceId);
         } else {
             throw new RuntimeException(String.format("Failed to process 
message using " +
                             "available message processors: [component] %s 
[instance]",
@@ -59,13 +59,13 @@ public class GroupStatusTerminatedProcessor extends 
GroupStatusProcessor {
     }
 
 
-    private boolean doProcess(String idOfChild, String idOfComponent, String 
appId, String instanceId) {
+    private boolean doProcess(String idOfComponent, String appId, String 
instanceId) {
         ParentComponent component;
         Map<String, Group> groups;
         Map<String, ClusterDataHolder> clusterData;
 
         if (log.isInfoEnabled()) {
-            log.info("StatusChecker calculating the status for the group [ " + 
idOfChild + " ]");
+            log.info("StatusChecker calculating the status for the group [ " + 
idOfComponent + " ]");
         }
 
         try {

http://git-wip-us.apache.org/repos/asf/stratos/blob/5f0ce17c/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 7172b31..97bedb3 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
@@ -41,17 +41,17 @@ public class GroupStatusTerminatingProcessor extends 
GroupStatusProcessor {
     }
 
     @Override
-    public boolean process(String idOfChild, String idOfComponent, String 
appId,
+    public boolean process(String idOfComponent, String appId,
                            String instanceId) {
         boolean statusChanged;
-        statusChanged = doProcess(idOfChild, idOfComponent, appId, instanceId);
+        statusChanged = doProcess(idOfComponent, appId, instanceId);
         if (statusChanged) {
             return statusChanged;
         }
 
         if (nextProcessor != null) {
             // ask the next processor to take care of the message.
-            return nextProcessor.process(idOfChild, idOfComponent, appId, 
instanceId);
+            return nextProcessor.process(idOfComponent, appId, instanceId);
         } else {
             throw new RuntimeException(String.format("Failed to process 
message using " +
                             "available message processors: [component] %s 
[instance]",
@@ -60,13 +60,13 @@ public class GroupStatusTerminatingProcessor extends 
GroupStatusProcessor {
     }
 
 
-    private boolean doProcess(String idOfChild, String idOfComponent, String 
appId, String instanceId) {
+    private boolean doProcess(String idOfComponent, String appId, String 
instanceId) {
         ParentComponent component;
         Map<String, Group> groups;
         Map<String, ClusterDataHolder> clusterData;
 
         if (log.isInfoEnabled()) {
-            log.info("StatusChecker calculating the status for the group [ " + 
idOfChild + " ]");
+            log.info("StatusChecker calculating the status for the group [ " + 
idOfComponent + " ]");
         }
 
         try {

Reply via email to