public class LeaderInitiator extends ObjectSE implements SmartLifecycle
candidates。構築時に、start() を呼び出して、リーダー選出の候補者を登録する必要があります。| 修飾子と型 | クラスと説明 |
|---|---|
protected class | LeaderInitiator.LeaderListener キュレーターのリーダー選出リスナーの実装。 |
DEFAULT_PHASE| コンストラクターと説明 |
|---|
LeaderInitiator(org.apache.curator.framework.CuratorFramework client, Candidate candidate)LeaderInitiator を作成します。 |
LeaderInitiator(org.apache.curator.framework.CuratorFramework client, Candidate candidate, StringSE namespace)LeaderInitiator を作成します。 |
| 修飾子と型 | メソッドと説明 |
|---|---|
Context | getContext() イニシエーターのコンテキスト。 |
int | getPhase() |
boolean | isAutoStartup() |
boolean | isRunning() |
void | setAutoStartup(boolean autoStartup) |
void | setLeaderEventPublisher(LeaderEventPublisher leaderEventPublisher)LeaderEventPublisher を設定します。 |
void | setPhase(int phase) |
void | start() リーダー選出のための candidate の登録を開始します。 |
void | stop() リーダー選出のための candidate の登録を停止します。 |
cloneSE, equalsSE, finalizeSE, getClassSE, hashCodeSE, notifySE, notifyAllSE, toStringSE, waitSE, waitSE, waitSEstoppublic LeaderInitiator(org.apache.curator.framework.CuratorFramework client,
Candidate candidate)LeaderInitiator を作成します。client - キュレータークライアント candidate - リーダー選出候補 public LeaderInitiator(org.apache.curator.framework.CuratorFramework client,
Candidate candidate,
StringSE namespace)LeaderInitiator を作成します。client - キュレータークライアント candidate - リーダー選出候補 namespace - ZooKeeper の名前空間ベースパス public boolean isRunning()
public int getPhase()
Phased 内の getPhase SmartLifecycle 内の getPhase public void setPhase(int phase)
phase - フェーズ SmartLifecyclepublic boolean isAutoStartup()
SmartLifecycle 内の isAutoStartup public void setAutoStartup(boolean autoStartup)
autoStartup - 自動的に開始する場合は trueSmartLifecyclepublic void stop()
candidate の登録を停止します。候補者が現在リーダーである場合、そのリーダーシップは取り消されます。public void setLeaderEventPublisher(LeaderEventPublisher leaderEventPublisher)
LeaderEventPublisher を設定します。leaderEventPublisher - イベント発行者 public Context getContext()