Fix zk ensemble join and start

- Now checking during a start if curator client is
  already started, if so handle join manually. Also
  trying to start client manually.
- Fixes #187
This commit is contained in:
Janne Valkealahti
2016-03-20 14:04:28 +00:00
parent 8ca21a10f2
commit 05d4cf05f1
2 changed files with 7 additions and 2 deletions

View File

@@ -197,11 +197,11 @@ public class StateMachineConfig {
}
public enum States {
S0, S1, S11, S12, S2, S21, S211, S212
S0, S1, S11, S12, S2, S21, S211, S212
}
public enum Events {
A, B, C, D, E, F, G, H, I, J, K
A, B, C, D, E, F, G, H, I, J, K
}
private static class FooAction implements Action<States, Events> {

View File

@@ -134,6 +134,11 @@ public class ZookeeperStateMachineEnsemble<S, E> extends StateMachineEnsembleObj
}
}
curatorClient.getConnectionStateListenable().addListener(connectionListener);
if (curatorClient.getState() == CuratorFrameworkState.STARTED) {
handleZkConnect();
} else {
curatorClient.start();
}
}
@Override