- ApplicationEnvironmentPreparedListener
- ApplicationFailedListener
- ApplicationPreparedListener
- ApplicationReadyListener
- ApplicationStartingListener
- SpringApplicationListener
springboot支持的时间类型:
ApplicationStartingEvent:springboot框架开始启动的事件。
ApplicationStartedEvent:springboot框架启动完成,context和bean都已创建完毕。
ApplicationEnvironmentPreparedEvent:springboot框架环境准备完毕,context还没有创建完成,bean也没有完成创建。
ApplicationPreparedEvent:springboot框架启动,context创建完,bean没有创建。
ApplicationFailedEvent:springboot框架启动失败。
CommandLineRunner在Starting与ready之间执行的事件
ApplicationReadyListener整个走完之后执行