孙哥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。

相关推荐
共享家95271 天前
搭建 AI 聊天机器人:”我的人生我做主“
前端·javascript·css·python·pycharm·html·状态模式
惊讶的猫1 天前
探究StringBuilder和StringBuffer的线程安全问题
java·开发语言
jmxwzy1 天前
Spring全家桶
java·spring·rpc
Halo_tjn1 天前
基于封装的专项 知识点
java·前端·python·算法
Fleshy数模1 天前
从数据获取到突破限制:Python爬虫进阶实战全攻略
java·开发语言
像少年啦飞驰点、1 天前
零基础入门 Spring Boot:从“Hello World”到可上线的 Web 应用全闭环指南
java·spring boot·web开发·编程入门·后端开发
苍煜1 天前
万字详解Maven打包策略:从基础插件到多模块实战
java·maven
有来技术1 天前
Spring Boot 4 + Vue3 企业级多租户 SaaS:从共享 Schema 架构到商业化套餐设计
java·vue.js·spring boot·后端
东东5161 天前
xxx医患档案管理系统
java·spring boot·vue·毕业设计·智慧城市
一个响当当的名号1 天前
lectrue9 索引并发控制
java·开发语言·数据库