brooklyn-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From henev...@apache.org
Subject [41/50] brooklyn-server git commit: Move ShutdownHandler to core
Date Wed, 30 Mar 2016 14:00:18 GMT
Move ShutdownHandler to core

Needs to be accessible from other modules which don't directly depend on the rest code.


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

Branch: refs/heads/master
Commit: 271d76ba08f411cb35ac85327a831c27b8276be6
Parents: 6727aa6
Author: Svetoslav Neykov <svetoslav.neykov@cloudsoftcorp.com>
Authored: Fri Mar 25 18:25:51 2016 +0200
Committer: Svetoslav Neykov <svetoslav.neykov@cloudsoftcorp.com>
Committed: Tue Mar 29 09:39:47 2016 +0300

----------------------------------------------------------------------
 .../brooklyn/core/mgmt/ShutdownHandler.java     | 23 ++++++++++++++++++++
 .../deserializingClassRenames.properties        |  2 +-
 .../brooklyn/launcher/BrooklynLauncher.java     |  2 +-
 .../brooklyn/launcher/BrooklynWebServer.java    |  2 +-
 .../brooklyn/rest/resources/ServerResource.java |  2 +-
 .../brooklyn/rest/util/ShutdownHandler.java     |  5 ++++-
 .../rest/util/ShutdownHandlerProvider.java      |  4 ++--
 .../brooklyn/rest/util/TestShutdownHandler.java |  2 ++
 .../rest/util/NoOpRecordingShutdownHandler.java |  2 +-
 .../util/ServerStoppingShutdownHandler.java     |  1 +
 .../main/java/org/apache/brooklyn/cli/Main.java |  2 +-
 11 files changed, 38 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/271d76ba/core/src/main/java/org/apache/brooklyn/core/mgmt/ShutdownHandler.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/brooklyn/core/mgmt/ShutdownHandler.java b/core/src/main/java/org/apache/brooklyn/core/mgmt/ShutdownHandler.java
new file mode 100644
index 0000000..d0537c1
--- /dev/null
+++ b/core/src/main/java/org/apache/brooklyn/core/mgmt/ShutdownHandler.java
@@ -0,0 +1,23 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.brooklyn.core.mgmt;
+
+public interface ShutdownHandler {
+    void onShutdownRequest();
+}

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/271d76ba/core/src/main/resources/org/apache/brooklyn/core/mgmt/persist/deserializingClassRenames.properties
----------------------------------------------------------------------
diff --git a/core/src/main/resources/org/apache/brooklyn/core/mgmt/persist/deserializingClassRenames.properties
b/core/src/main/resources/org/apache/brooklyn/core/mgmt/persist/deserializingClassRenames.properties
index a86bea0..7909006 100644
--- a/core/src/main/resources/org/apache/brooklyn/core/mgmt/persist/deserializingClassRenames.properties
+++ b/core/src/main/resources/org/apache/brooklyn/core/mgmt/persist/deserializingClassRenames.properties
@@ -1257,7 +1257,7 @@ brooklyn.rest.util.DefaultExceptionMapper
 brooklyn.rest.util.EntityLocationUtils                                           : org.apache.brooklyn.rest.util.EntityLocationUtils
 brooklyn.rest.util.FormMapProvider                                               : org.apache.brooklyn.rest.util.FormMapProvider
 brooklyn.rest.util.ManagementContextProvider                                     : org.apache.brooklyn.rest.util.ManagementContextProvider
-brooklyn.rest.util.ShutdownHandler                                               : org.apache.brooklyn.rest.util.ShutdownHandler
+brooklyn.rest.util.ShutdownHandler                                               : org.apache.brooklyn.core.mgmt.ShutdownHandler
 brooklyn.rest.util.ShutdownHandlerProvider                                       : org.apache.brooklyn.rest.util.ShutdownHandlerProvider
 brooklyn.rest.util.json.BidiSerialization                                        : org.apache.brooklyn.rest.util.json.BidiSerialization
 brooklyn.rest.util.json.BrooklynJacksonJsonProvider                              : org.apache.brooklyn.rest.util.json.BrooklynJacksonJsonProvider

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/271d76ba/launcher/src/main/java/org/apache/brooklyn/launcher/BrooklynLauncher.java
----------------------------------------------------------------------
diff --git a/launcher/src/main/java/org/apache/brooklyn/launcher/BrooklynLauncher.java b/launcher/src/main/java/org/apache/brooklyn/launcher/BrooklynLauncher.java
index 476c897..5a0f5c9 100644
--- a/launcher/src/main/java/org/apache/brooklyn/launcher/BrooklynLauncher.java
+++ b/launcher/src/main/java/org/apache/brooklyn/launcher/BrooklynLauncher.java
@@ -47,7 +47,7 @@ import org.apache.brooklyn.launcher.config.StopWhichAppsOnShutdown;
 import org.apache.brooklyn.rest.BrooklynWebConfig;
 import org.apache.brooklyn.rest.filter.BrooklynPropertiesSecurityFilter;
 import org.apache.brooklyn.rest.security.provider.BrooklynUserWithRandomPasswordSecurityProvider;
