接口 SpringApplicationRunListener

    • 方法概要

      所有方法 实例方法 抽象方法 
      修饰符和类型方法说明
      voidcontextLoaded​(org.springframework.context.ConfigurableApplicationContext context)
      Called once the application context has been loaded but before it has been refreshed.
      voidcontextPrepared​(org.springframework.context.ConfigurableApplicationContext context)
      Called once the ApplicationContext has been created and prepared, but before sources have been loaded.
      voidenvironmentPrepared​(org.springframework.core.env.ConfigurableEnvironment environment)
      Called once the environment has been prepared, but before the ApplicationContext has been created.
      voidfailed​(org.springframework.context.ConfigurableApplicationContext context, Throwable exception)
      Called when a failure occurs when running the application.
      voidrunning​(org.springframework.context.ConfigurableApplicationContext context)
      Called immediately before the run method finishes, when the application context has been refreshed and all CommandLineRunners and ApplicationRunners have been called.
      voidstarted​(org.springframework.context.ConfigurableApplicationContext context)
      The context has been refreshed and the application has started but CommandLineRunners and ApplicationRunners have not been called.
      voidstarting()
      Called immediately when the run method has first started.
    • 方法详细资料

      • starting

        void starting()
        Called immediately when the run method has first started. Can be used for very early initialization.
      • environmentPrepared

        void environmentPrepared​(org.springframework.core.env.ConfigurableEnvironment environment)
        Called once the environment has been prepared, but before the ApplicationContext has been created.
        参数:
        environment - the environment
      • contextPrepared

        void contextPrepared​(org.springframework.context.ConfigurableApplicationContext context)
        Called once the ApplicationContext has been created and prepared, but before sources have been loaded.
        参数:
        context - the application context
      • contextLoaded

        void contextLoaded​(org.springframework.context.ConfigurableApplicationContext context)
        Called once the application context has been loaded but before it has been refreshed.
        参数:
        context - the application context
      • started

        void started​(org.springframework.context.ConfigurableApplicationContext context)
        The context has been refreshed and the application has started but CommandLineRunners and ApplicationRunners have not been called.
        参数:
        context - the application context.
        从以下版本开始:
        2.0.0
      • running

        void running​(org.springframework.context.ConfigurableApplicationContext context)
        Called immediately before the run method finishes, when the application context has been refreshed and all CommandLineRunners and ApplicationRunners have been called.
        参数:
        context - the application context.
        从以下版本开始:
        2.0.0
      • failed

        void failed​(org.springframework.context.ConfigurableApplicationContext context,
                    Throwable exception)
        Called when a failure occurs when running the application.
        参数:
        context - the application context or null if a failure occurred before the context was created
        exception - the failure
        从以下版本开始:
        2.0.0