接口 ApplicationContextInitializer<C extends ConfigurableApplicationContext>
- 类型参数:
C
- the application context type
public interface ApplicationContextInitializer<C extends ConfigurableApplicationContext>
Callback interface for initializing a SpringConfigurableApplicationContext
prior to being refreshed.Typically used within web applications that require some programmatic initialization of the application context. For example, registering property sources or activating profiles against the context's environment. See
ContextLoader
andFrameworkServlet
support for declaring a "contextInitializerClasses" context-param and init-param, respectively.ApplicationContextInitializer
processors are encouraged to detect whether Spring'sOrdered
interface has been implemented or if the @Order
annotation is present and to sort instances accordingly if so prior to invocation.- 从以下版本开始:
- 3.1
- 作者:
- Chris Beams
- 另请参阅:
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)
Initialize the given application context.
方法详细资料
initialize
void initialize(C applicationContext)
Initialize the given application context.- 参数:
applicationContext
- the application to configure