《SpringBoot揭秘 快速构建微服务体系》读后感(三)

 

 

 

 

 

 

 

 

 

 

SpringApplication:SpringBoot程序启动的一站式解决方案

《SpringBoot揭秘 快速构建微服务体系》读后感(三)

《SpringBoot揭秘 快速构建微服务体系》读后感(三)

《SpringBoot揭秘 快速构建微服务体系》读后感(三)

深入探索SpringApplication执行流程

因为书上的版本是1.2的,比较老,这里参考http://blog.csdn.net/zxzzxzzxz123/article/details/69941910

 

public ConfigurableApplicationContext run(String... args) {
        StopWatch stopWatch = new StopWatch();
        stopWatch.start();
        ConfigurableApplicationContext context = null;
        FailureAnalyzers analyzers = null;
        configureHeadlessProperty();
        SpringApplicationRunListeners listeners = getRunListeners(args);
        listeners.starting();
        try {
            ApplicationArguments applicationArguments = new DefaultApplicationArguments(
                    args);
            ConfigurableEnvironment environment = prepareEnvironment(listeners,
                    applicationArguments);
            Banner printedBanner = printBanner(environment);
            context = createApplicationContext();
            analyzers = new FailureAnalyzers(context);
            prepareContext(context, environment, listeners, applicationArguments,
                    printedBanner);
            refreshContext(context);
            afterRefresh(context, applicationArguments);
            listeners.finished(context, null);
            stopWatch.stop();
            if (this.logStartupInfo) {
                new StartupInfoLogger(this.mainApplicationClass)
                        .logStarted(getApplicationLog(), stopWatch);
            }
            return context;
        }
        catch (Throwable ex) {
            handleRunFailure(context, listeners, analyzers, ex);
            throw new IllegalStateException(ex);
        }
    }

 《SpringBoot揭秘 快速构建微服务体系》读后感(三)

《SpringBoot揭秘 快速构建微服务体系》读后感(三)

《SpringBoot揭秘 快速构建微服务体系》读后感(三)

《SpringBoot揭秘 快速构建微服务体系》读后感(三)

《SpringBoot揭秘 快速构建微服务体系》读后感(三)

《SpringBoot揭秘 快速构建微服务体系》读后感(三)

《SpringBoot揭秘 快速构建微服务体系》读后感(三)

SpringApplicationRunListener

SpringApplicationRunListener是一个只有SpringBoot应用的main方法执行过程中接收不同执行时点时间通知的监听者

《SpringBoot揭秘 快速构建微服务体系》读后感(三)

《SpringBoot揭秘 快速构建微服务体系》读后感(三)

《SpringBoot揭秘 快速构建微服务体系》读后感(三)

《SpringBoot揭秘 快速构建微服务体系》读后感(三)

《SpringBoot揭秘 快速构建微服务体系》读后感(三)

《SpringBoot揭秘 快速构建微服务体系》读后感(三)

ApplicationListener

《SpringBoot揭秘 快速构建微服务体系》读后感(三)

《SpringBoot揭秘 快速构建微服务体系》读后感(三)

《SpringBoot揭秘 快速构建微服务体系》读后感(三)

ApplicationContextInitializer

《SpringBoot揭秘 快速构建微服务体系》读后感(三)

 

 《SpringBoot揭秘 快速构建微服务体系》读后感(三)

《SpringBoot揭秘 快速构建微服务体系》读后感(三)

《SpringBoot揭秘 快速构建微服务体系》读后感(三)

CommandLineRunner

《SpringBoot揭秘 快速构建微服务体系》读后感(三)

 

posted on 2017-11-20 17:29 Michael2397 阅读(...) 评论(...) 编辑 收藏

相关文章:

  • 2022-01-11
  • 2021-06-30
  • 2021-07-20
  • 2021-09-12
  • 2021-04-01
  • 2021-07-08
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-01-19
  • 2021-11-12
  • 2022-01-04
  • 2021-12-29
  • 2021-05-12
  • 2022-12-23
相关资源
相似解决方案