in curator-framework/src/main/java/org/apache/curator/framework/imps/CuratorFrameworkImpl.java [289:334]
public void start() {
log.info("Starting");
if (!state.compareAndSet(CuratorFrameworkState.LATENT, CuratorFrameworkState.STARTED)) {
throw new IllegalStateException("Cannot be started more than once");
}
try {
connectionStateManager.start(); // ordering dependency - must be called before client.start()
final ConnectionStateListener listener = new ConnectionStateListener() {
@Override
public void stateChanged(CuratorFramework client, ConnectionState newState) {
if (ConnectionState.CONNECTED == newState || ConnectionState.RECONNECTED == newState) {
logAsErrorConnectionErrors.set(true);
}
}
@Override
public boolean doNotProxy() {
return true;
}
};
this.getConnectionStateListenable().addListener(listener);
client.start();
executorService = Executors.newSingleThreadScheduledExecutor(threadFactory);
executorService.submit(new Callable<Object>() {
@Override
public Object call() throws Exception {
backgroundOperationsLoop();
return null;
}
});
if (ensembleTracker != null) {
ensembleTracker.start();
}
log.info(schemaSet.toDocumentation());
} catch (Exception e) {
ThreadUtils.checkInterrupted(e);
handleBackgroundOperationException(null, e);
}
}