public class ExampleClient extends LeaderSelectorListenerAdapter implements Closeable
LeaderSelectorListenerAdapter which
has the recommended handling for connection state issues| Constructor and Description |
|---|
ExampleClient(CuratorFramework client,
String path,
String name) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
start() |
void |
takeLeadership(CuratorFramework client)
Called when your instance has been granted leadership.
|
stateChangedpublic ExampleClient(CuratorFramework client, String path, String name)
public void start()
throws IOException
IOExceptionpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionpublic void takeLeadership(CuratorFramework client) throws Exception
LeaderSelectorListenertakeLeadership in interface LeaderSelectorListenerclient - the clientException - any errorsCopyright © 2011–2021 The Apache Software Foundation. All rights reserved.