void () { synchronized (myConnections) { for (Map.Entry<UUID, Channel> entry : myConnections.entrySet()) { entry.getValue().writeAndFlush(JavacProtoUtil.toMessage(entry.getKey(), JavacProtoUtil.createShutdownRequest())); } } myChannelRegistrar.close().awaitUninterruptibly(); if (myOwnExecutor && myExecutor instanceof ExecutorService) { final ExecutorService service = (ExecutorService)myExecutor; service.shutdown(); try { service.awaitTermination(15, TimeUnit.SECONDS); } catch (InterruptedException ignored) { } } }