Interface ApplicationContextInitializer<C extends ConfigurableApplicationContext>

Type Parameters:
C - the application context type
All Known Subinterfaces:
AotApplicationContextInitializer<C>
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface ApplicationContextInitializer<C extends ConfigurableApplicationContext>
Callback interface for initializing a Spring ConfigurableApplicationContext 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 and FrameworkServlet support for declaring a "contextInitializerClasses" context-param and init-param, respectively.

ApplicationContextInitializer processors are encouraged to detect whether Spring's Ordered interface has been implemented or if the @Order annotation is present and to sort instances accordingly if so prior to invocation.

Since:
3.1
Author:
Chris Beams
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    initialize(C applicationContext)
    Initialize the given application context.
  • Method Details

    • initialize

      void initialize(C applicationContext)
      Initialize the given application context.
      Parameters:
      applicationContext - the application context to bootstrap