public class ExampleClient extends LeaderSelectorListenerAdapter implements Closeable
LeaderSelectorListenerAdapter
which
has the recommended handling for connection state issuesConstructor 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.
|
stateChanged
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 errorsCopyright © 2011–2019 The Apache Software Foundation. All rights reserved.