brooklyn-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sjcorb...@apache.org
Subject [2/7] incubator-brooklyn git commit: DslExternal obtains mgmt context without requiring an in-scope entity.
Date Mon, 19 Oct 2015 09:46:51 GMT
DslExternal obtains mgmt context without requiring an in-scope entity.


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

Branch: refs/heads/master
Commit: b0ae1e38fd055aa489403c11b54afb1f70b9cde5
Parents: 492788d
Author: Alasdair Hodge <github@alasdairhodge.co.uk>
Authored: Fri Oct 9 14:31:08 2015 +0100
Committer: Alasdair Hodge <github@alasdairhodge.co.uk>
Committed: Mon Oct 19 08:51:15 2015 +0100

----------------------------------------------------------------------
 .../camp/brooklyn/spi/dsl/methods/BrooklynDslCommon.java    | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/b0ae1e38/usage/camp/src/main/java/org/apache/brooklyn/camp/brooklyn/spi/dsl/methods/BrooklynDslCommon.java
----------------------------------------------------------------------
diff --git a/usage/camp/src/main/java/org/apache/brooklyn/camp/brooklyn/spi/dsl/methods/BrooklynDslCommon.java
b/usage/camp/src/main/java/org/apache/brooklyn/camp/brooklyn/spi/dsl/methods/BrooklynDslCommon.java
index 92dc14e..8cdcb76 100644
--- a/usage/camp/src/main/java/org/apache/brooklyn/camp/brooklyn/spi/dsl/methods/BrooklynDslCommon.java
+++ b/usage/camp/src/main/java/org/apache/brooklyn/camp/brooklyn/spi/dsl/methods/BrooklynDslCommon.java
@@ -35,8 +35,9 @@ import org.apache.brooklyn.camp.brooklyn.spi.creation.EntitySpecConfiguration;
 import org.apache.brooklyn.camp.brooklyn.spi.dsl.BrooklynDslDeferredSupplier;
 import org.apache.brooklyn.camp.brooklyn.spi.dsl.DslUtils;
 import org.apache.brooklyn.camp.brooklyn.spi.dsl.methods.DslComponent.Scope;
+import org.apache.brooklyn.core.config.external.ExternalConfigSupplier;
 import org.apache.brooklyn.core.entity.EntityDynamicType;
-import org.apache.brooklyn.core.entity.EntityInternal;
+import org.apache.brooklyn.core.mgmt.internal.ExternalConfigSupplierRegistry;
 import org.apache.brooklyn.core.mgmt.internal.ManagementContextInternal;
 import org.apache.brooklyn.core.mgmt.persist.DeserializingClassRenamesProvider;
 import org.apache.brooklyn.core.sensor.DependentConfiguration;
@@ -48,7 +49,6 @@ import org.apache.brooklyn.util.core.flags.TypeCoercions;
 import org.apache.brooklyn.util.core.task.DeferredSupplier;
 import org.apache.brooklyn.util.core.task.Tasks;
 import org.apache.brooklyn.util.exceptions.Exceptions;
-import org.apache.brooklyn.util.guava.Maybe;
 import org.apache.brooklyn.util.javalang.Reflections;
 import org.apache.brooklyn.util.text.StringEscapes.JavaStringEscapes;
 import org.apache.brooklyn.util.text.Strings;
@@ -328,13 +328,12 @@ public class BrooklynDslCommon {
         @Override
         public Task<Object> newTask() {
             return Tasks.<Object>builder()
-                .name("resolving external configuration: '" + key + "' from provider '" +
providerName + "'")
+                .displayName("resolving external configuration: '" + key + "' from provider
'" + providerName + "'")
                 .dynamic(false)
                 .body(new Callable<Object>() {
                     @Override
                     public Object call() throws Exception {
-                        EntityInternal entity = (EntityInternal) BrooklynDslDeferredSupplier.entity();
-                        ManagementContextInternal managementContext = (ManagementContextInternal)
entity.getManagementContext();
+                        ManagementContextInternal managementContext = DslExternal.managementContext();
                         return managementContext.getExternalConfigProviderRegistry().getConfig(providerName,
key);
                     }
                 })


Mime
View raw message