Service service = (Service) executor;
service.stop();
}
else if (executor instanceof PooledExecutor) {
PooledExecutor pe = (PooledExecutor) executor;
pe.shutdownAfterProcessingCurrentlyQueuedTasks();
//pe.shutdownNow();
pe.awaitTerminationAfterShutdown();
}
else if (executor != null) {
log.warn("Don't know how to cleanly close down the given executor: " + executor