Update SpringEventOrderListener.java

pull/441/head
cheese8 3 years ago
parent 75c8875b2a
commit 85876ee13e

@ -10,7 +10,7 @@ public class SpringEventOrderListener implements ApplicationListener {
@Override @Override
public void onApplicationEvent(ApplicationEvent event) { public void onApplicationEvent(ApplicationEvent event) {
switch (event.getClass().getSimpleName()){ switch (event.getClass().getSimpleName()) {
case "ApplicationStartingEvent": case "ApplicationStartingEvent":
System.out.println("事件ApplicationStartingEvent"); System.out.println("事件ApplicationStartingEvent");
break; break;
@ -30,13 +30,13 @@ public class SpringEventOrderListener implements ApplicationListener {
System.out.println("事件ApplicationStartedEvent"); System.out.println("事件ApplicationStartedEvent");
break; break;
case "ServletWebServerInitializedEvent": case "ServletWebServerInitializedEvent":
if( event instanceof WebServerInitializedEvent){ if (event instanceof WebServerInitializedEvent) {
System.out.println("事件WebServerInitializedEvent"); System.out.println("事件WebServerInitializedEvent");
} }
if( event instanceof ServletWebServerInitializedEvent){ if (event instanceof ServletWebServerInitializedEvent) {
System.out.println("事件ServletWebServerInitializedEvent"); System.out.println("事件ServletWebServerInitializedEvent");
} }
if( event instanceof ReactiveWebServerInitializedEvent){ if (event instanceof ReactiveWebServerInitializedEvent) {
System.out.println("事件ReactiveWebServerInitializedEvent"); System.out.println("事件ReactiveWebServerInitializedEvent");
} }
break; break;

Loading…
Cancel
Save