Repository: stratos
Updated Branches:
  refs/heads/master 9a47826e8 -> d9c7fe45a


Fixes to start all the dependencies in the ApplicationChildContext


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

Branch: refs/heads/master
Commit: d9c7fe45a3df369cb9cf33505c06e017cb56ff63
Parents: 9a47826
Author: gayan <[email protected]>
Authored: Tue Jan 13 22:06:30 2015 +0530
Committer: gayan <[email protected]>
Committed: Tue Jan 13 22:06:30 2015 +0530

----------------------------------------------------------------------
 .../component/ParentComponentMonitor.java        | 19 ++++++++++++++-----
 1 file changed, 14 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/d9c7fe45/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/monitor/component/ParentComponentMonitor.java
----------------------------------------------------------------------
diff --git 
a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/monitor/component/ParentComponentMonitor.java
 
b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/monitor/component/ParentComponentMonitor.java
index a357459..322377d 100644
--- 
a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/monitor/component/ParentComponentMonitor.java
+++ 
b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/monitor/component/ParentComponentMonitor.java
@@ -694,16 +694,25 @@ public abstract class ParentComponentMonitor extends 
Monitor implements Runnable
 
     protected synchronized void startMonitor(ParentComponentMonitor parent,
                                              ApplicationChildContext context, 
List<String> instanceIds) {
-           for (ApplicationChildContext contextInner : 
context.getApplicationChildContextList()) {
-                   if 
(!this.aliasToActiveMonitorsMap.containsKey(contextInner.getId())) {
+           if (context.getApplicationChildContextList().size() > 0) {
+                   for (ApplicationChildContext contextInner : 
context.getApplicationChildContextList()) {
+                           if 
(!this.aliasToActiveMonitorsMap.containsKey(contextInner.getId())) {
+                                   pendingMonitorsList.add(context.getId());
+                                   executorService.submit(new 
MonitorAdder(parent, contextInner, this.appId, instanceIds));
+                                   if (log.isDebugEnabled()) {
+                                           log.debug(String.format("Monitor 
Adder has been added: [cluster] %s ", contextInner.getId()));
+                                   }
+                           }
+                   }
+           } else {
+                   if 
(!this.aliasToActiveMonitorsMap.containsKey(context.getId())) {
                            pendingMonitorsList.add(context.getId());
-                           executorService.submit(new MonitorAdder(parent, 
contextInner, this.appId, instanceIds));
+                           executorService.submit(new MonitorAdder(parent, 
context, this.appId, instanceIds));
                            if (log.isDebugEnabled()) {
-                                   log.debug(String.format("Monitor Adder has 
been added: [cluster] %s ", contextInner.getId()));
+                                   log.debug(String.format("Monitor Adder has 
been added: [cluster] %s ", context.getId()));
                            }
                    }
            }
-
     }
 
     public Map<String, Monitor> getAliasToActiveMonitorsMap() {

Reply via email to