private boolean removeComponentRoute(JID route, NodeID nodeID) {
        String address = route.getDomain();
        boolean removed = false;
        Lock lock = componentsCache.getLock(address);
        lock.lock();
        try {
            HashSet<NodeID> nodes = componentsCache.get(address);
            if (nodes != null) {
                nodes.remove(nodeID);
                if (nodes.isEmpty()) {
                    componentsCache.remove(address);
                    removed = true;
                }
                else {
                    componentsCache.put(address, nodes);
                }
            }

            if (removed || XMPPServer.getInstance().getNodeID().equals(nodeID)) {
                localComponentRoutingTable.removeRoute(new DomainPair("", address));
            }
        } finally {
            lock.unlock();
        }

        return removed;
    }
Remove local or remote component route.

@param route the route of the component to be removed.
@param nodeID The node to which the to-be-removed component was connected to.
xmppserver/src/main/java/org/jivesoftware/openfire/spi/RoutingTableImpl.java