spring 5源码分析_王政_20180414
2018-04-14 23:33:34 0 举报
spring 类加载过程
作者其他创作
大纲/内容
6.registerBeanPostProcessors(beanFactory)
7. destroy() bean销毁
6.postProcessAfterInitialization bean初始化之后调用
9大组件
preProcessXml
AbstractApplicationContext
instantiateBean
registerBeanDefinition
doLoadDocument
注册
doRegisterBeanDefinitions(root)
doRegisterBeanDefinitions
processBeanDefinition
BeanDefinitionParserDelegate
9.onRefresh()
loadBeanDefinitions(beanDefinitionReader)
super(parent)
7.initMessageSource()
AbstractAutowireCapableBeanFactory
Spring mvc
refresh()
loadBeanDefinitions(beanFactory)
11.finishBeanFactoryInitialization(beanFactory)
2.postProcessAfterInstantiation目标对象实例化之后调用,这个时候对象已经被实例化,但是该实例的属性还未被设置
refreshBeanFactory
ClassPathXmlApplicationContext
parseBeanDefinitions
5.invokeBeanFactoryPostProcessors(beanFactory)
HttpServletBean
InitializingBean
2.obtainFreshBeanFactory();
AbstractXmlApplicationContext
resolveValueIfNecessary
BeanWrapperImpl
Spring扩展接口InstantiationAwareBeanPostProcessor解析参考:https://blog.csdn.net/u010634066/article/details/80321854
BeanDefinitionValueResolver
定位
DefaultListableBeanFactory
返回创建好的beanFactory对象
DefaultBeanDefinitionDocumentReader
createBeanInstance
parseQualifierElements
10.registerListeners()
8.initApplicationEventMulticaster()
5. afterPropertiesSet
applyPropertyValues
BeanPostProcessor
InstantiationAwareBeanPostProcessor
doLoadBeanDefinitions
ApplicationContext
setPropertyValues
setConfigLocations(configLocations)
getBean
加载
DispatcherServlet
AbstractRefreshableApplicationContext
4.postProcessBeanFactory(beanFactory)
BeanDefinitionReaderUtils
postProcessXml
AbstractPropertyAccessor
this.beanDefinitionNames.add(beanName)
文本
parseBeanDefinitionAttributes
AbstractBeanFactory
4.postProcessBeforeInitialization 类初始化之前调用
this.manualSingletonNames.remove(beanName)
createBeanFactory
XmlBeanDefinitionReader
1.prepareRefresh()
3.prepareBeanFactory()
DisposableBean
12.finishRefresh()
doCreateBean
parsePropertyElements
initBeanDefinitionReader(beanDefinitionReader)
populateBean
SimpleInstantiationStrategy
3.postProcessPropertyValues方法对属性值进行修改(这个时候属性值还未被设置,但是我们可以修改原本该设置进去的属性值)
registerBeanDefinitions
1.postProcessBeforeInstantiation 目标对象实例化之前调用
createBeanDefinition
parseBeanDefinitionElement
FrameworkServlet
0 条评论
下一页