public interface LeaderSelectorListener
extends org.apache.curator.framework.state.ConnectionStateListener
LeaderSelector| Modifier and Type | Method and Description |
|---|---|
void |
takeLeadership(org.apache.curator.framework.CuratorFramework client)
Called when your instance has been granted leadership.
|
void takeLeadership(org.apache.curator.framework.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.