源码的本地编译
BeanFactory与FactoryBean的区别
ConfigurationClassPostProcessor:解析配置类
扫描器
从class ——> bean Definition ——-> bean
AbstractApplicationContext#refresh
核心方法
- prepareRefresh()
- _ConfigurableListableBeanFactory _beanFactory = obtainFreshBeanFactory()
- prepareBeanFactory(beanFactory);
- postProcessBeanFactory(beanFactory);
invokeBeanFactoryPostProcessors(beanFactory);
工厂的后置处理器 ,重要去实例化创建 BeanFactoryPosetPreocesson的
registerBeanPostProcessors(beanFactory);
- initMessageSource();
- initApplicationEventMulticaster();
- onRefresh();
- registerListeners();
- finishBeanFactoryInitialization(beanFactory);
实例化 beanDefinition里的所有bean
去生产业务代码中的bean
- finishRefresh();;
- destroyBeans();
doCreditBean
creditBeanInstance去实例化
1:反射
2:工程
spring源码思维导图
https://www.processon.com/view/link/5f5075c763768959e2d109df#map