1.创建监控器(监控运行时间)StopWatch stopWatch = new StopWatch(); 2.创建空的IOC容器,和一组异常报告器 3.配置awt,图标配置 4.创建运行侦听器(SpringApplicationRunListeners listeners = this.getRunListeners(args);) 5.准备运行环境(DefaultApplicationArguments,默认应用程序参数) 6.配置系统参数(this.configureIgnoreBeanInfo(environment),environment,默认环境) 7.打印图标Banner(this.printBanner(environment);) 8.创建IOC容器映射(ApplicationContext) 9.初始化IOC容器(this.prepareContext(context, environment, listeners, applicationArguments, printedBanner);) 10.刷新IOC容器(this.refreshContext(context);) 11.刷新最后的处理(this.afterRefresh(context, applicationArguments);) ,停止监听器(stopWatch.stop();) 12.发布运行侦听器 (this.callRunners(context, applicationArguments);) 13.运行器回调(打印信息,提示用户spring已经启动成功),spring启动完成
spring的启动流程
最新推荐文章于 2024-06-12 13:24:28 发布