源码的本地编译

BeanFactory与FactoryBean的区别

ConfigurationClassPostProcessor:解析配置类

扫描器
从class ——> bean Definition ——-> bean

AbstractApplicationContext#refresh

核心方法

  1. prepareRefresh()
  2. _ConfigurableListableBeanFactory _beanFactory = obtainFreshBeanFactory()
  3. prepareBeanFactory(beanFactory);
  4. postProcessBeanFactory(beanFactory);
  5. invokeBeanFactoryPostProcessors(beanFactory);
    工厂的后置处理器 ,重要

    去实例化创建 BeanFactoryPosetPreocesson的

  6. registerBeanPostProcessors(beanFactory);

  7. initMessageSource();
  8. initApplicationEventMulticaster();
  9. onRefresh();
  10. registerListeners();
  11. finishBeanFactoryInitialization(beanFactory);
    实例化 beanDefinition里的所有bean

去生产业务代码中的bean

  1. finishRefresh();;
  2. destroyBeans();

doCreditBean

creditBeanInstance去实例化
1:反射
2:工程

spring源码思维导图
https://www.processon.com/view/link/5f5075c763768959e2d109df#map