Class BootstrapApplicationListener

java.lang.Object
org.springframework.cloud.bootstrap.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 Details

    • BOOTSTRAP_PROPERTY_SOURCE_NAME

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

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

      public static final String DEFAULT_PROPERTIES
      The name of the default properties.
      See Also:
  • Constructor Details

    • BootstrapApplicationListener

      public BootstrapApplicationListener()
  • Method Details

    • 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)