(一)Spring-boot 自动配置

来源:互联网 发布:网络充330元种苹果树 编辑:程序博客网 时间:2024/06/05 14:24

1.Spring-boot的自动化配置是通过读取/META-INF/spring.factories中的autoconfig下的Configuraion类
2.ConfiguraionClassPostProcessor后置处理器对Configuration类进行解析,扫描ComponentScan下的beanDefinition,以及@Import引用到的Configuration或者Selector或者BeanRegister直接注册。
3.@Import是由ConfigurationClassParser解析,例如调用Selector的selectImport方法,返回Configuration类的全限定名,注册到Bean的注册中心

原创粉丝点击