springboot的启动流程图_springboot运行流程

大家好,又见面了,我是你们的朋友全栈君。

文章目录

前言

研究springboot启动的整个流程。

springboot启动流程图


第一部分 new SpringApplication()


第二部分 工厂对象构建实例


第三部分 SpringApplication.run(启动此应用)


第四部分 SpringApplicationRunListener

SpringApplicationRunListener监听器,监听的就是SpringApplication对象的整个流程。

通过源码和图解对比,我们知道了其运行流程。 清楚知道4种监听器(ApplicationContextInitializer,SpringApplicationRunListener,CommandLineRunner,ApplicationRunner)的运行时机。


第五部分 banner彩蛋

知道banner的源码,我们可以自己改动输出的banner。

通过配置banner,我们切换了banner的输出。

#指定图片banner(显示不好,智能打印黑白)
spring.banner.image.location=panda.png
#指定文本banner
spring.banner.location=mybanner.txt

发布者:全栈程序员栈长,转载请注明出处:https://javaforall.cn/171552.html原文链接:https://javaforall.cn

posted @ 2022-10-09 16:39  小学生II  阅读(468)  评论(0编辑  收藏  举报