spring源码分析(一)IOC管理Bean
2023-09-11 14:17:07 时间
通过最简单的IOC 容器来跟踪一下 IOC是怎么管理Bean的;Spring IoC容器对Bean定义资源文件的定位,载入、解析和依赖注入的分析
方法调用图:不知道用什么画比较好,凑合看吧 ,长方形是类,椭圆是执行方法,箭头 方法调用顺序
IOC加载、解析、注册
A. 使用简单IOC容器
//初始化path 和classLoader,没有传自定义加载器则给默认加载器
ClassPathResource resource = new ClassPathResource("SpringContextConfig.xml");
DefaultListableBeanFactory factory = new DefaultListableBeanFactory();
XmlBeanDefinitionReader reader = new XmlBeanDefinitionReader(factory);
reader.loadBeanDefinitions(resource);
HelloWorld helloWorld = (HelloWorld)factory.getBean("helloWorldImpl1");
helloWorld.say();
相关文章
- Spring Boot 自动配置 源码分析
- Spring源码分析refresh()第二篇
- 深入源码分析Spring boot 集成Pagehelper
- 牛皮!Spirng 我彻底拿下了:Spring 学习指南 + 实战实践 + 源码深度解析 + 架构与设计原理
- Spring 源码之AOP(十一)
- Spring源码解析(四)Spring是怎么处理BeanDefinition的?
- Spring源码解析(十)分析一个Spring循环引用失败的问题
- Spring源码分析(六)FactoryBean 接口解析
- Spring源码分析(八)Spring 所有BeanFactoryPostProcessor扩展接口
- Spring Boot 2.5.0 重新设计的spring.sql.init 配置有啥用?
- 从源码分析 Spring 基于注解的事务
- Spring源码学习笔记——Bean加载
- Spring集成Redis集群(含spring集成redis代码)
- spring框架漏洞整理(Spring Boot Actuator相关漏洞)
- Spring Cloud 系列之Hystrix、Ribbon、Feign 源码剖析(一)引子
- Spring源码分析(二)两种方案搭建基础框架
- Spring mvc Data Redis—Pub/Sub(附Web项目源码)
- spring mvc Spring Data Redis RedisTemplate [转]
- Spring Cloud Netflix Eureka client源码分析
- spring源码分析之context
- spring源码分析之spring-core asm概述
- spring源码分析之spring注解@Aspect是如何工作的?
- spring 源码分析之BeanPostProcessor
- spring security源码分析之core包
- spring源码分析之spring-web http详解
- spring beans源码解读之--BeanFactory的注册
- 曹工说Spring Boot源码(15)-- Spring从xml文件里到底得到了什么(context:load-time-weaver 完整解析)
- 曹工说Spring Boot源码(11)-- context:component-scan,你真的会用吗(这次来说说它的奇技淫巧)
- 曹工说Spring Boot源码(10)-- Spring解析xml文件,到底从中得到了什么(context:annotation-config 解析)
- Spring加载Bean的流程(源码分析)