类 EventPublishingRunListener
- java.lang.Object
- org.springframework.boot.context.event.EventPublishingRunListener
- 所有已实现的接口:
SpringApplicationRunListener
,org.springframework.core.Ordered
public class EventPublishingRunListener extends Object implements SpringApplicationRunListener, org.springframework.core.Ordered
SpringApplicationRunListener
to publishSpringApplicationEvent
s.Uses an internal
ApplicationEventMulticaster
for the events that are fired before the context is actually refreshed.
构造器概要
构造器 构造器 说明 EventPublishingRunListener(SpringApplication application, String[] args)
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 void
contextLoaded(org.springframework.context.ConfigurableApplicationContext context)
Called once the application context has been loaded but before it has been refreshed.void
contextPrepared(org.springframework.context.ConfigurableApplicationContext context)
Called once theApplicationContext
has been created and prepared, but before sources have been loaded.void
environmentPrepared(org.springframework.core.env.ConfigurableEnvironment environment)
Called once the environment has been prepared, but before theApplicationContext
has been created.void
failed(org.springframework.context.ConfigurableApplicationContext context, Throwable exception)
Called when a failure occurs when running the application.int
getOrder()
void
running(org.springframework.context.ConfigurableApplicationContext context)
Called immediately before the run method finishes, when the application context has been refreshed and allCommandLineRunners
andApplicationRunners
have been called.void
started(org.springframework.context.ConfigurableApplicationContext context)
The context has been refreshed and the application has started butCommandLineRunners
andApplicationRunners
have not been called.void
starting()
Called immediately when the run method has first started.
构造器详细资料
EventPublishingRunListener
public EventPublishingRunListener(SpringApplication application, String[] args)
方法详细资料
getOrder
public int getOrder()
- 指定者:
getOrder
在接口中org.springframework.core.Ordered
starting
public void starting()
从接口复制的说明:SpringApplicationRunListener
Called immediately when the run method has first started. Can be used for very early initialization.- 指定者:
starting
在接口中SpringApplicationRunListener
environmentPrepared
public void environmentPrepared(org.springframework.core.env.ConfigurableEnvironment environment)
从接口复制的说明:SpringApplicationRunListener
Called once the environment has been prepared, but before theApplicationContext
has been created.- 指定者:
environmentPrepared
在接口中SpringApplicationRunListener
- 参数:
environment
- the environment
contextPrepared
public void contextPrepared(org.springframework.context.ConfigurableApplicationContext context)
从接口复制的说明:SpringApplicationRunListener
Called once theApplicationContext
has been created and prepared, but before sources have been loaded.- 指定者:
contextPrepared
在接口中SpringApplicationRunListener
- 参数:
context
- the application context
contextLoaded
public void contextLoaded(org.springframework.context.ConfigurableApplicationContext context)
从接口复制的说明:SpringApplicationRunListener
Called once the application context has been loaded but before it has been refreshed.- 指定者:
contextLoaded
在接口中SpringApplicationRunListener
- 参数:
context
- the application context
started
public void started(org.springframework.context.ConfigurableApplicationContext context)
从接口复制的说明:SpringApplicationRunListener
The context has been refreshed and the application has started butCommandLineRunners
andApplicationRunners
have not been called.- 指定者:
started
在接口中SpringApplicationRunListener
- 参数:
context
- the application context.
running
public void running(org.springframework.context.ConfigurableApplicationContext context)
从接口复制的说明:SpringApplicationRunListener
Called immediately before the run method finishes, when the application context has been refreshed and allCommandLineRunners
andApplicationRunners
have been called.- 指定者:
running
在接口中SpringApplicationRunListener
- 参数:
context
- the application context.
failed
public void failed(org.springframework.context.ConfigurableApplicationContext context, Throwable exception)
从接口复制的说明:SpringApplicationRunListener
Called when a failure occurs when running the application.- 指定者:
failed
在接口中SpringApplicationRunListener
- 参数:
context
- the application context ornull
if a failure occurred before the context was createdexception
- the failure