.run#prepareContext
SpringApplication#run#prepareContext
盐桦 (国家保护Ⅱ级)
2.2.9版本
postProcessApplicationContext(context);
- beanNameGenerator,自定义beanName策略 beanNameGenerator,如果有则注册到spring容器中
https://www.jianshu.com/p/e685fcbfb98f
- resourceLoader
设置自定义的resourceLoader
https://zhuanlan.zhihu.com/p/107821301
- 添加格式转换器 addConversionService
https://www.cnblogs.com/binarylei/p/10263589.html
- applyInitializers(context);
执行之前已加载的initializer
load
- createBeanDefinitionLoader
大部分是在将之前上下文中的环境参数和beanfactory等等设置到BeanDefinitionLoader中
主要通过registerAnnotationConfigProcessors()新增注册了8个processors,ConfigurationClassPostProcessor/AutowiredAnnotationBeanPostProcessor/CommonAnnotationBeanPostProcessor/EventListenerMethodProcessor/DefaultEventListenerFactory
- loader.load();
将启动类注册到spring容器中
#springboot源码#