spring-boot启动流程
2021-07-23 16:49:37 44 举报
spring-boot启动流程
作者其他创作
大纲/内容
TomcatServletWebServerFactory#getWebServer
SpringApplicationRunListeners#started
ServletWebServerApplicationContext#onRefresh
启动类
SpringApplicationRunListeners#starting
TomcatServletWebServerFactory#getTomcatWebServer
ApplicationEnvironmentPreparedEvent
SpringApplicationRunListeners#running
加载所有spring.factories中的ApplicationContextInitializer
SpringApplication#getRunListeners
往容器中添加优雅关机WebServerGracefulShutdownLifecycle
SpringApplication#afterRefresh
如需在spring Refresh前生效则需配置在spring.factories中
SpringApplication#prepareContext
ServletWebServerApplicationContext#getWebServerFactory
SpringApplication#callRunners
SpringApplicationRunListeners#environmentPrepared
发布事件
Tomcat
加载所有spring.factories中的ApplicationListener
调用spring.factories中配置的ApplicationContextInitializer
SpringApplication#run(java.lang.String...)
ServletWebServerApplicationContext#createWebServer
SpringApplication#prepareEnvironment
SpringApplication#refreshContext
setInitializers
SpringApplication#printBanner
加载配置文件,包括spring-cloud的配置文件
SpringApplication#createApplicationContext
TomcatWebServer#initialize
setListeners
加载所有spring.factories中的SpringApplicationRunListener
0 条评论
回复 删除
下一页