孙哥Spring源码第18集

第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。

相关推荐
anOnion4 小时前
构建无障碍组件之Menu Button pattern
前端·html·交互设计
用户47949283569154 小时前
claude Fable用不了?把Gpt 5.5pro接到你的claude code里
前端·后端
zhangxingchao7 小时前
Kotlin常用的Flow 操作符整理
前端
IT_陈寒8 小时前
React的useState居然还有这种坑?我差点删库跑路
前端·人工智能·后端
nanxun8869 小时前
记一次诡异的 Docker 容器"串包"故障排查
java
Pedantic9 小时前
SwiftUI 手势笔记
前端·后端
橙子家10 小时前
浏览器缓存之【结构化数据库与缓存】: IndexedDB、Cache storage 和 Storage buckets
前端
user205855615181310 小时前
X6 中边悬浮置顶,规避 `mouseleave` 事件丢失问题
前端
李明卫杭州10 小时前
CSS aspect-ratio 属性完全指南
前端