SpringBoot循环依赖源码流程解析
2021-07-21 22:53:38 0 举报
循环依赖必要流程
作者其他创作
大纲/内容
DefaultListableBeanFactory.instantiateBean
DefaultListableBeanFactory.doCreateBean
是否是cycleA
1.这里getBean仅有可能是CycleA或CycleB2.如果是CycleA说明是第二次调用getBean3.如果是CycleB说明是第一次getBean
Y
如果是CycleB第一次getBean
AnnotationConfigServletWebServerApplicationContext.finishBeanFactoryInitialization
ObjenesisCglibAopProxy.createProxyClassAndInstance
是否是AnnotationAwareAspectJAutoProxyCreator
DependencyDescriptor.resolveCandidate
DefaultListableBeanFactory.getSingleton(String beanName)
DefaultListableBeanFactory.getEarlyBeanReference
DefaultListableBeanFactory.preInstantiateSingletons
AnnotationAwareAspectJAutoProxyCreator.createProxy
DefaultListableBeanFactory.invokeInitMethods
是否是InstantiationAwareBeanPostProcessor的子类
SpringApplication.refreshContext
AutowiredAnnotationBeanPostProcessor.postProcessProperties
getBean是CycleA
CglibSubclassingInstantiationStrategy.instantiate
N
DefaultListableBeanFactory.doGetBean
Field.set
END
DefaultListableBeanFactory.getBean
AnnotationAwareAspectJAutoProxyCreator.getEarlyBeanReference
轮询BeanPostProcessors
CycleA第二次调用
AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject
是否是CycleB
DefaultListableBeanFactory.applyBeanPostProcessorsBeforeInitialization
CycleB第二次调用
DefaultListableBeanFactory.populateBean
是否是AutowiredAnnotationBeanPostProcessor
InjectionMetadata.inject
DefaultAopProxyFactory.createAopProxy
DefaultListableBeanFactory.afterSingletonCreation
DefaultListableBeanFactory.getObject
DefaultListableBeanFactory.createBeanInstance
AnnotationAwareAspectJAutoProxyCreator.wrapIfNecessary
DefaultListableBeanFactory.initializeBean
SpringObjenesis.newInstance
是否是SmartInstantiationAwareBeanPostProcessor的子类
轮询beanDefinitionNames
DefaultListableBeanFactory.createBean
AnnotationAwareAspectJAutoProxyCreator.getProxy
AnnotationAwareAspectJAutoProxyCreator.postProcessAfterInitialization
DefaultListableBeanFactory.applyBeanPostProcessorsAfterInitialization
DefaultListableBeanFactory.resolveDependency
DefaultListableBeanFactory.doResolveDependency
DefaultListableBeanFactory.addSingleton
SpringApplication.run
singletonsCurrentlyInCreation.remove
CycleA/CycleB首次调用
DefaultListableBeanFactory.invokeAwareMethods
AnnotationConfigServletWebServerApplicationContext.refresh
span style=\"font-weight: normal;\
SpringApplication.refresh
ObjenesisCglibAopProxy.getProxy
singletonsCurrentlyInCreation.add
BeanUtils.instantiateClass
DefaultListableBeanFactory.beforeSingletonCreation
收藏
0 条评论
下一页