brooklyn-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From henev...@apache.org
Subject git commit: only destroy root applications on stop
Date Wed, 10 Sep 2014 08:19:03 GMT
Repository: incubator-brooklyn
Updated Branches:
  refs/heads/master 0d968c8ce -> d78566251


only destroy root applications on stop


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

Branch: refs/heads/master
Commit: d785662510aeb9b11f1bfcc7e222d5b78f88f12d
Parents: 0d968c8
Author: Alex Heneveld <alex.heneveld@cloudsoftcorp.com>
Authored: Wed Sep 10 09:18:31 2014 +0100
Committer: Alex Heneveld <alex.heneveld@cloudsoftcorp.com>
Committed: Wed Sep 10 09:18:31 2014 +0100

----------------------------------------------------------------------
 .../entity/basic/AbstractApplication.java       | 20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/d7856625/core/src/main/java/brooklyn/entity/basic/AbstractApplication.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/brooklyn/entity/basic/AbstractApplication.java b/core/src/main/java/brooklyn/entity/basic/AbstractApplication.java
index f4044f7..9032aac 100644
--- a/core/src/main/java/brooklyn/entity/basic/AbstractApplication.java
+++ b/core/src/main/java/brooklyn/entity/basic/AbstractApplication.java
@@ -210,15 +210,17 @@ public abstract class AbstractApplication extends AbstractEntity implements
Star
         ServiceStateLogic.setExpectedState(this, Lifecycle.STOPPED);
         recordApplicationEvent(Lifecycle.STOPPED);
 
-        synchronized (this) {
-            deployed = false;
-            //TODO review mgmt destroy lifecycle
-            //  we don't necessarily want to forget all about the app on stop, 
-            //since operator may be interested in things recently stopped;
-            //but that could be handled by the impl at management
-            //(keeping recently unmanaged things)  
-            //  however unmanaging must be done last, _after_ we stop children and set attributes

-            getEntityManager().unmanage(this);
+        if (getParent()==null) {
+            synchronized (this) {
+                deployed = false;
+                //TODO review mgmt destroy lifecycle
+                //  we don't necessarily want to forget all about the app on stop, 
+                //since operator may be interested in things recently stopped;
+                //but that could be handled by the impl at management
+                //(keeping recently unmanaged things)  
+                //  however unmanaging must be done last, _after_ we stop children and set
attributes 
+                getEntityManager().unmanage(this);
+            }
         }
 
         logApplicationLifecycle("Stopped");


Mime
View raw message