springboot启动原理
2021-11-14 11:26:13 2 举报
springboot如何启动spring容器
作者其他创作
大纲/内容
factory.getWebServer(getSelfInitializer())
prepareEnvironment
ServletRegistrationBean.addRegistration
DynamicRegistrationBean.register
beans.onStartup(servletContext)
AnnotationConfigServletWebServerApplicationContext
new SpringApplication(primarySources)
registration.addMapping(urlMapping)
ApplicationContextInitializer
TomcatServletWebServerFactory.getWebServer
RegistrationBean.onStartup
ServletWebServerApplicationContext.refresh
getTomcatWebServer(tomcat)
refreshContext
onRefresh
createApplicationContext()
SpringApplication.run
prepareContext
tomcat.getServer().await()
bindToSpringApplication(environment)
startDaemonAwaitThread()
ServletRegistrationBean.configure
ApplicationListener
回调
getSelfInitializer()
this.annotatedReader.register(source)
getSpringFactoriesInstances
tomcat.start()
load(Class<?> source)
Tomcat tomcat = new Tomcat();
加载META-INF/spring.factories里的配置类
收藏
0 条评论
下一页