container/resource/src/main/java/org/mobicents/slee/resource/ResourceAdaptorActivityContextHandleImpl.java
@Override
	public void writeExternal(ObjectOutput out) throws IOException {
		// write ra entity name
		out.writeUTF(raEntity.getName());
		// write activity handle
		if (activityHandle.getClass() == ActivityHandleReference.class) {
			// a reference
			out.writeBoolean(true);
			final ActivityHandleReference reference = (ActivityHandleReference) activityHandle;
			out.writeObject(reference.getAddress());
			out.writeUTF(reference.getId());
		}
		else {
			out.writeBoolean(false);
			final Marshaler marshaler = raEntity.getMarshaler();
			if (marshaler != null) {
				marshaler.marshalHandle(activityHandle, out);
			}
			else {
				throw new IOException("marshaller from RA is null");
			}
		}
	}
@Override
	public void writeExternal(ObjectOutput out) throws IOException {
		// write ra entity name
		out.writeUTF(raEntity.getName());
		// write activity handle
		if (activityHandle.getClass() == ActivityHandleReference.class) {
			// a reference
			out.writeBoolean(true);
			final ActivityHandleReference reference = (ActivityHandleReference) activityHandle;
			out.writeObject(reference.getAddress());
			out.writeUTF(reference.getId());
		}
		else {
			out.writeBoolean(false);
			final Marshaler marshaler = raEntity.getMarshaler();
			if (marshaler != null) {
				marshaler.marshalHandle(activityHandle, out);
			}
			else {
				throw new IOException("marshaller from RA is null");
			}
		}
	}
/*
(non-Javadoc)
@see java.io.Externalizable#writeExternal(java.io.ObjectOutput)