Return-Path: X-Original-To: apmail-brooklyn-commits-archive@minotaur.apache.org Delivered-To: apmail-brooklyn-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 0FEAC116BC for ; Wed, 10 Sep 2014 08:19:31 +0000 (UTC) Received: (qmail 14926 invoked by uid 500); 10 Sep 2014 08:19:28 -0000 Delivered-To: apmail-brooklyn-commits-archive@brooklyn.apache.org Received: (qmail 14902 invoked by uid 500); 10 Sep 2014 08:19:27 -0000 Mailing-List: contact commits-help@brooklyn.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@brooklyn.incubator.apache.org Delivered-To: mailing list commits@brooklyn.incubator.apache.org Received: (qmail 14893 invoked by uid 99); 10 Sep 2014 08:19:27 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 10 Sep 2014 08:19:27 +0000 X-ASF-Spam-Status: No, hits=-2001.7 required=5.0 tests=ALL_TRUSTED,RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO mail.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with SMTP; Wed, 10 Sep 2014 08:19:05 +0000 Received: (qmail 14765 invoked by uid 99); 10 Sep 2014 08:19:03 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 10 Sep 2014 08:19:03 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 7B5239A14; Wed, 10 Sep 2014 08:19:03 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: heneveld@apache.org To: commits@brooklyn.incubator.apache.org Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: git commit: only destroy root applications on stop Date: Wed, 10 Sep 2014 08:19:03 +0000 (UTC) X-Virus-Checked: Checked by ClamAV on apache.org 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 Authored: Wed Sep 10 09:18:31 2014 +0100 Committer: Alex Heneveld 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");