springboot启动过程图解,SpringBoot启动流程

首页 > 机动车 > 作者:YD1662023-11-09 18:32:06

springboot启动过程图解,SpringBoot启动流程(9)

springboot启动过程图解,SpringBoot启动流程(10)

这里发布了一个 ApplicationEnvironmentPreparedEvent 事件,这个事件对应的监听器 ConfigFileApplicationListener.

springboot启动过程图解,SpringBoot启动流程(11)

List<EnvironmentPostProcessor> loadPostProcessors() { // 加载一些环境处理的后置处理器 return SpringFactoriesLoader.loadFactories(EnvironmentPostProcessor.class, this.getClass().getClassLoader()); }

postProcessor.postProcessEnvironment(event.getEnvironment(), event.getSpringApplication()); 中最后会调用到加载配置文件的逻辑。

但是spring中的监听器监听不到springboot中的事件。

3:创建容器 context = this.createApplicationContext();

根据不同的类型,创建不同的容器

springboot启动过程图解,SpringBoot启动流程(12)

上一页1234下一页

栏目热文

文档排行

本站推荐

Copyright © 2018 - 2021 www.yd166.com., All Rights Reserved.