【八】springboot启动源码 - finishRefresh

Last step: publish corresponding event.
【八】springboot启动源码 - finishRefresh_第1张图片

clearResourceCaches

【八】springboot启动源码 - finishRefresh_第2张图片
【八】springboot启动源码 - finishRefresh_第3张图片

initLifecycleProcessor

Initialize lifecycle processor for this context.

从IOC获取LifecycleProcessor设置到applicationContext中,如果从IOC中获取不到会创建DefaultLifecycleProcessor并注册到IOC中
【八】springboot启动源码 - finishRefresh_第4张图片

getLifecycleProcessor().onRefresh()

Propagate refresh to lifecycle processor first.

调用DefaultLifecycleProcessor的onRefresh方法
【八】springboot启动源码 - finishRefresh_第5张图片
调用DefaultLifecycleProcessor的startBeans方法
【八】springboot启动源码 - finishRefresh_第6张图片
执行WebServerStartStopLifecycle的start方法

WebServerStartStopLifecycle

推送ServletWebServerInitializedEvents事件

【八】springboot启动源码 - finishRefresh_第7张图片

publishEvent

Publish the final event.

推送ContextRefreshedEvent事件

【八】springboot启动源码 - finishRefresh_第8张图片

LiveBeansView.registerApplicationContext

将applicationContext放入LiveBeansView的Set applicationContexts
【八】springboot启动源码 - finishRefresh_第9张图片

你可能感兴趣的:(springboot源码解析,spring,boot,java,后端)