Package org.springframework.context
Interface ApplicationContextInitializer<C extends ConfigurableApplicationContext>
public interface ApplicationContextInitializer<C extends ConfigurableApplicationContext>
Callback interface for initializing a SpringConfigurableApplicationContextprior 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
ContextLoaderandFrameworkServletsupport for declaring a "contextInitializerClasses" context-param and init-param, respectively.ApplicationContextInitializerprocessors are encouraged to detect whether Spring'sOrderedinterface has been implemented or if the @Orderannotation is present and to sort instances accordingly if so prior to invocation.- Since:
- 3.1
- Author:
- Chris Beams
- See Also:
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)
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidinitialize(C applicationContext)Initialize the given application context.
Method Detail
initialize
void initialize(C applicationContext)
Initialize the given application context.- Parameters:
applicationContext- the application to configure