@Override
    public void deliver(@Nonnull final Packet stanza) throws UnauthorizedException, PacketException {
        // Check if we can send the packet using another session
        if (connectionManagerDomain == null) {
            // Packet deliverer has not yet been configured so handle unprocessed packet
            handleUnprocessedPacket(stanza);
        }
        else {
            // Try getting another session to the same connection manager 
            ConnectionMultiplexerSession session =
                    multiplexerManager.getMultiplexerSession(connectionManagerDomain);
            if (session == null || session.isClosed()) {
                // No other session was found so handle unprocessed packet
                handleUnprocessedPacket(stanza);
            }
            else {
                // Send the packet using this other session to the same connection manager
                session.process(stanza);
            }
        }
    }
Fallback method used by {@link org.jivesoftware.openfire.nio.NettyConnection} when
connected to a connection manager. The fallback method will be used when a connection
fails to send a {@link Packet} (probably because the socket was closed).<p>

The first attempt will be to send the packet using another connection to the same connection
manager (since managers may have a pool of connections to the server). And if that fails then
instances of {@link Message} may be stored offline for later retrieval. Since packets may be
wrapped by special IQ packets (read the Connection Manager JEP for more information) we need
to unwrap the packet and store the wrapped packet offline.

@author Gaston Dombiak
xmppserver/src/main/java/org/jivesoftware/openfire/multiplex/MultiplexerPacketDeliverer.java