brooklyn-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From henev...@apache.org
Subject [10/23] brooklyn-server git commit: Fixes potential rebind issues
Date Fri, 13 May 2016 09:05:20 GMT
Fixes potential rebind issues


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

Branch: refs/heads/master
Commit: a97f8f4f2aa342a0077637fef11769ef309801fb
Parents: 0ebd066
Author: Martin Harris <github@nakomis.com>
Authored: Mon May 9 10:56:46 2016 +0100
Committer: Martin Harris <github@nakomis.com>
Committed: Mon May 9 10:57:15 2016 +0100

----------------------------------------------------------------------
 .../org/apache/brooklyn/entity/group/DynamicClusterImpl.java   | 6 ++++++
 .../brooklyn/entity/group/SensorMatchingRemovalStrategy.java   | 6 ++----
 2 files changed, 8 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/a97f8f4f/core/src/main/java/org/apache/brooklyn/entity/group/DynamicClusterImpl.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/brooklyn/entity/group/DynamicClusterImpl.java b/core/src/main/java/org/apache/brooklyn/entity/group/DynamicClusterImpl.java
index 3577004..5b22e32 100644
--- a/core/src/main/java/org/apache/brooklyn/entity/group/DynamicClusterImpl.java
+++ b/core/src/main/java/org/apache/brooklyn/entity/group/DynamicClusterImpl.java
@@ -151,6 +151,12 @@ public class DynamicClusterImpl extends AbstractGroupImpl implements
DynamicClus
      */
     protected final Object mutex = new Object[0];
 
+    /** @deprecated since 0.10.0 uses DefaultRemovalStrategy instead. Maintained for rebinding
*/
+    @Deprecated
+    private static final Function<Collection<Entity>, Entity> defaultRemovalStrategy
= new Function<Collection<Entity>, Entity>() {
+        @Override public Entity apply(Collection<Entity> contenders) { return null;
}
+    };
+
     public static class DefaultRemovalStrategy extends RemovalStrategy {
         @Nullable
         @Override

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/a97f8f4f/core/src/main/java/org/apache/brooklyn/entity/group/SensorMatchingRemovalStrategy.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/brooklyn/entity/group/SensorMatchingRemovalStrategy.java
b/core/src/main/java/org/apache/brooklyn/entity/group/SensorMatchingRemovalStrategy.java
index 037da44..7d73256 100644
--- a/core/src/main/java/org/apache/brooklyn/entity/group/SensorMatchingRemovalStrategy.java
+++ b/core/src/main/java/org/apache/brooklyn/entity/group/SensorMatchingRemovalStrategy.java
@@ -28,12 +28,10 @@ import org.apache.brooklyn.api.sensor.AttributeSensor;
 import org.apache.brooklyn.config.ConfigKey;
 import org.apache.brooklyn.core.config.ConfigKeys;
 
-import com.google.common.reflect.TypeToken;
-
 public class SensorMatchingRemovalStrategy<T> extends RemovalStrategy {
-    public static final ConfigKey<AttributeSensor> SENSOR = ConfigKeys.newConfigKey(new
TypeToken<AttributeSensor>() {}, "sensor.matching.sensor");
+    public static final ConfigKey<AttributeSensor> SENSOR = ConfigKeys.newConfigKey(AttributeSensor.class,
"sensor.matching.sensor");
     // Would be nice to use ConfigKey<T>, but TypeToken<T> cannot be instantiated
at runtime
-    public static final ConfigKey<Object> DESIRED_VALUE = ConfigKeys.newConfigKey(new
TypeToken<Object>() {}, "sensor.matching.value");
+    public static final ConfigKey<Object> DESIRED_VALUE = ConfigKeys.newConfigKey(Object.class,
"sensor.matching.value");
 
     @Nullable
     @Override


Mime
View raw message