zoukankan      html  css  js  c++  java
  • spring boot event 加载顺序

    Application events are sent in the following order, as your application runs:

    An ApplicationStartingEvent is sent at the start of a run but before any processing, except for the registration of listeners and initializers.
    
    An ApplicationEnvironmentPreparedEvent is sent when the Environment to be used in the context is known but before the context is created.
    
    An ApplicationContextInitializedEvent is sent when the ApplicationContext is prepared and ApplicationContextInitializers have been called but before any bean definitions are loaded.
    
    An ApplicationPreparedEvent is sent just before the refresh is started but after bean definitions have been loaded.
    
    An ApplicationStartedEvent is sent after the context has been refreshed but before any application and command-line runners have been called.
    
    An AvailabilityChangeEvent is sent right after with LivenessState.CORRECT to indicate that the application is considered as live.
    
    An ApplicationReadyEvent is sent after any application and command-line runners have been called.
    
    An AvailabilityChangeEvent is sent right after with ReadinessState.ACCEPTING_TRAFFIC to indicate that the application is ready to service requests.
    
    An ApplicationFailedEvent is sent if there is an exception on startup.
    

    The above list only includes SpringApplicationEvents that are tied to a SpringApplication. In addition to these, the following events are also published after ApplicationPreparedEvent and before ApplicationStartedEvent:

    A WebServerInitializedEvent is sent after the WebServer is ready. ServletWebServerInitializedEvent and ReactiveWebServerInitializedEvent are the servlet and reactive variants respectively.
    
    A ContextRefreshedEvent is sent when an ApplicationContext is refreshed.
    
    喜欢关注一下,不喜欢点评一下
  • 相关阅读:
    Yii2的相关学习记录,后台模板和gii(三)
    Yii2的相关学习记录,初始化Yii2(二)
    Yii2的相关学习记录,下载Yii2(一)
    虚拟机上网总结
    纯Java实现微信朋友圈分享图
    【集合框架】JDK1.8源码分析之ArrayList详解(一)
    Java中字符串相加和字符串常量相加区别
    onTouchEvent中,跟随手指滑动的view出现抖动
    Android CHM文件阅读器
    CHM格式
  • 原文地址:https://www.cnblogs.com/chengmuyu/p/15269697.html
Copyright © 2011-2022 走看看