Commit 291388af authored by Phillip Webb's avatar Phillip Webb

Make EventPublishingRunListener Ordered `0`

Update EventPublishingRunListener to implement Ordered and use a default
order of 0. This allows for other run listeners to be added either
before or after it.

Fixes gh-3305
parent 778e3eb0
......@@ -25,6 +25,7 @@ import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.event.ApplicationEventMulticaster;
import org.springframework.context.event.SimpleApplicationEventMulticaster;
import org.springframework.context.support.AbstractApplicationContext;
import org.springframework.core.Ordered;
import org.springframework.core.env.ConfigurableEnvironment;
/**
......@@ -32,7 +33,7 @@ import org.springframework.core.env.ConfigurableEnvironment;
*
* @author Phillip Webb
*/
public class EventPublishingRunListener implements SpringApplicationRunListener {
public class EventPublishingRunListener implements SpringApplicationRunListener, Ordered {
private final ApplicationEventMulticaster multicaster;
......@@ -49,6 +50,11 @@ public class EventPublishingRunListener implements SpringApplicationRunListener
}
}
@Override
public int getOrder() {
return 0;
}
@Override
public void started() {
publishEvent(new ApplicationStartedEvent(this.application, this.args));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment