spring2

2021-01-26 13:14

阅读:666

标签:instant   register   XmlReader   factor   ebe   ble   resource   ant   object   

spring源码解析

bean的解析及注册

XmlBeanFactory.XmlBeanFactory(Resource resource,BeanFactory parentBeanFactory)

XmlBeanDefinitionReader.loadBeadDefinitions(Resource resource)

XmlBeanDefinitionReader.loadBeadDefinitions(EncodedResource encodedResource )

XmlBeanDefinitionReader.doLoadBeadDefinitions(InputSource inputSource,Resource resource)

XmlBeanDefinitionReader.registerBeanDefinitions(Document doc,Resource resource)

DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(Document doc,XmlReaderContext readerContext)

DefaultBeanDefinitionDocumentReader.doRegisterBeanDefinitions(Element root)

DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(Element root, BeanDefinitionParserDelegate delegate)

DefaultBeanDefinitionDocumentReader.parseDefaultElement(Element ele, BeanDefinitionParserDelegate delegate)

DefaultBeanDefinitionDocumentReader.processBeanDefinition(Element ele, BeanDefinitionParserDelegate delegate)

BeanDefinitionParserDelegate.parseBeanDefinitionElement(Element ele)

BeanDefinitionParserDelegate.parseBeanDefinitionElement(Element ele,@Nullable BeanDefinition ...)

BeanDefinitionParserDelegate.parseBeanDefinitionElement(Element ele,String beanName,@Nullable BeanDefinition containingBean)

创建bean对象(getBean流程)

AbstractBeanFactory.getBean(String name)

AbstractBeanFactory.doGetBean(String name,Class requiredType...)

DefaultSingletonBeanRegirstry.getSingleton(String beanName)

DefaultSingletonBeanRegirstry.getSingleton(String beanName,ObjectBeanFactory> singletonFactory)

AbstractAutowireCapableBeanFactory.createBean(String beanName,RootBeanDefinition mbd,Object args)

 

1.创建bean对象

AbstractAutowireCapableBeanFactory.doCreateBean(String beanName,RootBeanDefinition mbd,Object args)

AbstractAutowireCapableBeanFactory.createBeanInstance(String beanName,RootBeanDefinition mbd,Object args)

instantiateBean(String beanName,RootBeanDefinition mbd)

2.填充bean的属性

3.初始化bean(init方法)

 

 

 

 

 

spring2

标签:instant   register   XmlReader   factor   ebe   ble   resource   ant   object   

原文地址:https://www.cnblogs.com/BonnieWss/p/12853289.html


评论


亲,登录后才可以留言!