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

    https://github.com/apache/incubator-brooklyn/pull/35#discussion_r14502877
  
    --- Diff: 
core/src/main/java/brooklyn/entity/rebind/BasicEntityRebindSupport.java ---
    @@ -98,6 +96,32 @@ public void reconstruct(RebindContext rebindContext, 
EntityMemento memento) {
             ((AbstractEntity)entity).rebind();
         }
         
    +    @Override
    +    public void addPolicies(RebindContext rebindContext, EntityMemento 
memento) {
    +        for (String policyId : memento.getPolicies()) {
    +            AbstractPolicy policy = (AbstractPolicy) 
rebindContext.getPolicy(policyId);
    +            if (policy != null) {
    +                entity.addPolicy(policy);
    +            } else {
    +                LOG.warn("Policy not found; discarding policy {} of entity 
{}({})",
    +                        new Object[] {policyId, memento.getType(), 
memento.getId()});
    +            }
    +        }
    +    }
    +    
    +    @Override
    +    public void addEnrichers(RebindContext rebindContext, EntityMemento 
memento) {
    +        for (String enricherId : memento.getEnrichers()) {
    +            AbstractEnricher enricher = (AbstractEnricher) 
rebindContext.getEnricher(enricherId);
    +            if (enricher != null) {
    +                entity.addEnricher(enricher);
    --- End diff --
    
    as with `addPolicies`, after #34 need to 
`rebindContext.getExceptionHandler().onAddEnricherFailed(entity, enricher, e);`


---
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