brooklyn-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From henev...@apache.org
Subject [06/45] git commit: Note problem with BrooklynAssemblyTemplateInstantiator catalog path
Date Fri, 04 Jul 2014 09:50:48 GMT
Note problem with BrooklynAssemblyTemplateInstantiator catalog path


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

Branch: refs/heads/master
Commit: 76ff185a0675ae916c053470609480d987a16128
Parents: edcaee4
Author: Sam Corbett <sam.corbett@cloudsoftcorp.com>
Authored: Mon Jun 30 17:24:33 2014 +0100
Committer: Sam Corbett <sam.corbett@cloudsoftcorp.com>
Committed: Tue Jul 1 13:37:37 2014 +0100

----------------------------------------------------------------------
 .../BrooklynAssemblyTemplateInstantiator.java      | 17 ++++-------------
 1 file changed, 4 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/76ff185a/usage/camp/src/main/java/io/brooklyn/camp/brooklyn/spi/creation/BrooklynAssemblyTemplateInstantiator.java
----------------------------------------------------------------------
diff --git a/usage/camp/src/main/java/io/brooklyn/camp/brooklyn/spi/creation/BrooklynAssemblyTemplateInstantiator.java
b/usage/camp/src/main/java/io/brooklyn/camp/brooklyn/spi/creation/BrooklynAssemblyTemplateInstantiator.java
index a06d716..05d6efb 100644
--- a/usage/camp/src/main/java/io/brooklyn/camp/brooklyn/spi/creation/BrooklynAssemblyTemplateInstantiator.java
+++ b/usage/camp/src/main/java/io/brooklyn/camp/brooklyn/spi/creation/BrooklynAssemblyTemplateInstantiator.java
@@ -1,7 +1,6 @@
 package io.brooklyn.camp.brooklyn.spi.creation;
 
 import io.brooklyn.camp.CampPlatform;
-import io.brooklyn.camp.brooklyn.BrooklynCampPlatform;
 import io.brooklyn.camp.brooklyn.spi.platform.HasBrooklynManagementContext;
 import io.brooklyn.camp.spi.Assembly;
 import io.brooklyn.camp.spi.AssemblyTemplate;
@@ -63,20 +62,12 @@ public class BrooklynAssemblyTemplateInstantiator implements AssemblyTemplateIns
         
         ManagementContext mgmt = getBrooklynManagementContext(platform);
         BrooklynCatalog catalog = mgmt.getCatalog();
+        // TODO: item is always null because template.id is a random String, so
+        // createApplicationFromCatalog branch below is never taken.  If `id'
+        // key is given in blueprint it is available with:
+        // Object customId = template.getCustomAttributes().get("id");
         CatalogItem<?> item = catalog.getCatalogItem(template.getId());
 
-        if (item == null) {
-            // This doesn't seem the most appropriate way to do this!
-            // Especially since YAML will only reach here if a services section was given
(so that
-            // PdpProcessor calls into BrooklynEntityMatcher [via applyMatchers] which sets
the
-            // instantiator to BrooklynAssemblyTemplateInstantiator). So services must be
given
-            // but will be disregarded.
-            Object customId = template.getCustomAttributes().get("id");
-            if (customId != null) {
-                item = catalog.getCatalogItem(customId.toString());
-            }
-        }
-
         if (item==null) {
             return createApplicationFromNonCatalogCampTemplate(template, platform);
         } else {


Mime
View raw message