mirror of
https://github.com/tiennm99/zfoo.git
synced 2026-10-11 12:29:03 +00:00
style[code]: code style
This commit is contained in:
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;
|
||||
|
||||
Reference in new issue
Block a user