// member of the cluster.
h1.getMap("h").put(ensureKeyInHost(h1, m1), "m1");
h1.getMap("h").put(ensureKeyInHost(h1, m2), "m2");
final CountDownLatch latch = new CountDownLatch(2);
c1.addListenerConfig(new ListenerConfig(new LifecycleListener() {
public void stateChanged(final LifecycleEvent event) {
System.out.println(event.getState());
if (event.getState() == LifecycleState.MERGED) {
System.out.println("h1 restarted");
latch.countDown();
}
}
}));
c1.addListenerConfig(new ListenerConfig(new LifecycleListener() {
public void stateChanged(final LifecycleEvent event) {
System.out.println(event.getState());
if (event.getState() == LifecycleState.MERGED) {
System.out.println("h2 restarted");
latch.countDown();