Deletes deprecated BrooklynGlobalConfig
Project: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/commit/d7548187 Tree: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/tree/d7548187 Diff: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/diff/d7548187 Branch: refs/heads/master Commit: d75481873e207b229c99462f34f5a66b9f7c5e34 Parents: 54cbccc Author: Aled Sage <[email protected]> Authored: Wed Jul 29 17:20:27 2015 +0100 Committer: Aled Sage <[email protected]> Committed: Sat Aug 1 00:16:51 2015 +0100 ---------------------------------------------------------------------- .../config/BrooklynDevelopmentModes.java | 93 -------------------- .../launcher/config/BrooklynGlobalConfig.java | 4 - 2 files changed, 97 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/d7548187/usage/launcher/src/main/java/brooklyn/launcher/config/BrooklynDevelopmentModes.java ---------------------------------------------------------------------- diff --git a/usage/launcher/src/main/java/brooklyn/launcher/config/BrooklynDevelopmentModes.java b/usage/launcher/src/main/java/brooklyn/launcher/config/BrooklynDevelopmentModes.java deleted file mode 100644 index ea08466..0000000 --- a/usage/launcher/src/main/java/brooklyn/launcher/config/BrooklynDevelopmentModes.java +++ /dev/null @@ -1,93 +0,0 @@ -/* - * 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 brooklyn.launcher.config; - -import java.io.File; -import java.util.concurrent.atomic.AtomicBoolean; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import brooklyn.config.ConfigKey; -import brooklyn.event.basic.BasicConfigKey; -import brooklyn.util.os.Os; - -@Deprecated /** @deprecated since 0.7.0; see BrooklynVersion; -* and anyway this was not really used, and if it were, it would be needed in core; autodetection is pretty good */ -public class BrooklynDevelopmentModes { - - private static final Logger log = LoggerFactory.getLogger(BrooklynDevelopmentModes.class); - - public static final ConfigKey<BrooklynDevelopmentMode> BROOKLYN_DEV_MODE = new BasicConfigKey<BrooklynDevelopmentMode>( - BrooklynDevelopmentMode.class, "brooklyn.developmentMode", "whether to run in development mode " + - "(default is to autodetect based on classpath)", BrooklynDevelopmentMode.AUTO); - - private static AtomicBoolean loggedMode = new AtomicBoolean(false); - - public static enum BrooklynDevelopmentMode { - TRUE(true), FALSE(false), AUTO(null); - - private final Boolean enabled; - - BrooklynDevelopmentMode(Boolean enabled) { - this.enabled = enabled; - } - - public boolean isEnabled() { - boolean enabled = computeEnabled(); - if (!loggedMode.getAndSet(true)) { - // log on first invocation - String reason = (this.enabled==null ? "autodetected" : "forced"); - if (enabled) { - log.info("Brooklyn running in development mode ("+reason+")"); - } else { - log.debug("Brooklyn not running in development mode ("+reason+")"); - } - } - return enabled; - } - - protected boolean computeEnabled() { - if (enabled!=null) return enabled; - return getAutodectectedDevelopmentMode(); - } - } - - private static Boolean developmentMode = null; - - public static boolean getAutodectectedDevelopmentMode() { - if (developmentMode!=null) return developmentMode; - developmentMode = computeAutodectectedDevelopmentMode(); - return developmentMode; - } - - private static final String segment = "/core/target/classes"; - - private static boolean computeAutodectectedDevelopmentMode() { - String cp = System.getProperty("java.class.path"); - String platformSegment = Os.nativePath(segment); - if (cp==null) return false; - if (cp.endsWith(platformSegment) || cp.contains(platformSegment+File.pathSeparator)) { - log.debug("Brooklyn developmentMode autodetected (based on presence of '"+segment+"' in classpath)"); - return true; - } - return false; - } - -} http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/d7548187/usage/launcher/src/main/java/brooklyn/launcher/config/BrooklynGlobalConfig.java ---------------------------------------------------------------------- diff --git a/usage/launcher/src/main/java/brooklyn/launcher/config/BrooklynGlobalConfig.java b/usage/launcher/src/main/java/brooklyn/launcher/config/BrooklynGlobalConfig.java index 5f79cf0..408c08a 100644 --- a/usage/launcher/src/main/java/brooklyn/launcher/config/BrooklynGlobalConfig.java +++ b/usage/launcher/src/main/java/brooklyn/launcher/config/BrooklynGlobalConfig.java @@ -43,10 +43,6 @@ import brooklyn.util.time.Duration; */ public class BrooklynGlobalConfig { - @Deprecated /** @deprecated since 0.7.0; see BrooklynVersion; - * and anyway this was not really used, and if it were, it would be needed in core; autodetection is pretty good */ - public static final ConfigKey<brooklyn.launcher.config.BrooklynDevelopmentModes.BrooklynDevelopmentMode> BROOKLYN_DEV_MODE = brooklyn.launcher.config.BrooklynDevelopmentModes.BROOKLYN_DEV_MODE; - public static final ConfigKey<Boolean> REQUIRE_HTTPS = BrooklynWebConfig.HTTPS_REQUIRED; public static final ConfigKey<Duration> GC_PERIOD = BrooklynGarbageCollector.GC_PERIOD;
