> 文章列表 > 【八】springboot启动源码 - finishRefresh

【八】springboot启动源码 - finishRefresh

【八】springboot启动源码 - finishRefresh

Last step: publish corresponding event.
【八】springboot启动源码 - finishRefresh

clearResourceCaches

【八】springboot启动源码 - finishRefresh
【八】springboot启动源码 - finishRefresh

initLifecycleProcessor

Initialize lifecycle processor for this context.

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

getLifecycleProcessor().onRefresh()

Propagate refresh to lifecycle processor first.

调用DefaultLifecycleProcessor的onRefresh方法
【八】springboot启动源码 - finishRefresh
调用DefaultLifecycleProcessor的startBeans方法
【八】springboot启动源码 - finishRefresh
执行WebServerStartStopLifecycle的start方法

WebServerStartStopLifecycle

推送ServletWebServerInitializedEvents事件

【八】springboot启动源码 - finishRefresh

publishEvent

Publish the final event.

推送ContextRefreshedEvent事件

【八】springboot启动源码 - finishRefresh

LiveBeansView.registerApplicationContext

将applicationContext放入LiveBeansView的Set applicationContexts
【八】springboot启动源码 - finishRefresh