brooklyn.entity.rebind
Interface RebindSupport<T extends Memento>


public interface RebindSupport<T extends Memento>

Supporter instance for behaviour related to rebinding a given entity/location/policy. For example, the brooklyn framework may call entity.getRebindSupport().getMemento() and persist this using a BrooklynMementoPersister. Later (e.g. after a brooklyn restart) a new entity instance may be created and populated by the framework calling entity.getRebindSupport().reconstruct(rebindContext, memento).


Method Summary
 T getMemento()
          Creates a memento representing this entity's current state.
 void reconstruct(RebindContext rebindContext, T memento)
          Reconstructs this entity, given a memento of its state.
 

Method Detail

getMemento

T getMemento()
Creates a memento representing this entity's current state. This is useful for when restarting brooklyn.


reconstruct

void reconstruct(RebindContext rebindContext,
                 T memento)
Reconstructs this entity, given a memento of its state. Sets the internal state (including id and config keys), and sets the parent/children/locations of this entity. Implementations should be very careful to not invoke or inspect these other entities/locations, as they may also be being reconstructed at this time. Called before rebind.



Copyright © 2013. All Rights Reserved.