You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@brooklyn.apache.org by he...@apache.org on 2014/07/03 11:42:15 UTC

[5/6] git commit: Merge remote-tracking branch 'aledsage/fix/rebind-addPolicyInSeparatePhase'

Merge remote-tracking branch 'aledsage/fix/rebind-addPolicyInSeparatePhase'

Conflicts:
	core/src/main/java/brooklyn/entity/rebind/BasicEntityRebindSupport.java
        missing error catching in add{Enrichers,Policies} from #34, whereas those methods moved here.  will add back handler in next commit.


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

Branch: refs/heads/master
Commit: fdbacdfc15fe3ebe03e51e1c1dabcf70bb5d0d43
Parents: 311aed1 59ce9e8
Author: Alex Heneveld <al...@cloudsoftcorp.com>
Authored: Thu Jul 3 10:17:21 2014 +0100
Committer: Alex Heneveld <al...@cloudsoftcorp.com>
Committed: Thu Jul 3 10:17:21 2014 +0100

----------------------------------------------------------------------
 .../brooklyn/entity/rebind/RebindSupport.java   |  8 ++-
 .../rebind/BasicEnricherRebindSupport.java      | 13 ++++-
 .../entity/rebind/BasicEntityRebindSupport.java | 58 +++++++++-----------
 .../rebind/BasicLocationRebindSupport.java      | 14 ++++-
 .../entity/rebind/BasicPolicyRebindSupport.java | 14 ++++-
 .../entity/rebind/RebindManagerImpl.java        | 49 +++++++++++++++--
 .../entity/rebind/RebindLocationTest.java       |  4 +-
 .../entity/rebind/RebindPolicyTest.java         | 55 +++++++++++++++++++
 8 files changed, 168 insertions(+), 47 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/fdbacdfc/core/src/main/java/brooklyn/entity/rebind/RebindManagerImpl.java
----------------------------------------------------------------------
diff --cc core/src/main/java/brooklyn/entity/rebind/RebindManagerImpl.java
index 81c4f7b,d3928b7..f105efe
--- a/core/src/main/java/brooklyn/entity/rebind/RebindManagerImpl.java
+++ b/core/src/main/java/brooklyn/entity/rebind/RebindManagerImpl.java
@@@ -262,13 -240,15 +262,15 @@@ public class RebindManagerImpl implemen
              Map<String,Policy> policies = Maps.newLinkedHashMap();
              Map<String,Enricher> enrichers = Maps.newLinkedHashMap();
              
 -            final RebindContextImpl rebindContext = new RebindContextImpl(classLoader);
 +            final RebindContextImpl rebindContext = new RebindContextImpl(exceptionHandler, classLoader);
              LookupContext realLookupContext = new RebindContextLookupContext(managementContext, rebindContext, exceptionHandler);
              
-             // Two-phase deserialization.
-             // First we deserialize just the "manifest" to find all instances (and their types).
-             // Then we deserialize so that inter-entity references can be set.
-             //
+             // Four-phase deserialization.
+             //  1. deserialize just the "manifest" to find all instances (and their types).
+             //  2. deserialize so that inter-entity references can be set (and entity config/state is set).
+             //  3. add policies+enrichers to all the entities.
+             //  4. manage the entities
+             
              // TODO if underlying data-store is changed between first and second phase (e.g. to add an
              // entity), then second phase might try to reconstitute an entity that has not been put in
              // the rebindContext. This should not affect normal production usage, because rebind is run