public class CoreCommonEnvironmentPostProcessor extends Object implements org.springframework.boot.env.EnvironmentPostProcessor, org.springframework.core.Ordered, org.springframework.context.event.SmartApplicationListener
Environment 中
如果需要启用这个功能,可以在某个核心 maven 依赖中,增加不同的配置文件信息;resources:core-config/*.yml,它的优先级低于项目中的 application.yml :
| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_ORDER
The default order for the processor.
|
static String |
PROPERTY_SOURCE_NAME
属性配置名字
|
| Constructor and Description |
|---|
CoreCommonEnvironmentPostProcessor() |
| Modifier and Type | Method and Description |
|---|---|
static void |
addOrReplace(org.springframework.core.env.MutablePropertySources propertySources,
Map<String,Object> map)
增加或者替换配置属性:
PROPERTY_SOURCE_NAME |
int |
getOrder() |
void |
onApplicationEvent(org.springframework.context.ApplicationEvent event) |
void |
postProcessEnvironment(org.springframework.core.env.ConfigurableEnvironment environment,
org.springframework.boot.SpringApplication application) |
boolean |
supportsEventType(Class<? extends org.springframework.context.ApplicationEvent> eventType) |
boolean |
supportsSourceType(Class<?> sourceType) |
public static final int DEFAULT_ORDER
public static final String PROPERTY_SOURCE_NAME
public void postProcessEnvironment(org.springframework.core.env.ConfigurableEnvironment environment,
org.springframework.boot.SpringApplication application)
postProcessEnvironment in interface org.springframework.boot.env.EnvironmentPostProcessorpublic static void addOrReplace(org.springframework.core.env.MutablePropertySources propertySources,
Map<String,Object> map)
PROPERTY_SOURCE_NAMEpropertySources - ConfigurableEnvironment.getPropertySources()map - 新配置的属性public boolean supportsEventType(Class<? extends org.springframework.context.ApplicationEvent> eventType)
supportsEventType in interface org.springframework.context.event.SmartApplicationListenerpublic boolean supportsSourceType(Class<?> sourceType)
supportsSourceType in interface org.springframework.context.event.SmartApplicationListenerpublic void onApplicationEvent(org.springframework.context.ApplicationEvent event)
onApplicationEvent in interface org.springframework.context.ApplicationListener<org.springframework.context.ApplicationEvent>public int getOrder()
getOrder in interface org.springframework.context.event.SmartApplicationListenergetOrder in interface org.springframework.core.OrderedCopyright © 2018–2021. All rights reserved.