springbean实例化-preInstantiateSingletons
2023-02-28 10:52:42 2 举报
springbean实例化入口(preInstantiateSingletons)源码流程图
作者其他创作
大纲/内容
开始preInstantiateSingletons()
遍历beanNames
获取beanDefinition名称List<String> beanNames = new ArrayList<>(this.beanDefinitionNames)
是
获取合并后的beanDefinitionRootBeanDefinition bd = getMergedLocalBeanDefinition(beanName);
否
获取实例化后的单例beanObject singletonInstance = getSingleton(beanName);
判断是否提前实例化
判断是否实现了SmartInitializingSingleton
回调SmartInitializingSingleton.afterSingletonsInstantiated()
结束
判断是否是factoryBeanisFactoryBean(beanName)
实例化工厂beanObject bean = getBean(FACTORY_BEAN_PREFIX + beanName)
实例化bean
判断beanDefinition是否满足以下条件非抽象且非懒加载单例的
0 条评论
下一页