.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源码#
全部评论

相关推荐

最喜欢秋天的火龙果很...:第一份工作一定要往大的去,工资低点没事。后面换工作会更好找,即使你去小公司,你也不可能不会换工作的。所以找大的去
点赞 评论 收藏
分享
03-03 19:02
已编辑
东华理工大学 Node.js
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务