[
https://issues.apache.org/jira/browse/BROOKLYN-14?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14051210#comment-14051210
]
ASF GitHub Bot commented on BROOKLYN-14:
----------------------------------------
Github user ahgittin commented on a diff in the pull request:
https://github.com/apache/incubator-brooklyn/pull/35#discussion_r14503156
--- Diff: core/src/main/java/brooklyn/entity/rebind/RebindManagerImpl.java
---
@@ -385,7 +396,35 @@ public ChangeListener getChangeListener() {
}
}
}
+
+ //
+ // PHASE THREE
+ //
+
+ // Associate policies+enrichers with entities
+ LOG.debug("RebindManager reconstructing entities");
+ for (EntityMemento entityMemento :
sortParentFirst(memento.getEntityMementos()).values()) {
+ Entity entity =
rebindContext.getEntity(entityMemento.getId());
+ if (LOG.isDebugEnabled()) LOG.debug("RebindManager
reconstructing entity {}", entityMemento);
+
+ if (entity == null) {
+ // usually because of creation-failure, when not using
fail-fast
+
exceptionHandler.onEntityNotFound(entityMemento.getId());
+ } else {
+ try {
+ entityMemento.injectTypeClass(entity.getClass());
--- End diff --
this call sticks out a little bit, but i can imagine why it's needed, we're
doing more with the memento now whereas previously we just threw it away
> Persist+rebind policies and enrichers
> -------------------------------------
>
> Key: BROOKLYN-14
> URL: https://issues.apache.org/jira/browse/BROOKLYN-14
> Project: Brooklyn
> Issue Type: New Feature
> Reporter: Aled Sage
> Fix For: 0.7.0
>
>
> Currently in Brooklyn, rebinding policies+enrichers is supported but is off
> by default - see BrooklynFeatureEnablement [1]. This is because not all
> policies/enrichers/entities have been reviewed to ensure they will work with
> policies being persisted and added on Brooklyn restart (or on brooklyn
> standby node taking over).
> I propose that we change this to persist policies+enrichers. However, we can
> also improve the RebindExceptionHandler [2] to allow behaviour on policy
> rebind to set - defaulting to continue on errors.
> I also want to add a PersistenceExceptionHandler to be called when there are
> errors persisting entities/policies.
> [1]
> https://github.com/apache/incubator-brooklyn/blob/master/core/src/main/java/brooklyn/internal/BrooklynFeatureEnablement.java
> [2]
> https://github.com/apache/incubator-brooklyn/blob/master/api/src/main/java/brooklyn/entity/rebind/RebindExceptionHandler.java
--
This message was sent by Atlassian JIRA
(v6.2#6252)