public void stop() {
        try {
            // Send the close stream header to all connected connections
            for (RoutableChannelHandler route : routes.values()) {
                if (route instanceof LocalSession) {
                    LocalSession session = (LocalSession) route;
                    try {
                        // Notify connected client that the server is being shut down
                        if (session.getConnection() != null) { // Can occur if a session is 'detached'.
                            session.getConnection().systemShutdown();
                        }
                    }
                    catch (Throwable t) {
                        Log.debug("A throwable was thrown while trying to send the close stream header to a session.", t);
                    }
                }
            }
        }
        catch (Exception e) {
            Log.debug("An exception was thrown while trying to send the close stream header to a session.", e);
        }
    }
Removes a route of a local {@link RoutableChannelHandler}

@param pair DomainPair associated to the route.
xmppserver/src/main/java/org/jivesoftware/openfire/spi/LocalRoutingTable.java