-import org.apache.brooklyn.rest.util.ShutdownHandler;
+import org.apache.brooklyn.core.mgmt.ShutdownHandler;
 import org.apache.brooklyn.util.exceptions.Exceptions;
 import org.apache.brooklyn.util.exceptions.FatalRuntimeException;
 import org.apache.brooklyn.util.exceptions.RuntimeInterruptedException;

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/271d76ba/launcher/src/main/java/org/apache/brooklyn/launcher/BrooklynWebServer.java
----------------------------------------------------------------------
diff --git a/launcher/src/main/java/org/apache/brooklyn/launcher/BrooklynWebServer.java b/launcher/src/main/java/org/apache/brooklyn/launcher/BrooklynWebServer.java
index 8b49ca9..0eab836 100644
--- a/launcher/src/main/java/org/apache/brooklyn/launcher/BrooklynWebServer.java
+++ b/launcher/src/main/java/org/apache/brooklyn/launcher/BrooklynWebServer.java
@@ -55,7 +55,7 @@ import org.apache.brooklyn.rest.filter.LoggingFilter;
 import org.apache.brooklyn.rest.filter.NoCacheFilter;
 import org.apache.brooklyn.rest.filter.RequestTaggingFilter;
 import org.apache.brooklyn.rest.util.ManagementContextProvider;
-import org.apache.brooklyn.rest.util.ShutdownHandler;
+import org.apache.brooklyn.core.mgmt.ShutdownHandler;
 import org.apache.brooklyn.rest.util.ShutdownHandlerProvider;
 import org.apache.brooklyn.util.collections.MutableMap;
 import org.apache.brooklyn.util.core.BrooklynNetworkUtils;

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/271d76ba/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/resources/ServerResource.java
----------------------------------------------------------------------
diff --git a/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/resources/ServerResource.java
b/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/resources/ServerResource.java
index 3f06cc5..cf63007 100644
--- a/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/resources/ServerResource.java
+++ b/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/resources/ServerResource.java
@@ -61,7 +61,7 @@ import org.apache.brooklyn.rest.domain.HighAvailabilitySummary;
 import org.apache.brooklyn.rest.domain.VersionSummary;
 import org.apache.brooklyn.rest.transform.BrooklynFeatureTransformer;
 import org.apache.brooklyn.rest.transform.HighAvailabilityTransformer;
-import org.apache.brooklyn.rest.util.ShutdownHandler;
+import org.apache.brooklyn.core.mgmt.ShutdownHandler;
 import org.apache.brooklyn.rest.util.WebResourceUtils;
 import org.apache.brooklyn.util.collections.MutableMap;
 import org.apache.brooklyn.util.core.ResourceUtils;

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/271d76ba/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/util/ShutdownHandler.java
----------------------------------------------------------------------
diff --git a/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/util/ShutdownHandler.java
b/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/util/ShutdownHandler.java
index e573bf6..d959ca0 100644
--- a/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/util/ShutdownHandler.java
+++ b/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/util/ShutdownHandler.java
@@ -18,6 +18,9 @@
  */
 package org.apache.brooklyn.rest.util;
 
