fix #4 gracefully shutdown all ExecutorServices

This commit is contained in:
Naoyuki Kanezawa
2014-08-16 20:04:20 +09:00
parent 46196d57dc
commit f3057dd5d3
5 changed files with 48 additions and 28 deletions

View File

@@ -65,8 +65,8 @@ public abstract class Connection {
public void stopServer() throws InterruptedException {
System.out.println("Stopping server ...");
serverProcess.destroy();
serverOutout.cancel(true);
serverError.cancel(true);
serverOutout.cancel(false);
serverError.cancel(false);
serverService.shutdown();
serverService.awaitTermination(3000, TimeUnit.MILLISECONDS);
}