【spring】EnvironmentPostProcessor在启动前对spring进行配置

DEMO

https://blog.csdn.net/xiejiefeng333/article/details/84106684

 

EnvironmentPostProcessor接口官网说明

官方文档如下

Allows for customization of the application's {@link Environment} prior to the application context being refreshed.
允许定制应用的上下文的应用环境优于应用的上下文之前被刷新。

EnvironmentPostProcessor implementations have to be registered in
META-INF/spring.factories, using the fully qualified name of this class as the key.
使用方式是实现类要在META-INF/spring.factories文件中去注册全类名。

EnvironmentPostProcessor processors are encouraged to detect whether Spring's
org.springframework.core.Ordered Ordered interface has been implemented or if the @org.springframework.core.annotation.Order Order annotation is present and to sort instances accordingly if so prior to invocation.
鼓励EnvironmentPostProcessor处理器检测Org.springframework.core.Ordered注解,这样相应的实例也会按照@Order注解的顺序去被调用。

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值