-public interface ShutdownHandler {
+/** @deprecated since 0.9.0, use {@link org.apache.brooklyn.core.mgmt.ShutdownHandler} instead.
*/
+@Deprecated
+public interface ShutdownHandler extends org.apache.brooklyn.core.mgmt.ShutdownHandler {
+    @Override
     void onShutdownRequest();
 }

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/271d76ba/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/util/ShutdownHandlerProvider.java
----------------------------------------------------------------------
diff --git a/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/util/ShutdownHandlerProvider.java
b/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/util/ShutdownHandlerProvider.java
index dd0ad21..4c00d82 100644
--- a/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/util/ShutdownHandlerProvider.java
+++ b/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/util/ShutdownHandlerProvider.java
@@ -22,10 +22,11 @@ import javax.annotation.Nullable;
 import javax.ws.rs.ext.ContextResolver;
 import javax.ws.rs.ext.Provider;
 
+import org.apache.brooklyn.core.mgmt.ShutdownHandler;
+
 
 @Provider
 public class ShutdownHandlerProvider implements ContextResolver<ShutdownHandler> {
-
     private ShutdownHandler shutdownHandler;
 
     public ShutdownHandlerProvider(@Nullable ShutdownHandler instance) {
@@ -42,4 +43,3 @@ public class ShutdownHandlerProvider implements ContextResolver<ShutdownHandler>
     }
 
 }
-

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/271d76ba/rest/rest-resources/src/test/java/org/apache/brooklyn/rest/util/TestShutdownHandler.java
----------------------------------------------------------------------
diff --git a/rest/rest-resources/src/test/java/org/apache/brooklyn/rest/util/TestShutdownHandler.java
b/rest/rest-resources/src/test/java/org/apache/brooklyn/rest/util/TestShutdownHandler.java
index b5cb218..6ec5a53 100644
--- a/rest/rest-resources/src/test/java/org/apache/brooklyn/rest/util/TestShutdownHandler.java
+++ b/rest/rest-resources/src/test/java/org/apache/brooklyn/rest/util/TestShutdownHandler.java
@@ -18,6 +18,8 @@
  */
 package org.apache.brooklyn.rest.util;
 
+import org.apache.brooklyn.core.mgmt.ShutdownHandler;
+
 public class TestShutdownHandler implements ShutdownHandler {
     private volatile boolean isRequested;
 

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/271d76ba/rest/rest-server/src/test/java/org/apache/brooklyn/rest/util/NoOpRecordingShutdownHandler.java
----------------------------------------------------------------------
diff --git a/rest/rest-server/src/test/java/org/apache/brooklyn/rest/util/NoOpRecordingShutdownHandler.java
b/rest/rest-server/src/test/java/org/apache/brooklyn/rest/util/NoOpRecordingShutdownHandler.java
index a99d3d9..917a0d8 100644
--- a/rest/rest-server/src/test/java/org/apache/brooklyn/rest/util/NoOpRecordingShutdownHandler.java
+++ b/rest/rest-server/src/test/java/org/apache/brooklyn/rest/util/NoOpRecordingShutdownHandler.java
@@ -18,7 +18,7 @@
  */
 package org.apache.brooklyn.rest.util;
 
-import org.apache.brooklyn.rest.util.ShutdownHandler;
+import org.apache.brooklyn.core.mgmt.ShutdownHandler;
 
 public class NoOpRecordingShutdownHandler implements ShutdownHandler {
     private volatile boolean isRequested;

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/271d76ba/rest/rest-server/src/test/java/org/apache/brooklyn/rest/util/ServerStoppingShutdownHandler.java
----------------------------------------------------------------------
diff --git a/rest/rest-server/src/test/java/org/apache/brooklyn/rest/util/ServerStoppingShutdownHandler.java
b/rest/rest-server/src/test/java/org/apache/brooklyn/rest/util/ServerStoppingShutdownHandler.java
index fc3bbc4..31d8d7c 100644
--- a/rest/rest-server/src/test/java/org/apache/brooklyn/rest/util/ServerStoppingShutdownHandler.java
+++ b/rest/rest-server/src/test/java/org/apache/brooklyn/rest/util/ServerStoppingShutdownHandler.java
@@ -19,6 +19,7 @@
 package org.apache.brooklyn.rest.util;
 
 import org.apache.brooklyn.api.mgmt.ManagementContext;
+import org.apache.brooklyn.core.mgmt.ShutdownHandler;
 import org.apache.brooklyn.core.mgmt.internal.ManagementContextInternal;
 import org.apache.brooklyn.util.time.Duration;
 import org.apache.brooklyn.util.time.Time;

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/271d76ba/server-cli/src/main/java/org/apache/brooklyn/cli/Main.java
----------------------------------------------------------------------
diff --git a/server-cli/src/main/java/org/apache/brooklyn/cli/Main.java b/server-cli/src/main/java/org/apache/brooklyn/cli/Main.java
index 3c3fa16..2d65ad0 100644
--- a/server-cli/src/main/java/org/apache/brooklyn/cli/Main.java
+++ b/server-cli/src/main/java/org/apache/brooklyn/cli/Main.java
@@ -69,7 +69,7 @@ import org.apache.brooklyn.launcher.BrooklynLauncher;
 import org.apache.brooklyn.launcher.BrooklynServerDetails;
 import org.apache.brooklyn.launcher.config.StopWhichAppsOnShutdown;
 import org.apache.brooklyn.rest.security.PasswordHasher;
-import org.apache.brooklyn.rest.util.ShutdownHandler;
+import org.apache.brooklyn.core.mgmt.ShutdownHandler;
 import org.apache.brooklyn.util.core.ResourceUtils;
 import org.apache.brooklyn.util.exceptions.Exceptions;
 import org.apache.brooklyn.util.exceptions.FatalConfigurationRuntimeException;


Mime
View raw message