public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
        recipient = (JID) ExternalizableUtil.getInstance().readSerializable(in);

        int packetType = ExternalizableUtil.getInstance().readInt(in);
        Element packetElement = (Element) ExternalizableUtil.getInstance().readSerializable(in);
        switch (packetType) {
            case 1:
                packet = new IQ(packetElement, true);
                break;
            case 2:
                packet = new Message(packetElement, true);
                break;
            case 3:
                packet = new Presence(packetElement, true);
                break;
        }
    }
Task to be executed by remote nodes to deliver the requested packet to the requested
receiver.

@author Gaston Dombiak
xmppserver/src/main/java/org/jivesoftware/openfire/cluster/RemotePacketExecution.java