public void createProcess(@Nonnull final DomainPair domainPair, @Nonnull final Packet packet)
    {
        if (!packet.getFrom().getDomain().equals(domainPair.getLocal())) {
            throw new IllegalArgumentException("Packet's 'from' domain ("+packet.getFrom().getDomain()+") does not match domainPair's local ("+domainPair.getLocal()+")");
        }
        if (!packet.getTo().getDomain().equals(domainPair.getRemote())) {
            throw new IllegalArgumentException("Packet's 'to' domain ("+packet.getTo().getDomain()+") does not match domainPair's remote ("+domainPair.getRemote()+")");
        }

        final PacketsProcessor packetsProcessor = new PacketsProcessor(domainPair);
        if (packetsProcessors.putIfAbsent(domainPair, packetsProcessor) != null) {
            throw new IllegalStateException("Attempted to create a new PacketProcessor for " + domainPair + " but one already exists.");
        } else {
            Log.debug("Created new PacketProcessor for {}", domainPair);
            packetsProcessor.addPacket(packet);
            threadPool.execute(packetsProcessor);
        }
    }
Start a new process to establish a new outgoing connection, queuing the stanza that's addressed to the remote
domain for delivery after that has occurred.

Only one process can exist for any given domainPair. This method will throw an exception when it is invoked for
a DomainPair for which a process already exists.

The returned value of {@link #hasProcess(DomainPair)} can be used to determine if a process exists. The
invocations of that method and this method should be guarded by the mutex returned by {@link #getMutex(DomainPair)}
to ensure thread safety, as holding that mutex will prevent other threads from starting a new process.

@param domainPair The domainPair that describes the local and remote domain between which the stanza is to be sent
@param packet the stanza to send to the remote domain (addressing must correspond with the domainPair argument)
@throws IllegalStateException when a process already exists for this domainPair
xmppserver/src/main/java/org/jivesoftware/openfire/server/OutgoingSessionPromise.java