default CompletableFuture<Void> deliverAsync(@Nonnull final Packet stanza) {
        try {
            return CompletableFuture.runAsync(() -> {
                try {
                    deliver(stanza);
                } catch (UnauthorizedException e) {
                    throw new CompletionException(e);
                }
            });
        } catch (Throwable t) {
            return CompletableFuture.failedFuture(t);
        }
    }
/**
Delivers the given stanza based on its recipient and sender.

Invocation of this method blocks until the deliverer finishes processing the stanza.

The deliverer defers actual routing decisions to other classes.

@param stanza the stanza to route
@return A future from which any exception thrown while processing the stanza can be obtained.
xmppserver/src/main/java/org/jivesoftware/openfire/PacketDeliverer.java