public interface LeaderSelectorListener extends ConnectionStateListener
LeaderSelector
Modifier and Type | Method and Description |
---|---|
void |
takeLeadership(CuratorFramework client)
Called when your instance has been granted leadership.
|
doNotProxy, stateChanged
void takeLeadership(CuratorFramework client) throws Exception
It is guaranteed that there is no concurrent executions of this method.
It is guaranteed that this method will be interrupted if
ConnectionStateListener.stateChanged(CuratorFramework, ConnectionState)
throws CancelLeadershipException
. After interrupted, this
method should exit(either return or throw) promptly, otherwise it
will block following elections.
client
- the clientException
- any errorsCopyright © 2011–2023 The Apache Software Foundation. All rights reserved.