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
IOException
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
IOException
public void takeLeadership(CuratorFramework client) throws Exception
LeaderSelectorListener
takeLeadership
in interface LeaderSelectorListener
client
- the clientException
- any errorspublic void stateChanged(CuratorFramework client, ConnectionState newState)
ConnectionStateListener
stateChanged
in interface ConnectionStateListener
client
- the clientnewState
- the new stateCopyright © 2011–2014 The Apache Software Foundation. All rights reserved.