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 2015/03/13 10:50:00 UTC

[1/2] incubator-brooklyn git commit: Fix AbstractEntity.config()

Repository: incubator-brooklyn
Updated Branches:
  refs/heads/master e8e0fced3 -> ba5dece6a


Fix AbstractEntity.config()

- When return type of config() was changed to BasicConfigurationSupport,
  it broke any entity impls that tried to call config().set(...) etc
- Solution is to change BasicConfigurationSupport to be protected
  rather than private, and mark as @Beta because we’ll change it
  back to private at some point.

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

Branch: refs/heads/master
Commit: 6d548e9a9722de1a7adcefbb3b9ae1365b33c728
Parents: e8e0fce
Author: Aled Sage <al...@gmail.com>
Authored: Fri Mar 13 09:47:11 2015 +0000
Committer: Aled Sage <al...@gmail.com>
Committed: Fri Mar 13 09:47:11 2015 +0000

----------------------------------------------------------------------
 .../src/main/java/brooklyn/entity/basic/AbstractEntity.java | 9 ++++++++-
 .../test/java/brooklyn/entity/basic/EntityConfigTest.java   | 9 +++++++++
 2 files changed, 17 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/6d548e9a/core/src/main/java/brooklyn/entity/basic/AbstractEntity.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/brooklyn/entity/basic/AbstractEntity.java b/core/src/main/java/brooklyn/entity/basic/AbstractEntity.java
index 8c90065..27311a1 100644
--- a/core/src/main/java/brooklyn/entity/basic/AbstractEntity.java
+++ b/core/src/main/java/brooklyn/entity/basic/AbstractEntity.java
@@ -970,7 +970,14 @@ public abstract class AbstractEntity extends AbstractBrooklynObject implements E
         return config;
     }
 
-    private class BasicConfigurationSupport implements ConfigurationSupportInternal {
+    /**
+     * Direct use of this class is strongly discouraged. It will become private in a future release,
+     * once {@link #config()} is reverted to return {@link ConfigurationSupportInternal} instead of
+     * {@link BasicConfigurationSupport}.
+     */
+    @Beta
+    // TODO revert to private when config() is reverted to return ConfigurationSupportInternal
+    protected class BasicConfigurationSupport implements ConfigurationSupportInternal {
 
         @Override
         public <T> T get(ConfigKey<T> key) {

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/6d548e9a/core/src/test/java/brooklyn/entity/basic/EntityConfigTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/brooklyn/entity/basic/EntityConfigTest.java b/core/src/test/java/brooklyn/entity/basic/EntityConfigTest.java
index da27c61..c941af6 100644
--- a/core/src/test/java/brooklyn/entity/basic/EntityConfigTest.java
+++ b/core/src/test/java/brooklyn/entity/basic/EntityConfigTest.java
@@ -155,6 +155,15 @@ public class EntityConfigTest {
 
         @SetFromFlag("myconfigflagname")
         public static final ConfigKey<String> MY_CONFIG_WITH_FLAGNAME = ConfigKeys.newStringConfigKey("myentity.myconfigwithflagname");
+        
+        @Override
+        public void init() {
+            super.init();
+            
+            // Just calling this to prove we can! When config() was changed to return BasicConfigurationSupport,
+            // it broke because BasicConfigurationSupport was private.
+            config().getLocalBag();
+        }
     }
     
     public static class MyChildEntity extends AbstractEntity {


[2/2] incubator-brooklyn git commit: This closes #550

Posted by he...@apache.org.
This closes #550


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

Branch: refs/heads/master
Commit: ba5dece6a26ad7f45b9fe86485b93f9e8ab0f4be
Parents: e8e0fce 6d548e9
Author: Alex Heneveld <al...@cloudsoftcorp.com>
Authored: Fri Mar 13 09:49:54 2015 +0000
Committer: Alex Heneveld <al...@cloudsoftcorp.com>
Committed: Fri Mar 13 09:49:54 2015 +0000

----------------------------------------------------------------------
 .../src/main/java/brooklyn/entity/basic/AbstractEntity.java | 9 ++++++++-
 .../test/java/brooklyn/entity/basic/EntityConfigTest.java   | 9 +++++++++
 2 files changed, 17 insertions(+), 1 deletion(-)
----------------------------------------------------------------------