Github user aledsage commented on a diff in the pull request:

    https://github.com/apache/incubator-brooklyn/pull/124#discussion_r16549657
  
    --- Diff: 
core/src/main/java/brooklyn/catalog/internal/BasicBrooklynCatalog.java ---
    @@ -176,27 +179,12 @@ public void load() {
                 
             if (yaml!=null) {
                 DeploymentPlan plan = makePlanFromYaml(yaml);
    -            CampPlatform camp = 
BrooklynServerConfig.getCampPlatform(mgmt).get();
    -            
    -            // TODO should not register new AT each time we instantiate 
from the same plan; use some kind of cache
    -            AssemblyTemplate at;
    -            BrooklynClassLoadingContext loader = 
loadedItem.newClassLoadingContext(mgmt);
    -            BrooklynLoaderTracker.setLoader(loader);
    -            try {
    -                at = camp.pdp().registerDeploymentPlan(plan);
    -            } finally {
    -                BrooklynLoaderTracker.unsetLoader(loader);
    +            switch (item.getCatalogItemType()) {
    +                case ENTITY:return createEntitySpec(loadedItem, plan);
    +                case POLICY:return createPolicySpec(loadedItem, plan);
    +                default: throw new RuntimeException("Only entity & policy 
catalog items are supported.");
    --- End diff --
    
    Would be good to say in exception message what type was passed in.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to