public class EventPublishingRunListener extends java.lang.Object implements SpringApplicationRunListener, org.springframework.core.Ordered
SpringApplicationRunListener
to publish SpringApplicationEvent
s.
Uses an internal ApplicationEventMulticaster
for the events that are fired
before the context is actually refreshed.
Constructor and Description |
---|
EventPublishingRunListener(SpringApplication application,
java.lang.String[] args) |
Modifier and Type | Method and Description |
---|---|
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 the
ApplicationContext has been created and prepared, but
before sources have been loaded. |
void |
environmentPrepared(ConfigurableBootstrapContext bootstrapContext,
org.springframework.core.env.ConfigurableEnvironment environment)
Called once the environment has been prepared, but before the
ApplicationContext has been created. |
void |
failed(org.springframework.context.ConfigurableApplicationContext context,
java.lang.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 all
CommandLineRunners and
ApplicationRunners have been called. |
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. |
void |
starting(ConfigurableBootstrapContext bootstrapContext)
Called immediately when the run method has first started.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
environmentPrepared, starting
public EventPublishingRunListener(SpringApplication application, java.lang.String[] args)
public int getOrder()
getOrder
in interface org.springframework.core.Ordered
public void starting(ConfigurableBootstrapContext bootstrapContext)
SpringApplicationRunListener
starting
in interface SpringApplicationRunListener
bootstrapContext
- the bootstrap contextpublic void environmentPrepared(ConfigurableBootstrapContext bootstrapContext, org.springframework.core.env.ConfigurableEnvironment environment)
SpringApplicationRunListener
ApplicationContext
has been created.environmentPrepared
in interface SpringApplicationRunListener
bootstrapContext
- the bootstrap contextenvironment
- the environmentpublic void contextPrepared(org.springframework.context.ConfigurableApplicationContext context)
SpringApplicationRunListener
ApplicationContext
has been created and prepared, but
before sources have been loaded.contextPrepared
in interface SpringApplicationRunListener
context
- the application contextpublic void contextLoaded(org.springframework.context.ConfigurableApplicationContext context)
SpringApplicationRunListener
contextLoaded
in interface SpringApplicationRunListener
context
- the application contextpublic void started(org.springframework.context.ConfigurableApplicationContext context)
SpringApplicationRunListener
CommandLineRunners
and ApplicationRunners
have not been called.started
in interface SpringApplicationRunListener
context
- the application context.public void running(org.springframework.context.ConfigurableApplicationContext context)
SpringApplicationRunListener
CommandLineRunners
and
ApplicationRunners
have been called.running
in interface SpringApplicationRunListener
context
- the application context.public void failed(org.springframework.context.ConfigurableApplicationContext context, java.lang.Throwable exception)
SpringApplicationRunListener
failed
in interface SpringApplicationRunListener
context
- the application context or null
if a failure occurred before
the context was createdexception
- the failure