spring 创建bean
2023-01-09 14:28:16 0 举报
spring 创建bean流程
作者其他创作
大纲/内容
是否单例
earlySingletonObjects.get(beanName)二级缓存获取
createBeanInstance()第一步 bean实例化
getSingleton(beanName)
initializeBean()第三步 初始化
refresh()
返回bean
font color=\"#323232\
getSingleton从缓存获取bean
doCreateBean
singletonFactories.get(beanName)三级缓存获取
Container
mbd.isSingleton() true
finishBeanFactoryInitialization(beanFactory)实例化所有non-lazy-init bean
getBean(beanName)
mbd.isPrototype() true
getBean(propertyName)获取属性bean
singletonFactories.remove(beanName)移除三级缓存
singletonObjects.get(beanName)一级缓存获取
autowireByName\\autowireByType依赖注入
populateBean()第二步 填充属性
beanFactory.preInstantiateSingletons()实例化所有剩余(非懒加载)单例对象
0 条评论
下一页