第18集 refresh()-invokeBeanFactoryPostProcessor-二-ConfigurationClassPostProcessor的处理逻辑
【视频来源于:B站up主孙帅suns Spring源码视频】【微信号:suns45】
1、为什么@PropertySource先处理?
因为@Conponent A在处理的过程中 要把A的属性进行填充,先 处理@PropertySource属性的值就得到保证。
2、为什么@Component还要有@Service、@Controller、@Repository?
语义化
3、ComponentScan会扫描那些类?
@Component【@Service、@Controller、@Repository】
@Configuration【非ApplicationContext启动时候,非AppConfig类的@Configuration】
并且处理了@Component上面的@Lazy @Primary @DependOn等等注解。
4、invokeBeanFactoryPostProcessor的处理过程
5、AppCofig中@Comfiguration的解析过程
A:解析内部类@Component的处理

B:处理配置文件@PropertyResource


C:@ComponentScan解析分析

D:处理@Import

E:所有的处理过程

6、processImports-importSelector的处理过程

7、总结第18集
1、ConfigurationClassPostProcessor的处理过程,先处理自动配置,然后处理@PropertySource,接着处理@ComponentScan会处理@Configuration和@Component会进行注册成为BeanDefinition 这里需要注意@Configuration并非第一个AppConfig的@Configuration,接着就是处理三种@Import。