/** * Stops neighbor Operations server connections. */ public synchronized void shutdown() { if (started) { cancelWorkers(); executor.shutdown(); try { executor.awaitTermination(1, TimeUnit.SECONDS); } catch (InterruptedException ex) { LOG.error("Neighbor Connection {} error terminates ExecutorService", getId(), ex); } thrift.close(); started = false; } else { LOG.debug("Neighbor Connection {} is already stopped or was not started yet", getId()); } }