Spring源码
2023-11-03 13:54:26 6 举报
AI智能生成
springIOC
作者其他创作
大纲/内容
this.beanFactory = new DefaultListableBeanFactory();
1.创建bean工厂的实例
internalConfigurationAnnotationProcessorConfigurationClassPostProcessor
internalEventListenerFactoryDefaultEventListenerFactory
internalEventListenerProcessorEventListenerMethodProcessor
子主题
internalAutowiredAnnotationProcessorAutowiredAnnotationBeanPostProcessor
internalCommonAnnotationProcessorCommonAnnotationBeanPostProcessor
internalRequiredAnnotationProcessorRequiredAnnotationBeanPostProcessor
AnnotationAwareOrderComparator
ContextAnnotationAutowireCandidateResolver
this.reader = new AnnotatedBeanDefinitionReader(this);
负责处理配置类
负责处理EventListener
2.注册内置的PostProcessor
this.scanner = new ClassPathBeanDefinitionScanner(this);
3.注册扫描器
register(annotatedClasses);
4.注册配置类
准备工作
监听器
invokeBeanFactoryPostProcessors
解析BeanDefinition
注册BeanPostProcessor
实例化
循环依赖
属性注入
初始化
doGetBean
getBean
preInstantiateSingletons()
finishBeanFactoryInitialization()
refresh()
Bean创建过程
spring核心IOC实现
Spring源码
0 条评论
下一页