Code example for EventBus

Methods: unregister

0
      // Sends current state directly to listener when subscribing to sync up. 
      eventBus.post(new InstancerStateChange(state, state, self));
   } 
 
   public void unsubscribe(Object observer) { 
      eventBus.unregister(observer);
   } 
 
   protected void setState(Instancer.State state) {
      InstancerStateChange change = new InstancerStateChange(this.state, state, self);
      this.state = state;
      eventBus.post(change);
   } 
}