public abstract class WithSerialId
extends java.lang.Object
implements java.io.Serializable
Main concept is following:
RemoteHost
See Serializable
for detailed description how methods writeReplace & readResolve works.
It is very important to know that (de)serialization never happens by itself but
always happens in context of RemoteHost
and (@link LocalHost}.
Such context is used for right resolution/transformation of objects
Modifier and Type | Field and Description |
---|---|
SerialHandle |
serialHandle
See SerialHandle class for details
|
private static long |
serialVersionUID |
Constructor and Description |
---|
WithSerialId() |
Modifier and Type | Method and Description |
---|---|
protected RemoteHandle |
createRemoteHandle(SerialHandle handle,
SerialContext host) |
SerialHandle |
getOrCreateSerialHandle()
Gets serial handle for the object
If needed new handle created and serialization host subscribed for the object handle
|
<T extends RemoteSerialized> |
getRemoteClass()
Class of remote object to be created
|
protected java.lang.Object |
writeReplace()
Replace object by handle for serialization
|
private static final long serialVersionUID
public volatile SerialHandle serialHandle
public final SerialHandle getOrCreateSerialHandle()
public <T extends RemoteSerialized> java.lang.Class<T> getRemoteClass()
protected final java.lang.Object writeReplace() throws java.io.ObjectStreamException
java.io.ObjectStreamException
- If the object cannot be serializedprotected RemoteHandle createRemoteHandle(SerialHandle handle, SerialContext host)