public void writeExternal(ObjectOutput out) throws IOException {
            super.writeExternal(out);
            if (packet instanceof IQ) {
                ExternalizableUtil.getInstance().writeInt(out, 1);
            } else if (packet instanceof Message) {
                ExternalizableUtil.getInstance().writeInt(out, 2);
            } else if (packet instanceof Presence) {
                ExternalizableUtil.getInstance().writeInt(out, 3);
            }
            ExternalizableUtil.getInstance().writeSerializable(out, (DefaultElement) packet.getElement());
        }
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