You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@brooklyn.apache.org by he...@apache.org on 2016/02/01 18:49:04 UTC

[18/50] brooklyn-server git commit: resolves the issue with: java: brooklyn.entity.rebind.Rebindable cannot be inherited with different arguments: and <>

resolves the issue with:
java: brooklyn.entity.rebind.Rebindable cannot be inherited with different arguments: <brooklyn.mementos.EntityMemento> and <>

This is done by dropping generics for the Rebindable, but relying on coveriant return types for getMementoSupport. Provides the same typesafety, at the price of a bit more 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/32f5433c
Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/32f5433c
Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/32f5433c

Branch: refs/heads/0.5.0
Commit: 32f5433ca6a86ae8d2fc54ac1fa7bcd014f54d74
Parents: 8df8852
Author: Peter Veentjer <al...@gmail.com>
Authored: Wed Apr 17 16:42:49 2013 +0300
Committer: Peter Veentjer <al...@gmail.com>
Committed: Wed Apr 17 16:42:49 2013 +0300

----------------------------------------------------------------------
 api/src/main/java/brooklyn/entity/Entity.java            | 6 +++++-
 api/src/main/java/brooklyn/entity/rebind/Rebindable.java | 4 ++--
 api/src/main/java/brooklyn/location/Location.java        | 6 +++++-
 api/src/main/java/brooklyn/policy/Policy.java            | 6 +++++-
 4 files changed, 17 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/32f5433c/api/src/main/java/brooklyn/entity/Entity.java
----------------------------------------------------------------------
diff --git a/api/src/main/java/brooklyn/entity/Entity.java b/api/src/main/java/brooklyn/entity/Entity.java
index b267cb9..3c555e7 100644
--- a/api/src/main/java/brooklyn/entity/Entity.java
+++ b/api/src/main/java/brooklyn/entity/Entity.java
@@ -5,6 +5,7 @@ import java.util.Collection;
 import java.util.Map;
 
 import brooklyn.config.ConfigKey;
+import brooklyn.entity.rebind.RebindSupport;
 import brooklyn.entity.rebind.Rebindable;
 import brooklyn.event.AttributeSensor;
 import brooklyn.location.Location;
@@ -27,7 +28,7 @@ import brooklyn.policy.Policy;
  * 
  * @see brooklyn.entity.basic.AbstractEntity
  */
-public interface Entity extends Serializable, Rebindable<EntityMemento> {
+public interface Entity extends Serializable, Rebindable {
     /**
      * The unique identifier for this entity.
      */
@@ -204,4 +205,7 @@ public interface Entity extends Serializable, Rebindable<EntityMemento> {
      * @return True if the policy enricher at this entity; false otherwise
      */
     boolean removeEnricher(Enricher enricher);
+
+    @Override
+    RebindSupport<EntityMemento> getRebindSupport();
 }

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/32f5433c/api/src/main/java/brooklyn/entity/rebind/Rebindable.java
----------------------------------------------------------------------
diff --git a/api/src/main/java/brooklyn/entity/rebind/Rebindable.java b/api/src/main/java/brooklyn/entity/rebind/Rebindable.java
index cd63c9f..9ffbbba 100644
--- a/api/src/main/java/brooklyn/entity/rebind/Rebindable.java
+++ b/api/src/main/java/brooklyn/entity/rebind/Rebindable.java
@@ -8,8 +8,8 @@ import brooklyn.mementos.Memento;
  * of the rebind is to reconstruct and reconnect the brooklyn objects, including
  * binding them to external resources.
  */
-public interface Rebindable<T extends Memento> {
+public interface Rebindable{
 
-    public RebindSupport<T> getRebindSupport();
+    public RebindSupport getRebindSupport();
     
 }

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/32f5433c/api/src/main/java/brooklyn/location/Location.java
----------------------------------------------------------------------
diff --git a/api/src/main/java/brooklyn/location/Location.java b/api/src/main/java/brooklyn/location/Location.java
index 2b9ae24..7cf1fb4 100644
--- a/api/src/main/java/brooklyn/location/Location.java
+++ b/api/src/main/java/brooklyn/location/Location.java
@@ -5,6 +5,7 @@ import java.util.Collection;
 import java.util.Map;
 
 import brooklyn.config.ConfigKey;
+import brooklyn.entity.rebind.RebindSupport;
 import brooklyn.entity.rebind.Rebindable;
 import brooklyn.mementos.LocationMemento;
 
@@ -16,7 +17,7 @@ import brooklyn.mementos.LocationMemento;
  * 
  * Locations may not be {@link Serializable} in subsequent releases!
  */
-public interface Location extends Serializable, Rebindable<LocationMemento> {
+public interface Location extends Serializable, Rebindable {
 
     /**
      * A unique id for this location.
@@ -106,4 +107,7 @@ public interface Location extends Serializable, Rebindable<LocationMemento> {
      */
     @Deprecated
     Object findLocationProperty(String key);
+
+    @Override
+    RebindSupport<LocationMemento> getRebindSupport();
 }

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/32f5433c/api/src/main/java/brooklyn/policy/Policy.java
----------------------------------------------------------------------
diff --git a/api/src/main/java/brooklyn/policy/Policy.java b/api/src/main/java/brooklyn/policy/Policy.java
index 5d34824..c03e3f8 100644
--- a/api/src/main/java/brooklyn/policy/Policy.java
+++ b/api/src/main/java/brooklyn/policy/Policy.java
@@ -3,6 +3,7 @@ package brooklyn.policy;
 import java.util.Map;
 
 import brooklyn.config.ConfigKey;
+import brooklyn.entity.rebind.RebindSupport;
 import brooklyn.entity.rebind.Rebindable;
 import brooklyn.mementos.PolicyMemento;
 
@@ -12,7 +13,7 @@ import com.google.common.annotations.Beta;
  * Policies implement actions and thus must be suspendable; policies should continue to evaluate their sensors
  * and indicate their desired planned action even if they aren't invoking them
  */
-public interface Policy extends EntityAdjunct, Rebindable<PolicyMemento> {
+public interface Policy extends EntityAdjunct, Rebindable{
     /**
      * A unique id for this policy.
      */
@@ -51,4 +52,7 @@ public interface Policy extends EntityAdjunct, Rebindable<PolicyMemento> {
     <T> T setConfig(ConfigKey<T> key, T val);
     
     Map<ConfigKey<?>, Object> getAllConfig();
+
+    @Override
+    RebindSupport<PolicyMemento> getRebindSupport();
 }