brooklyn-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rich...@apache.org
Subject [03/14] git commit: Fix BrooklynTypes.loadDefinedBrooklynType
Date Mon, 08 Sep 2014 12:39:03 GMT
Fix BrooklynTypes.loadDefinedBrooklynType


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

Branch: refs/heads/master
Commit: 0ad704d24fa415703e54ef27e62e039cb6e38080
Parents: dd7339e
Author: Aled Sage <aled.sage@gmail.com>
Authored: Wed Aug 13 13:59:56 2014 +0100
Committer: Martin Harris <github@nakomis.com>
Committed: Mon Sep 8 11:20:32 2014 +0100

----------------------------------------------------------------------
 core/src/main/java/brooklyn/basic/BrooklynTypes.java     | 11 +++++++++++
 .../brooklyn/enricher/basic/EnricherDynamicType.java     |  4 ++++
 .../java/brooklyn/policy/basic/PolicyDynamicType.java    |  4 ++++
 3 files changed, 19 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/0ad704d2/core/src/main/java/brooklyn/basic/BrooklynTypes.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/brooklyn/basic/BrooklynTypes.java b/core/src/main/java/brooklyn/basic/BrooklynTypes.java
index c2052c7..246e519 100644
--- a/core/src/main/java/brooklyn/basic/BrooklynTypes.java
+++ b/core/src/main/java/brooklyn/basic/BrooklynTypes.java
@@ -21,9 +21,14 @@ package brooklyn.basic;
 import java.util.Map;
 
 import brooklyn.config.ConfigKey;
+import brooklyn.enricher.basic.EnricherDynamicType;
 import brooklyn.entity.Entity;
 import brooklyn.entity.basic.EntityDynamicType;
 import brooklyn.event.Sensor;
+import brooklyn.location.Location;
+import brooklyn.policy.Enricher;
+import brooklyn.policy.Policy;
+import brooklyn.policy.basic.PolicyDynamicType;
 import brooklyn.util.exceptions.Exceptions;
 
 import com.google.common.collect.Maps;
@@ -84,6 +89,12 @@ public class BrooklynTypes {
         
         if (Entity.class.isAssignableFrom(brooklynClass)) {
             type = new ImmutableEntityType((Class<? extends Entity>)brooklynClass);
+        } else if (Location.class.isAssignableFrom(brooklynClass)) {
+            type = new ImmutableEntityType((Class)brooklynClass);
+        } else if (Policy.class.isAssignableFrom(brooklynClass)) {
+            type = new PolicyDynamicType((Class<? extends Policy>)brooklynClass); //
TODO immutable?
+        } else if (Enricher.class.isAssignableFrom(brooklynClass)) {
+            type = new EnricherDynamicType((Class<? extends Enricher>)brooklynClass);
// TODO immutable?
         } else {
             throw new IllegalStateException("Invalid brooklyn type "+brooklynClass);
         }

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/0ad704d2/core/src/main/java/brooklyn/enricher/basic/EnricherDynamicType.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/brooklyn/enricher/basic/EnricherDynamicType.java b/core/src/main/java/brooklyn/enricher/basic/EnricherDynamicType.java
index 9217c3d..d2c26f6 100644
--- a/core/src/main/java/brooklyn/enricher/basic/EnricherDynamicType.java
+++ b/core/src/main/java/brooklyn/enricher/basic/EnricherDynamicType.java
@@ -24,6 +24,10 @@ import brooklyn.policy.EnricherType;
 
 public class EnricherDynamicType extends BrooklynDynamicType<Enricher, AbstractEnricher>
{
 
+    public EnricherDynamicType(Class<? extends Enricher> type) {
+        super(type);
+    }
+
     public EnricherDynamicType(AbstractEnricher enricher) {
         super(enricher);
     }

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/0ad704d2/core/src/main/java/brooklyn/policy/basic/PolicyDynamicType.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/brooklyn/policy/basic/PolicyDynamicType.java b/core/src/main/java/brooklyn/policy/basic/PolicyDynamicType.java
index 6c99240..6beeda6 100644
--- a/core/src/main/java/brooklyn/policy/basic/PolicyDynamicType.java
+++ b/core/src/main/java/brooklyn/policy/basic/PolicyDynamicType.java
@@ -24,6 +24,10 @@ import brooklyn.policy.PolicyType;
 
 public class PolicyDynamicType extends BrooklynDynamicType<Policy, AbstractPolicy>
{
 
+    public PolicyDynamicType(Class<? extends Policy> type) {
+        super(type);
+    }
+    
     public PolicyDynamicType(AbstractPolicy policy) {
         super(policy);
     }


Mime
View raw message