public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
            super.readExternal(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;
            }
        }
Surrogate for sessions of external components hosted in some remote cluster node.

@author Gaston Dombiak
xmppserver/src/main/java/org/jivesoftware/openfire/session/RemoteComponentSession.java