brooklyn-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aleds...@apache.org
Subject [1/4] brooklyn-server git commit: Deprecate DslComponent(String)
Date Fri, 11 Nov 2016 11:56:19 GMT
Repository: brooklyn-server
Updated Branches:
  refs/heads/master 1caa48ff2 -> 9b24f7d92


Deprecate DslComponent(String)

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

Branch: refs/heads/master
Commit: d7b44596cda70566bca723f8c5f4eb290b7d14d6
Parents: 4ef4847
Author: Aled Sage <aled.sage@gmail.com>
Authored: Tue Nov 8 15:46:31 2016 +0000
Committer: Aled Sage <aled.sage@gmail.com>
Committed: Fri Nov 11 09:28:04 2016 +0000

----------------------------------------------------------------------
 .../brooklyn/camp/brooklyn/spi/dsl/methods/DslComponent.java      | 3 +++
 .../java/org/apache/brooklyn/camp/brooklyn/EntitiesYamlTest.java  | 2 +-
 .../brooklyn/test/framework/TargetableTestComponentImpl.java      | 3 ++-
 3 files changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/d7b44596/camp/camp-brooklyn/src/main/java/org/apache/brooklyn/camp/brooklyn/spi/dsl/methods/DslComponent.java
----------------------------------------------------------------------
diff --git a/camp/camp-brooklyn/src/main/java/org/apache/brooklyn/camp/brooklyn/spi/dsl/methods/DslComponent.java
b/camp/camp-brooklyn/src/main/java/org/apache/brooklyn/camp/brooklyn/spi/dsl/methods/DslComponent.java
index ddbeb72..b2f20d3 100644
--- a/camp/camp-brooklyn/src/main/java/org/apache/brooklyn/camp/brooklyn/spi/dsl/methods/DslComponent.java
+++ b/camp/camp-brooklyn/src/main/java/org/apache/brooklyn/camp/brooklyn/spi/dsl/methods/DslComponent.java
@@ -66,7 +66,10 @@ public class DslComponent extends BrooklynDslDeferredSupplier<Entity>
{
 
     /**
      * Resolve componentId in the {@link Scope#GLOBAL} scope.
+     * 
+     * @deprecated since 0.10.0; pass the {@link Scope} explicitly.
      */
+    @Deprecated
     public DslComponent(String componentId) {
         this(Scope.GLOBAL, componentId);
     }

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/d7b44596/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/EntitiesYamlTest.java
----------------------------------------------------------------------
diff --git a/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/EntitiesYamlTest.java
b/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/EntitiesYamlTest.java
index bdb331e..cf31dd7 100644
--- a/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/EntitiesYamlTest.java
+++ b/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/EntitiesYamlTest.java
@@ -423,7 +423,7 @@ public class EntitiesYamlTest extends AbstractYamlTest {
         Entity root1 = Tasks.resolving(new DslComponent(Scope.ROOT, "xxx").newTask(), Entity.class).context(app).embedResolutionInTask(true).get();
         Assert.assertEquals(root1, app);
         
-        Entity c1 = Tasks.resolving(new DslComponent("c1").newTask(), Entity.class).context(app).embedResolutionInTask(true).get();
+        Entity c1 = Tasks.resolving(new DslComponent(Scope.GLOBAL, "c1").newTask(), Entity.class).context(app).embedResolutionInTask(true).get();
         Assert.assertEquals(c1, Iterables.getOnlyElement(Entities.descendantsAndSelf(app,
EntityPredicates.displayNameEqualTo("child 1"))));
         
         Entity e1 = Tasks.resolving(new DslComponent(Scope.PARENT, "xxx").newTask(), Entity.class).context(c1).embedResolutionInTask(true).get();

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/d7b44596/test-framework/src/main/java/org/apache/brooklyn/test/framework/TargetableTestComponentImpl.java
----------------------------------------------------------------------
diff --git a/test-framework/src/main/java/org/apache/brooklyn/test/framework/TargetableTestComponentImpl.java
b/test-framework/src/main/java/org/apache/brooklyn/test/framework/TargetableTestComponentImpl.java
index cedbaa0..dfd4279 100644
--- a/test-framework/src/main/java/org/apache/brooklyn/test/framework/TargetableTestComponentImpl.java
+++ b/test-framework/src/main/java/org/apache/brooklyn/test/framework/TargetableTestComponentImpl.java
@@ -28,6 +28,7 @@ import org.apache.brooklyn.api.entity.Entity;
 import org.apache.brooklyn.api.mgmt.ExecutionContext;
 import org.apache.brooklyn.api.mgmt.Task;
 import org.apache.brooklyn.camp.brooklyn.spi.dsl.methods.DslComponent;
+import org.apache.brooklyn.camp.brooklyn.spi.dsl.methods.DslComponent.Scope;
 import org.apache.brooklyn.config.ConfigKey;
 import org.apache.brooklyn.core.entity.AbstractEntity;
 import org.apache.brooklyn.core.entity.lifecycle.Lifecycle;
@@ -95,7 +96,7 @@ public abstract class TargetableTestComponentImpl extends AbstractEntity
impleme
         }
 
         final AtomicReference<Entity> result = new AtomicReference<>();
-        final DslComponent dslComponent = new DslComponent(targetId);
+        final DslComponent dslComponent = new DslComponent(Scope.GLOBAL, targetId);
         Callable<Boolean> resolver = new Callable<Boolean>() {
             @Override public Boolean call() throws Exception {
                 Task<Entity> task = dslComponent.newTask();


Mime
View raw message