码迷,mamicode.com
首页 > 编程语言 > 详细

spring boot监听器使用

时间:2018-09-25 19:36:33      阅读:130      评论:0      收藏:0      [点我收藏+]

标签:tps   开始   spring   上下文   资料   使用   event   env   started   

spring boot中支持的事件类型定在org.springframework.boot.context.event包中,目前支持的事件类型有如下6种:

技术分享图片

执行顺序:  (本人也是新手,纯属网上找一些资料,个人总结,如有错误,请指出)

1、ApplicationStartingEvent             spring boot最开始启动时触发。

2、ApplicationEnvironmentPreparedEvent     spring boot环境已经准备好,但上下文还没有创建时触发。       

3、ApplicationPreparedEvent             spring boot上下文context创建完成,但此时spring中的bean是没有完全加载完成的。

4、ApplicationStartedEvent           spring boot开始启动时触发,可以在SpringApplication启动之前做一些手脚。

5、ApplicationReadyEvent            spring boot上下文已经准备完毕的时候触发。

err、ApplicationFailedEvent             spring boot启动失败触发。

 

Spring boot学习,推荐:https://gitee.com/didispace/SpringBoot-Learning

技术分享图片

 

技术分享图片

 

spring boot监听器使用

标签:tps   开始   spring   上下文   资料   使用   event   env   started   

原文地址:https://www.cnblogs.com/mcalm/p/9701124.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!