失效链接处理 |
Spring Bean创建初始化流程 PDF 下载
本站整理下载:
相关截图:
主要内容:
1、AnnotationConfigApplicationContext类AnnotationConfigApplicationContext(Class<?>... annotatedClasses)
2、进入refresh()即AbstractApplicationContext类的refresh()
3、找到finishBeanFactoryInitialization(beanFactory);
4、进入finishBeanFactoryInitialization(beanFactory)即AbstractApplicationContext类的finishBeanFactoryInitialization(ConfigurableListableBeanFactory beanFactory)
5、找到beanFactory.preInstantiateSingletons()
6、进入beanFactory.preInstantiateSingletons(),即DefaultListableBeanFactory类的preInstantiateSingletons()
7、找到getBean(beanName);
8、进入getBean(beanName),即AbstractBeanFactory类的getBean(String name)
9、进入doGetBean(name, null, null, false),即AbstractBeanFactory类的doGetBean(final String name, @Nullable final Class<T> requiredType,@Nullable final Object[] args, boolean typeCheckOnly)
10、找到return createBean(beanName, mbd, args);
11、进入createBean(beanName, mbd, args),即AbstractAutowireCapableBeanFactory类的createBean(String beanName, RootBeanDefinition mbd, @Nullable Object[] args)
12、找到Object beanInstance = doCreateBean(beanName, mbdToUse, args);
|