public class EmbeddedZooKeeper
extends java.lang.Object
implements org.springframework.context.SmartLifecycle
SingleNodeApplication
の場合でも、少なくとも外部スタンドアロンサーバー(アンサンブルではない場合)が推奨されます。コンストラクターと説明 |
---|
EmbeddedZooKeeper() ランダムポートを持つ EmbeddedZooKeeper を構築します。 |
EmbeddedZooKeeper(int clientPort) 提供されたポートを使用して EmbeddedZooKeeper を構築します。 |
修飾子と型 | メソッドと説明 |
---|---|
int | getClientPort() クライアントがこの組み込みサーバーに接続するために使用するポートを返します。 |
int | getPhase() |
boolean | isAutoStartup() |
boolean | isRunning() |
void | setAutoStartup(boolean autoStartup) 自動的に起動するかどうかを指定します。 |
void | setErrorHandler(org.springframework.util.ErrorHandler errorHandler) ZooKeeper サーバースレッドから例外がスローされた場合に呼び出される ErrorHandler を提供します。 |
void | setPhase(int phase) 組み込みサーバーのライフサイクルフェーズを指定します。 |
void | start() ZooKeeper サーバーをバックグラウンドスレッドで起動します。 |
void | stop() ZooKeeper サーバーをシャットダウンします。 |
void | stop(java.lang.Runnable callback) 実行中の場合はサーバーを停止し、完了したらコールバックを呼び出します。 |
public EmbeddedZooKeeper()
public EmbeddedZooKeeper(int clientPort)
clientPort
- ZooKeeper サーバーがバインドするポート public int getClientPort()
public void setAutoStartup(boolean autoStartup)
autoStartup
- 自動的に開始するかどうか public boolean isAutoStartup()
org.springframework.context.SmartLifecycle
の isAutoStartup
public void setPhase(int phase)
phase
- ライフサイクルフェーズ public int getPhase()
org.springframework.context.Phased
の getPhase
public boolean isRunning()
org.springframework.context.Lifecycle
の isRunning
public void start()
起動時または実行時にスローされた例外を処理するために、setErrorHandler(org.springframework.util.ErrorHandler)
を介してエラーハンドラーを登録します。
org.springframework.context.Lifecycle
の start
public void stop()
org.springframework.context.Lifecycle
の stop
public void stop(java.lang.Runnable callback)
org.springframework.context.SmartLifecycle
の stop
public void setErrorHandler(org.springframework.util.ErrorHandler errorHandler)
ErrorHandler
を指定します。指定されていない場合は、エラーレベルのログのみが記録されます。errorHandler
- 呼び出される ErrorHandler