brooklyn-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sjcorb...@apache.org
Subject [08/12] git commit: Catalog: Set id of items added from classpath to typename
Date Tue, 30 Sep 2014 09:35:57 GMT
Catalog: Set id of items added from classpath to typename

Keeps backwards compatability


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

Branch: refs/heads/master
Commit: f560142c4a7d5416c00ef91b096a686436cefd5a
Parents: dd93c2e
Author: Sam Corbett <sam.corbett@cloudsoftcorp.com>
Authored: Mon Sep 29 16:29:35 2014 +0100
Committer: Sam Corbett <sam.corbett@cloudsoftcorp.com>
Committed: Mon Sep 29 16:29:35 2014 +0100

----------------------------------------------------------------------
 .../main/java/brooklyn/catalog/internal/CatalogClasspathDo.java | 5 +++++
 1 file changed, 5 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/f560142c/core/src/main/java/brooklyn/catalog/internal/CatalogClasspathDo.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/brooklyn/catalog/internal/CatalogClasspathDo.java b/core/src/main/java/brooklyn/catalog/internal/CatalogClasspathDo.java
index c4ac825..4ecca28 100644
--- a/core/src/main/java/brooklyn/catalog/internal/CatalogClasspathDo.java
+++ b/core/src/main/java/brooklyn/catalog/internal/CatalogClasspathDo.java
@@ -22,6 +22,7 @@ import java.lang.reflect.Modifier;
 import java.net.MalformedURLException;
 import java.net.URL;
 import java.util.Arrays;
+import java.util.Map;
 import java.util.Set;
 
 import javax.annotation.Nullable;
@@ -38,7 +39,9 @@ import brooklyn.entity.basic.ApplicationBuilder;
 import brooklyn.entity.proxying.ImplementedBy;
 import brooklyn.management.internal.ManagementContextInternal;
 import brooklyn.policy.Policy;
+import brooklyn.util.collections.MutableMap;
 import brooklyn.util.exceptions.Exceptions;
+import brooklyn.util.flags.FlagUtils;
 import brooklyn.util.javalang.AggregateClassLoader;
 import brooklyn.util.javalang.ReflectionScanner;
 import brooklyn.util.javalang.UrlClassLoader;
@@ -241,6 +244,8 @@ public class CatalogClasspathDo {
     @Deprecated
     public CatalogItem<?,?> addCatalogEntry(CatalogItemDtoAbstract<?,?> item,
Class<?> c) {
         Catalog annotations = c.getAnnotation(Catalog.class);
+        Map<String, Object> flags = MutableMap.<String, Object>of("id", c.getName());
+        FlagUtils.setFieldsFromFlags(flags, item);
         item.registeredType = c.getName();
         item.javaType = c.getName();
         item.name = firstNonEmpty(c.getSimpleName(), c.getName());


Mime
View raw message