@Override
        public CompletableFuture<Void> onConnectionClosing(Object handback)
        {
            final ConnectionMultiplexerSession session = (ConnectionMultiplexerSession)handback;
            final String domain = session.getAddress().getDomain();

            CompletableFuture<Void> result = CompletableFuture.runAsync(() -> Log.debug("Closing multiplexer session with address {} and streamID {}.", session.getAddress(), session.getStreamID()));

            // Remove all the domains that were registered for this server session
            result = result.thenRunAsync(() -> localSessionManager.getConnnectionManagerSessions().remove(session.getAddress().toString()));

            // Remove track of the cluster node hosting the CM connection
            result = result.thenRunAsync(() -> multiplexerSessionsCache.remove(session.getAddress().toString()));

            if (getConnectionMultiplexerSessions(domain).isEmpty()) {
                // Terminate ClientSessions originated from this connection manager
                // that are still active since the connection manager has gone down
                result = result.thenRunAsync(() -> ConnectionMultiplexerManager.getInstance().multiplexerUnavailable(domain));
            }

            return result;
        }
Handle a multiplexer session that just closed.

@param handback The session that just closed
@return a Future representing pending completion of the event listener invocation.
xmppserver/src/main/java/org/jivesoftware/openfire/SessionManager.java