public interface ISharedObjectMessageSerializer
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
deserializeMessage(byte[] data)
Deserialize a byte array into an object message.
|
byte[] |
serializeMessage(ID sharedObjectID,
java.lang.Object message)
Serialize an object to byte array.
|
byte[] serializeMessage(ID sharedObjectID, java.lang.Object message) throws java.io.IOException
Serialize an object to byte array. This method will be called every time a shared object message is sent from one shared object instance to its replica.
Note that this method may be called many times, and should perform as rapidly as possible to support good marshalling performance.
sharedObjectID
- the ID for the sender shared object. Will not be null
.message
- the object to be serialized as the message.deserializeMessage(byte[])
into
a corresponding object on a compatible container instance. Must not be null
.java.io.IOException
- thrown if data cannot be serialized. Note that exceptions thrown will result in container-level disconnection.java.lang.Object deserializeMessage(byte[] data) throws java.io.IOException, java.lang.ClassNotFoundException
Deserialize a byte array into an object message. This method will be called every time a shared object message is received, but before the resulting Object is delivered to the shared object.
Note that this method may be called many times, and should perform as rapidly as possible to support good marshalling performance.
data
- the data to use to deserialize. Will not be null
.java.io.IOException
- if some problem deserializing from given bytes.java.lang.ClassNotFoundException
- thrown if class encoded in byte[] cannot be found in
local runtime. Note that exceptions thrown will result in container-level disconnection.