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

    https://github.com/apache/incubator-brooklyn/pull/506#discussion_r24325782
  
    --- Diff: core/src/main/java/brooklyn/entity/rebind/RebindManagerImpl.java 
---
    @@ -361,6 +364,38 @@ public void stop() {
             if (persistenceStoreAccess != null) 
persistenceStoreAccess.stop(true);
         }
         
    +        
    +    public void rebindPartialActive(CompoundTransformer transformer, 
Iterator<BrooklynObject> objectsToRebind) {
    +        final ClassLoader classLoader = 
    +            managementContext.getCatalog().getRootClassLoader();
    +        final RebindExceptionHandler exceptionHandler = 
    +            RebindExceptionHandlerImpl.builder()
    +                .danglingRefFailureMode(danglingRefFailureMode)
    +                
.danglingRefQuorumRequiredHealthy(danglingRefsQuorumRequiredHealthy)
    +                .rebindFailureMode(rebindFailureMode)
    +                .addPolicyFailureMode(addPolicyFailureMode)
    +                .loadPolicyFailureMode(loadPolicyFailureMode)
    +                .build();
    +        final ManagementNodeState mode = getRebindMode();
    +
    +        ActivePartialRebindIteration iteration = new 
ActivePartialRebindIteration(this, mode, classLoader, exceptionHandler,
    +            rebindActive, readOnlyRebindCount, rebindMetrics, 
persistenceStoreAccess);
    +
    +        iteration.setObjectIterator(objectsToRebind);
    +        iteration.applyTransformer(transformer);
    +        iteration.run();
    +    }
    +    
    +    public void rebindPartialActive(CompoundTransformer transformer, 
String ...objectsToRebindIds) {
    +        List<BrooklynObject> objectsToRebind = MutableList.of();
    +        for (String objectId: objectsToRebindIds) {
    +            BrooklynObject obj = managementContext.lookup(objectId);
    +            if (obj instanceof Entity) obj = Entities.deproxy((Entity)obj);
    --- End diff --
    
    Do these have to be deproxy'ed here? Callers of 
`rebindPartialActive(CompoundTransformer, Iterator<BrooklynObject>) ` probably 
wouldn't realise that they can't just pass proxy objects. Therefore I'd be 
inclined to have the deproxy'ing happen somehwere in that other 
`rebindPartialActive` method.


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