Repository: stratos
Updated Branches:
  refs/heads/docker-grouping-merge 35aa53597 -> a46da5c53


fixing missging part from the merge to update Cluster monitor with parent, 
dependent behaviour


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

Branch: refs/heads/docker-grouping-merge
Commit: a46da5c5341a3d13c843e794a7f7eff16c641e7c
Parents: 35aa535
Author: reka <[email protected]>
Authored: Wed Nov 5 12:17:53 2014 +0530
Committer: reka <[email protected]>
Committed: Wed Nov 5 12:18:03 2014 +0530

----------------------------------------------------------------------
 .../application/ApplicationMonitorFactory.java     | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/a46da5c5/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/monitor/application/ApplicationMonitorFactory.java
----------------------------------------------------------------------
diff --git 
a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/monitor/application/ApplicationMonitorFactory.java
 
b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/monitor/application/ApplicationMonitorFactory.java
index b14e452..c4e7a82 100644
--- 
a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/monitor/application/ApplicationMonitorFactory.java
+++ 
b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/monitor/application/ApplicationMonitorFactory.java
@@ -190,7 +190,22 @@ public class ApplicationMonitorFactory {
                 String msg = "[Service] " + serviceName + " cannot be found in 
the Topology";
                 throw new TopologyInConsistentException(msg);
             }
-            return ClusterMonitorFactory.getMonitor(cluster);
+            AbstractClusterMonitor clusterMonitor = 
ClusterMonitorFactory.getMonitor(cluster);
+            //Setting the parent of the cluster monitor
+            clusterMonitor.setParent(parentMonitor);
+            //setting the dependent behaviour of the cluster monitor
+            if(parentMonitor.isDependent() || (context.isDependent() && 
context.hasChild())) {
+                clusterMonitor.setHasDependent(true);
+            } else {
+                clusterMonitor.setHasDependent(false);
+            }
+            //setting the status of the cluster, if it doesn't match with 
Topology cluster status.
+            if (cluster.getStatus() != clusterMonitor.getStatus()) {
+                //updating the status, so that it will notify the parent
+                clusterMonitor.setStatus(cluster.getStatus());
+            }
+            return clusterMonitor;
+
         } finally {
             TopologyManager.releaseReadLockForCluster(serviceName, clusterId);
         }

Reply via email to