public class ExampleClient extends Object implements Closeable, LeaderSelectorListener
| Constructor and Description |
|---|
ExampleClient(CuratorFramework client,
String path,
String name) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
start() |
void |
stateChanged(CuratorFramework client,
ConnectionState newState)
Called when there is a state change in the connection
|
void |
takeLeadership(CuratorFramework client)
Called when your instance has been granted leadership.
|
public 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 errorspublic void stateChanged(CuratorFramework client, ConnectionState newState)
ConnectionStateListenerstateChanged in interface ConnectionStateListenerclient - the clientnewState - the new stateCopyright © 2011–2014 The Apache Software Foundation. All rights reserved.