> 文章列表 > 【九】springboot启动源码 - refreshContext结束后

【九】springboot启动源码 - refreshContext结束后

【九】springboot启动源码 - refreshContext结束后

【九】springboot启动源码 - refreshContext结束后

afterRefresh

钩子函数,默认实现为空
【九】springboot启动源码 - refreshContext结束后
【九】springboot启动源码 - refreshContext结束后

listeners.started

【九】springboot启动源码 - refreshContext结束后
执行实现SpringApplicationRunListener的started回调
【九】springboot启动源码 - refreshContext结束后

通用处理
【九】springboot启动源码 - refreshContext结束后
this.listeners在之前已经通过SPI加载
【九】springboot启动源码 - refreshContext结束后
获取SpringApplicationRunListener的实现类
【九】springboot启动源码 - refreshContext结束后

EventPublishingRunListener

【九】springboot启动源码 - refreshContext结束后

推送ApplicationStartedEvent事件

关于事件推送机制,看第七篇文章,这里省略
【九】springboot启动源码 - refreshContext结束后
通过自定义监听器获取回调
【九】springboot启动源码 - refreshContext结束后

推送AvailabilityChangeEvent事件

【九】springboot启动源码 - refreshContext结束后
【九】springboot启动源码 - refreshContext结束后

callRunners

【九】springboot启动源码 - refreshContext结束后

ApplicationRunner回调

【九】springboot启动源码 - refreshContext结束后

CommandLineRunner回调

【九】springboot启动源码 - refreshContext结束后

listeners.ready

【九】springboot启动源码 - refreshContext结束后

EventPublishingRunListener

【九】springboot启动源码 - refreshContext结束后

推送ApplicationReadyEvent事件

【九】springboot启动源码 - refreshContext结束后

nacos相关

NacosContextRefresher在这里获取ApplicationReadyEvent的回调
【九】springboot启动源码 - refreshContext结束后