@Override
    public void destroy() {
        if (LOGGER.isInfoEnabled()) {
            LOGGER.info("Destroy registry:" + getNode());
        }
        Set<Node> destroyRegistered = new HashSet<Node>(getRegistered());
        if (!destroyRegistered.isEmpty()) {
            for (Node node : new HashSet<Node>(getRegistered())) {
                try {
                    unregister(node);
                    if (LOGGER.isInfoEnabled()) {
                        LOGGER.info("Destroy unregister node " + node);
                    }
                } catch (Throwable t) {
                    LOGGER.warn("Failed to unregister node " + node + " to registry " + getNode() + " on destroy, cause: " + t.getMessage(), t);
                }
            }
        }
        Map<Node, Set<NotifyListener>> destroySubscribed = new HashMap<Node, Set<NotifyListener>>(getSubscribed());
        if (!destroySubscribed.isEmpty()) {
            for (Map.Entry<Node, Set<NotifyListener>> entry : destroySubscribed.entrySet()) {
                Node node = entry.getKey();
                for (NotifyListener listener : entry.getValue()) {
                    try {
                        unsubscribe(node, listener);
                        if (LOGGER.isInfoEnabled()) {
                            LOGGER.info("Destroy unsubscribe node " + node);
                        }
                    } catch (Throwable t) {
                        LOGGER.warn("Failed to unsubscribe node " + node + " to registry " + getNode() + " on destroy, cause: " + t.getMessage(), t);
                    }
                }
            }
        }
    }
@author Robert HG (254963746@qq.com) on 5/17/15.
lts-core/src/main/java/com/github/ltsopensource/core/registry/AbstractRegistry.java