Spring源碼學習--Configuration類配置bean的解析以及初始化所涉及的類

原创
2019/07/05 18:18
阅读数 45
XmlBeanFactory
XmlBeanDefinitionReader
DefaultBeanDefinitionDocumentReader
BeanDefinitionParserDelegate


AbstractBeanFactory
extends 
AbstractAutowireCapableBeanFactory
extends
DefaultListableBeanFactory


AnnotationConfigEmbeddedWebApplicationContext  refresh
AnnotationConfigApplicationContext  -> AnnotatedBeanDefinitionReader
-> DefaultListableBeanFactory


ConfigurationClassParser

AnnotationConfigApplicationContext(AnnotatedClasses)
Register(annotatedClasses){
AnnotatedBeanDefinitionReader.register(annotatedClasses)
}
refresh() {
invokeBeanFactoryPostProcessors(DefaultListableBeanFactory)
PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors
ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(DefaultListableBeanFactory)
ConfigurationClassParser.parse(AnnotatedBeanDefinition)
ConfigurationClassParser.retrieveBeanMethodMetadata()
ConfigurationClassBeanDefinitionReader.loadBeanDefinitions(anntatedClasses)
ConfigurationClassBeanDefinitionReader.loadBeanDefinitionsForBeanMethod()
} 
beanFactory.preInstantiateSingletons

AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod()

 

展开阅读全文
打赏
0
0 收藏
分享
打赏
0 评论
0 收藏
0
分享
返回顶部
顶部