當前位置:
首頁 >
前端技术
> javascript
>内容正文
javascript
《SpringBoot揭秘 快速构建微服务体系》读后感(三)
生活随笔
收集整理的這篇文章主要介紹了
《SpringBoot揭秘 快速构建微服务体系》读后感(三)
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
?
?
?
?
?
?
?
?
?
?
SpringApplication: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);}}?
SpringApplicationRunListener
SpringApplicationRunListener是一個只有SpringBoot應用的main方法執行過程中接收不同執行時點時間通知的監聽者
ApplicationListener
ApplicationContextInitializer
?
?
CommandLineRunner
?
轉載于:https://www.cnblogs.com/Michael2397/p/7867368.html
總結
以上是生活随笔為你收集整理的《SpringBoot揭秘 快速构建微服务体系》读后感(三)的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 工商牡丹江北水城卡[系列]普卡怎么样?基
- 下一篇: 工商牡丹新华保险卡[系列]普卡怎么样?基