brooklyn-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rich...@apache.org
Subject [05/50] [abbrv] git commit: BrooklynLauncher: register terminateOnShutdown(managementContext)
Date Fri, 23 May 2014 14:51:36 GMT
BrooklynLauncher: register terminateOnShutdown(managementContext)

- and same in BrooklynCampPlatformLauncher

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

Branch: refs/pull/1406/merge
Commit: 840258275c166f7318fe0d11dc50893db3693f2f
Parents: ab26150
Author: Aled Sage <aled.sage@gmail.com>
Authored: Thu May 22 10:11:21 2014 +0100
Committer: Aled Sage <aled.sage@gmail.com>
Committed: Thu May 22 10:11:21 2014 +0100

----------------------------------------------------------------------
 .../src/main/java/brooklyn/launcher/BrooklynLauncher.java     | 4 ++++
 .../brooklyn/launcher/camp/BrooklynCampPlatformLauncher.java  | 7 ++++++-
 2 files changed, 10 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/84025827/usage/launcher/src/main/java/brooklyn/launcher/BrooklynLauncher.java
----------------------------------------------------------------------
diff --git a/usage/launcher/src/main/java/brooklyn/launcher/BrooklynLauncher.java b/usage/launcher/src/main/java/brooklyn/launcher/BrooklynLauncher.java
index a7e57b4..3452b7f 100644
--- a/usage/launcher/src/main/java/brooklyn/launcher/BrooklynLauncher.java
+++ b/usage/launcher/src/main/java/brooklyn/launcher/BrooklynLauncher.java
@@ -378,6 +378,10 @@ public class BrooklynLauncher {
                 managementContext = new LocalManagementContext(brooklynProperties, brooklynAdditionalProperties);
             }
             brooklynProperties = ((ManagementContextInternal)managementContext).getBrooklynProperties();
+            
+            // We created the management context, so we are responsible for terminating it
+            BrooklynShutdownHooks.invokeTerminateOnShutdown(managementContext);
+            
         } else if (brooklynProperties == null) {
             brooklynProperties = ((ManagementContextInternal)managementContext).getBrooklynProperties();
             brooklynProperties.addFromMap(brooklynAdditionalProperties);

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/84025827/usage/launcher/src/main/java/brooklyn/launcher/camp/BrooklynCampPlatformLauncher.java
----------------------------------------------------------------------
diff --git a/usage/launcher/src/main/java/brooklyn/launcher/camp/BrooklynCampPlatformLauncher.java
b/usage/launcher/src/main/java/brooklyn/launcher/camp/BrooklynCampPlatformLauncher.java
index 606f664..07b5efe 100644
--- a/usage/launcher/src/main/java/brooklyn/launcher/camp/BrooklynCampPlatformLauncher.java
+++ b/usage/launcher/src/main/java/brooklyn/launcher/camp/BrooklynCampPlatformLauncher.java
@@ -4,6 +4,7 @@ import io.brooklyn.camp.CampServer;
 import io.brooklyn.camp.brooklyn.BrooklynCampPlatform;
 import io.brooklyn.camp.brooklyn.BrooklynCampPlatformLauncherAbstract;
 import io.brooklyn.camp.spi.PlatformRootSummary;
+import brooklyn.entity.basic.BrooklynShutdownHooks;
 import brooklyn.launcher.BrooklynLauncher;
 import brooklyn.management.internal.LocalManagementContext;
 
@@ -20,7 +21,11 @@ public class BrooklynCampPlatformLauncher extends BrooklynCampPlatformLauncherAb
     public BrooklynCampPlatformLauncher launch() {
         assert platform == null;
 
-        mgmt = new LocalManagementContext();        
+        mgmt = new LocalManagementContext();
+        
+        // We created the management context, so we are responsible for terminating it
+        BrooklynShutdownHooks.invokeTerminateOnShutdown(mgmt);
+
         brooklynLauncher = BrooklynLauncher.newInstance().managementContext(mgmt).start();
         platform = new BrooklynCampPlatform(
                 PlatformRootSummary.builder().name("Brooklyn CAMP Platform").build(),


Mime
View raw message