brooklyn-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From henev...@apache.org
Subject [42/45] git commit: fix failing tests by restoring feature defaults on feature cache clear
Date Fri, 04 Jul 2014 09:51:24 GMT
fix failing tests by restoring feature defaults on feature cache clear


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

Branch: refs/heads/master
Commit: 8094765dbf862053bc21fd534376345b33d23d00
Parents: f28d9cc
Author: Alex Heneveld <alex.heneveld@cloudsoftcorp.com>
Authored: Fri Jul 4 10:36:06 2014 +0100
Committer: Alex Heneveld <alex.heneveld@cloudsoftcorp.com>
Committed: Fri Jul 4 10:37:45 2014 +0100

----------------------------------------------------------------------
 .../java/brooklyn/entity/basic/BrooklynShutdownHooks.java     | 2 +-
 .../main/java/brooklyn/entity/rebind/RebindManagerImpl.java   | 2 ++
 .../java/brooklyn/internal/BrooklynFeatureEnablement.java     | 7 ++++++-
 3 files changed, 9 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/8094765d/core/src/main/java/brooklyn/entity/basic/BrooklynShutdownHooks.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/brooklyn/entity/basic/BrooklynShutdownHooks.java b/core/src/main/java/brooklyn/entity/basic/BrooklynShutdownHooks.java
index 3692237..178c3d8 100644
--- a/core/src/main/java/brooklyn/entity/basic/BrooklynShutdownHooks.java
+++ b/core/src/main/java/brooklyn/entity/basic/BrooklynShutdownHooks.java
@@ -175,7 +175,7 @@ public class BrooklynShutdownHooks {
             if (entitiesToStop.isEmpty()) {
                 log.debug("Brooklyn shutdown: no entities to stop");
             } else {
-                log.info("Brooklyn stopdown: stopping entities "+entitiesToStop);
+                log.info("Brooklyn shutdown: stopping entities "+entitiesToStop);
                 destroyAndWait(entitiesToStop, shutdownTimeout);
             }
 

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/8094765d/core/src/main/java/brooklyn/entity/rebind/RebindManagerImpl.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/brooklyn/entity/rebind/RebindManagerImpl.java b/core/src/main/java/brooklyn/entity/rebind/RebindManagerImpl.java
index f105efe..5775dc4 100644
--- a/core/src/main/java/brooklyn/entity/rebind/RebindManagerImpl.java
+++ b/core/src/main/java/brooklyn/entity/rebind/RebindManagerImpl.java
@@ -135,6 +135,8 @@ public class RebindManagerImpl implements RebindManager {
         rebindFailureMode = managementContext.getConfig().getConfig(REBIND_FAILURE_MODE);
         addPolicyFailureMode = managementContext.getConfig().getConfig(ADD_POLICY_FAILURE_MODE);
         loadPolicyFailureMode = managementContext.getConfig().getConfig(LOAD_POLICY_FAILURE_MODE);
+        
+        LOG.debug("Persistence in "+this+" of: policies="+persistEnrichersEnabled+" enrichers="+persistEnrichersEnabled);
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/8094765d/core/src/main/java/brooklyn/internal/BrooklynFeatureEnablement.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/brooklyn/internal/BrooklynFeatureEnablement.java b/core/src/main/java/brooklyn/internal/BrooklynFeatureEnablement.java
index 8838b46..9bfc188 100644
--- a/core/src/main/java/brooklyn/internal/BrooklynFeatureEnablement.java
+++ b/core/src/main/java/brooklyn/internal/BrooklynFeatureEnablement.java
@@ -22,7 +22,7 @@ public class BrooklynFeatureEnablement {
 
     private static final Object MUTEX = new Object();
     
-    static {
+    static void setDefaults() {
         // Idea is here one can put experimental features that are *enabled* by default,
but 
         // that can be turned off via system properties, or vice versa.
         // Typically this is useful where a feature is deemed risky!
@@ -31,6 +31,10 @@ public class BrooklynFeatureEnablement {
         setDefault(FEATURE_ENRICHER_PERSISTENCE_PROPERTY, true);
     }
     
+    static {
+        setDefaults();
+    }
+    
     public static boolean isEnabled(String property) {
         synchronized (MUTEX) {
             if (!FEATURE_ENABLEMENTS.containsKey(property)) {
@@ -72,6 +76,7 @@ public class BrooklynFeatureEnablement {
     static void clearCache() {
         synchronized (MUTEX) {
             FEATURE_ENABLEMENTS.clear();
+            setDefaults();
         }
     }
 }


Mime
View raw message