SpringBoot(1.5.6.RELEASE)源码解析
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了SpringBoot(1.5.6.RELEASE)源码解析相关的知识,希望对你有一定的参考价值。
请尊重作者劳动成果,转载请标明原文链接:http://www.cnblogs.com/dylan-java/p/7468336.html
上一篇分析了SpringApplication的run方法的一部分,接下来继续分析剩下的部分
1 public ConfigurableApplicationContext run(String... args) { 2 StopWatch stopWatch = new StopWatch(); 3 stopWatch.start(); 4 ConfigurableApplicationContext context = null; 5 FailureAnalyzers analyzers = null; 6 configureHeadlessProperty(); 7 SpringApplicationRunListeners listeners = getRunListeners(args); 8 listeners.starting(); 9 try { 10 ApplicationArguments applicationArguments = new DefaultApplicationArguments( 11 args); 12 ConfigurableEnvironment environment = prepareEnvironment(listeners, 13 applicationArguments); 14 Banner printedBanner = printBanner(environment); 15 context = createApplicationContext(); 16 analyzers = new FailureAnalyzers(context); 17 prepareContext(context, environment, listeners, applicationArguments, 18 printedBanner); 19 refreshContext(context); 20 afterRefresh(context, applicationArguments); 21 listeners.finished(context, null); 22 stopWatch.stop(); 23 if (this.logStartupInfo) { 24 new StartupInfoLogger(this.mainApplicationClass) 25 .logStarted(getApplicationLog(), stopWatch); 26 } 27 return context; 28 } 29 catch (Throwable ex) { 30 handleRunFailure(context, listeners, analyzers, ex); 31 throw new IllegalStateException(ex); 32 } 33 }
先起个头,等有时间了再继续写
以上是关于SpringBoot(1.5.6.RELEASE)源码解析的主要内容,如果未能解决你的问题,请参考以下文章