/** * Trap and log any exceptions while shutting down the supplied {@link Node}. * * @param node * the {@link Node} to shut down */ private void safelyShutdownNode(Node node) { boolean success = true; try { node.shutdown(); } catch (Exception e) { // Ignore spurious errors during shutdown. log.error("Exception thrown while shutting down node.", e); // We don't expect any more callbacks from a node that throws an exception // while shutting down. So, we unregister it immediately. unregisterNode(node); success = false; } if (success) { log.info("Shutdown successful."); } }