亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

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

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

我已經(jīng)很精簡(jiǎn)了,兩篇(Spring Boot啟動(dòng)過程(一)、spring Boot啟動(dòng)過程(二))依然沒寫完,接著來。

  refreshContext之后的方法是afterRefresh,這名字起的真...好。afterRefresh方法內(nèi)只調(diào)用了callRunners一個(gè)方法,這個(gè)方法從上下文中獲取了所有的ApplicationRunner和CommandLineRunner接口的實(shí)現(xiàn)類,并執(zhí)行這些實(shí)現(xiàn)類的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)實(shí)際上是在exception為null的情況下發(fā)布了ApplicationReadyEvent事件。

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

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

   最后返回個(gè)context,run方法就到此結(jié)束了。

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

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

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

相關(guān)文章

最新評(píng)論