style[code]: code style

This commit is contained in:
godotg committed 2024-06-27 16:55:35 +08:00
1 parent aa8c321ffe
commit 9c4c8f5f1b
2 files changed
+35 -36

No files matched your search

@@ -47,6 +47,18 @@ public class EventContext implements ApplicationListener<ApplicationContextEvent
return instance.applicationContext;
}
@Override
public void onApplicationEvent(ApplicationContextEvent event) {
if (event instanceof ContextRefreshedEvent) {
// 初始化上下文
EventContext.instance = this;
instance.applicationContext = event.getApplicationContext();
} else if (event instanceof ContextClosedEvent) {
shutdown();
ThreadUtils.shutdownForkJoinPool();
}
}
private synchronized void shutdown() {
try {
var field = EventBus.class.getDeclaredField("executors");
@@ -64,18 +76,6 @@ public class EventContext implements ApplicationListener<ApplicationContextEvent
logger.info("Event shutdown gracefully.");
}
@Override
public void onApplicationEvent(ApplicationContextEvent event) {
if (event instanceof ContextRefreshedEvent) {
// 初始化上下文
EventContext.instance = this;
instance.applicationContext = event.getApplicationContext();
} else if (event instanceof ContextClosedEvent) {
shutdown();
ThreadUtils.shutdownForkJoinPool();
}
}
@Override
public int getOrder() {
return 30;