C
- アプリケーションコンテキスト型 @FunctionalInterfaceSE public interface ApplicationContextInitializer<C extends ConfigurableApplicationContext>
ConfigurableApplicationContext
を初期化してからリフレッシュするためのコールバックインターフェース。 通常、アプリケーションコンテキストのプログラムによる初期化を必要とする Web アプリケーション内で使用されます。例: コンテキストの環境に対するプロパティソースの登録またはプロファイルのアクティブ化。"contextInitializerClasses" の context-param と init-param の宣言については、それぞれ ContextLoader
および FrameworkServlet
サポートを参照してください。
ApplicationContextInitializer
プロセッサーは、Spring の Ordered
インターフェースが実装されているかどうか、@Order
アノテーションが存在するかどうかを検出し、存在する場合は呼び出し前にインスタンスをソートすることをお勧めします。
ContextLoader.customizeContext(javax.servlet.ServletContext, org.springframework.web.context.ConfigurableWebApplicationContext)
, ContextLoader.CONTEXT_INITIALIZER_CLASSES_PARAM
, FrameworkServlet.setContextInitializerClasses(java.lang.String)
, FrameworkServlet.applyInitializers(org.springframework.context.ConfigurableApplicationContext)
修飾子と型 | メソッドと説明 |
---|---|
void | initialize(C applicationContext) 指定されたアプリケーションコンテキストを初期化します。 |
void initialize(C applicationContext)
applicationContext
- 設定するアプリケーション