Class BootstrapApplicationListener

  • All Implemented Interfaces:
    EventListener, org.springframework.context.ApplicationListener<org.springframework.boot.context.event.ApplicationEnvironmentPreparedEvent>, org.springframework.core.Ordered

    public class BootstrapApplicationListener
    extends Object
    implements org.springframework.context.ApplicationListener<org.springframework.boot.context.event.ApplicationEnvironmentPreparedEvent>, org.springframework.core.Ordered
    A listener that prepares a SpringApplication (e.g. populating its Environment) by delegating to ApplicationContextInitializer beans in a separate bootstrap context. The bootstrap context is a SpringApplication created from sources defined in spring.factories as BootstrapConfiguration, and initialized with external config taken from "bootstrap.properties" (or yml), instead of the normal "application.properties".
    Author:
    Dave Syer
    • Field Detail

      • BOOTSTRAP_PROPERTY_SOURCE_NAME

        public static final String BOOTSTRAP_PROPERTY_SOURCE_NAME
        Property source name for bootstrap.
        See Also:
        Constant Field Values
      • DEFAULT_ORDER

        public static final int DEFAULT_ORDER
        The default order for this listener.
        See Also:
        Constant Field Values
      • DEFAULT_PROPERTIES

        public static final String DEFAULT_PROPERTIES
        The name of the default properties.
        See Also:
        Constant Field Values
    • Constructor Detail

      • BootstrapApplicationListener

        public BootstrapApplicationListener()
    • Method Detail

      • onApplicationEvent

        public void onApplicationEvent​(org.springframework.boot.context.event.ApplicationEnvironmentPreparedEvent event)
        Specified by:
        onApplicationEvent in interface org.springframework.context.ApplicationListener<org.springframework.boot.context.event.ApplicationEnvironmentPreparedEvent>
      • getOrder

        public int getOrder()
        Specified by:
        getOrder in interface org.springframework.core.Ordered
      • setOrder

        public void setOrder​(int order)