クラス ServletWebServerInitializedEvent
java.lang.ObjectSE
java.util.EventObjectSE
org.springframework.context.ApplicationEvent
org.springframework.boot.web.context.WebServerInitializedEvent
org.springframework.boot.web.servlet.context.ServletWebServerInitializedEvent
- 実装されたすべてのインターフェース:
SerializableSE
WebServer
の準備ができた後に公開されるイベント。実行中のサーバーのローカルポートを取得できます。通常は開始されますが、リスナーは自由にサーバーをインスペクションし、必要に応じて停止および開始できます。
- 導入:
- 2.0.0
- 作成者:
- Dave Syer
- 関連事項:
フィールドサマリー
クラス java.util.EventObjectSE から継承されたフィールド
sourceSE
コンストラクターのサマリー
コンストラクターコンストラクター説明ServletWebServerInitializedEvent
(WebServer webServer, ServletWebServerApplicationContext applicationContext) 方法の概要
修飾子と型メソッド説明サーバーが作成されたアプリケーションコンテキストにアクセスします。クラス org.springframework.boot.web.context.WebServerInitializedEvent から継承されたメソッド
getSource, getWebServer
クラス org.springframework.context.ApplicationEvent から継承されたメソッド
getTimestamp
クラス java.util.EventObjectSE から継承されたメソッド
toString
コンストラクターの詳細
ServletWebServerInitializedEvent
public ServletWebServerInitializedEvent(WebServer webServer, ServletWebServerApplicationContext applicationContext)
メソッドの詳細
getApplicationContext
サーバーが作成されたアプリケーションコンテキストにアクセスします。サーバー自体に作用する前に、これが期待と一致している(現在のコンテキストと等しいなど)ことを確認するのが実用的な場合があります。- 次で指定:
- クラス
WebServerInitializedEvent
のgetApplicationContext
- 戻り値:
- サーバーが作成された applicationContext