bean生命周期
2021-11-19 16:24:46 18 举报
bean生命周期整体的调用流程图
作者其他创作
大纲/内容
InstantiationAwareBeanPostProcessor的postProcessBeforeInstantiation()
销毁bean
bp instanceof MergedBeanDefinitionPostProcessor ?调用postProcessMergedBeanDefinition()
BeanPostProcessor.postProcessBeforeInitialization()
invokeInitMethods()1、InitializingBean.afterPropertiesSet();2、invokeCustomInitMethod() 调用自定义的初始化方法,反射
结束
实例化doCreateBean > createBeanInstance()
DisposableBean.destroy()
属性赋值doCreateBean > populateBean()
开始
属性赋值(反射赋值)
invokeCustomDestroyMethod自定义的销毁方法,反射
初始化doCreateBean > initializeBean()
bp instanceof InstantiationAwareBeanPostProcessor == truepostProcessAfterInstantiation()
bp instanceof InstantiationAwareBeanPostProcesso == true ?postProcessProperties()
BeanPostProcessor.postProcessAfterInitialization()
0 条评论
下一页