欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

Spring Boot啟動過程全面解析(三)

 更新時間:2017年04月22日 16:24:11   作者:draculav  
這篇文章主要介紹了Spring Boot啟動過程全面解析(三)的相關資料,需要的朋友可以參考下

我已經很精簡了,兩篇(Spring Boot啟動過程(一)spring Boot啟動過程(二))依然沒寫完,接著來。

  refreshContext之后的方法是afterRefresh,這名字起的真...好。afterRefresh方法內只調用了callRunners一個方法,這個方法從上下文中獲取了所有的ApplicationRunner和CommandLineRunner接口的實現類,并執(zhí)行這些實現類的run方法。例如Spring Batch的JobLauncherCommandLineRunner:

 @Override
 public void run(String... args) throws JobExecutionException {
  logger.info("Running default command line with: " + Arrays.asList(args));
  launchJobFromProperties(StringUtils.splitArrayElementsIntoProperties(args, "="));
 }

  listeners.finished(context, null)實際上是在exception為null的情況下發(fā)布了ApplicationReadyEvent事件。

  啟動至此就差不多了,于是停止stopWatch.stop(),然后把時間打到日志里:Started Application in ***.462 seconds (JVM running for ***.977),然后感受下這記完就扔的氣勢:         

 if (this.logStartupInfo) {
    new StartupInfoLogger(this.mainApplicationClass)
      .logStarted(getApplicationLog(), stopWatch);
   }

   最后返回個context,run方法就到此結束了。

==========================================================

咱最近用的github:https://github.com/saaavsaaa

以上所述是小編給大家介紹的Spring Boot啟動過程全面解析(三),希望對大家有所幫助,如果大家有任何疑問請給我留言,小編會及時回復大家的。在此也非常感謝大家對腳本之家網站的支持!

相關文章

最新評論