|
@@ -181,8 +181,9 @@ public class AsyncDispatcher extends AbstractService implements Dispatcher {
|
|
|
if (exitOnDispatchException
|
|
|
&& (ShutdownHookManager.get().isShutdownInProgress()) == false
|
|
|
&& stopped == false) {
|
|
|
- LOG.info("Exiting, bbye..");
|
|
|
- System.exit(-1);
|
|
|
+ Thread shutDownThread = new Thread(createShutDownThread());
|
|
|
+ shutDownThread.setName("AsyncDispatcher ShutDown handler");
|
|
|
+ shutDownThread.start();
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -271,4 +272,14 @@ public class AsyncDispatcher extends AbstractService implements Dispatcher {
|
|
|
}
|
|
|
|
|
|
}
|
|
|
+
|
|
|
+ Runnable createShutDownThread() {
|
|
|
+ return new Runnable() {
|
|
|
+ @Override
|
|
|
+ public void run() {
|
|
|
+ LOG.info("Exiting, bbye..");
|
|
|
+ System.exit(-1);
|
|
|
+ }
|
|
|
+ };
|
|
|
+ }
|
|
|
}
|