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 Summary
FieldsModifier and TypeFieldDescriptionstatic final StringProperty source name for bootstrap.static final intThe default order for this listener.static final StringThe name of the default properties.Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintgetOrder()voidonApplicationEvent(org.springframework.boot.context.event.ApplicationEnvironmentPreparedEvent event) voidsetOrder(int order)
-
Field Details
-
BOOTSTRAP_PROPERTY_SOURCE_NAME
Property source name for bootstrap.- See Also:
-
DEFAULT_ORDER
public static final int DEFAULT_ORDERThe default order for this listener.- See Also:
-
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:
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)
-