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 toApplicationContextInitializerbeans in a separate bootstrap context. The bootstrap context is a SpringApplication created from sources defined in spring.factories asBootstrapConfiguration, and initialized with external config taken from "bootstrap.properties" (or yml), instead of the normal "application.properties".- Author:
- Dave Syer
-
-
Field Summary
Fields Modifier and Type Field Description static StringBOOTSTRAP_PROPERTY_SOURCE_NAMEProperty source name for bootstrap.static intDEFAULT_ORDERThe default order for this listener.static StringDEFAULT_PROPERTIESThe name of the default properties.
-
Constructor Summary
Constructors Constructor Description BootstrapApplicationListener()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetOrder()voidonApplicationEvent(org.springframework.boot.context.event.ApplicationEnvironmentPreparedEvent event)voidsetOrder(int order)
-
-
-
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
-
-
Method Detail
-
onApplicationEvent
public void onApplicationEvent(org.springframework.boot.context.event.ApplicationEnvironmentPreparedEvent event)
- Specified by:
onApplicationEventin interfaceorg.springframework.context.ApplicationListener<org.springframework.boot.context.event.ApplicationEnvironmentPreparedEvent>
-
getOrder
public int getOrder()
- Specified by:
getOrderin interfaceorg.springframework.core.Ordered
-
setOrder
public void setOrder(int order)
-
-