public interface Marshaller
extends org.jgroups.blocks.RpcDispatcher.Marshaller2
Fqn or ReplicableCommand, and class type information
can be replaced with simple magic numbers.
Unknown types (typically user data) falls back to JBoss serialization.
In addition, using a marshaller allows adding additional data to the byte stream, such as context
class loader information on which class loader to use to deserialize the object stream, or versioning
information to allow streams to interoperate between different versions of JBoss Cache (see VersionAwareMarshaller
This interface implements the JGroups building-block interface RpcDispatcher.Marshaller which
is used to marshall ReplicableCommands, their parameters and their response values.
The interface is also used by the CacheLoader framework to efficiently serialize data to be persisted, as well as
the StateTransferManager when serializing the cache for transferring state en-masse.| Modifier and Type | Method and Description |
|---|---|
Object |
objectFromObjectStream(ObjectInputStream in)
Unmarshalls an object from an
ObjectInputStream |
Object |
objectFromStream(InputStream is)
Unmarshalls an object from an
InputStream |
ByteBuffer |
objectToBuffer(Object o)
A specialized form of
RpcDispatcher.Marshaller2.objectToBuffer(Object) that returns an instance
of ByteBuffer instead of Buffer. |
void |
objectToObjectStream(Object obj,
ObjectOutputStream out)
Marshalls an object to a given
ObjectOutputStream |
void |
objectToObjectStream(Object obj,
ObjectOutputStream out,
Fqn region)
Overloaded form of
objectToObjectStream(Object,java.io.ObjectOutputStream) which adds a hint to the Fqn region |
RegionalizedMethodCall |
regionalizedMethodCallFromByteBuffer(byte[] buffer)
Returns a RegionalizedMethodCall from a byte buffer.
|
RegionalizedMethodCall |
regionalizedMethodCallFromObjectStream(ObjectInputStream in)
Returns a RegionalizedMethodCall from an object input stream.
|
void objectToObjectStream(Object obj, ObjectOutputStream out) throws Exception
ObjectOutputStreamobj - object to marshallout - stream to marshall toExceptionObject objectFromObjectStream(ObjectInputStream in) throws Exception
ObjectInputStreamin - stream to unmarshall fromExceptionObject objectFromStream(InputStream is) throws Exception
InputStreamis - stream to unmarshall fromExceptionvoid objectToObjectStream(Object obj, ObjectOutputStream out, Fqn region) throws Exception
objectToObjectStream(Object,java.io.ObjectOutputStream) which adds a hint to the Fqn regionobj - object to marshallregion - fqn that this object pertains toout - stream to marshall toExceptionRegionalizedMethodCall regionalizedMethodCallFromByteBuffer(byte[] buffer) throws Exception
RpcDispatcher.Marshaller.objectFromByteBuffer(byte[])buffer - byte bufferException - if there are issuesRegionalizedMethodCall regionalizedMethodCallFromObjectStream(ObjectInputStream in) throws Exception
objectFromObjectStream(java.io.ObjectInputStream)in - object inout streamException - if there are issuesByteBuffer objectToBuffer(Object o) throws Exception
RpcDispatcher.Marshaller2.objectToBuffer(Object) that returns an instance
of ByteBuffer instead of Buffer.objectToBuffer in interface org.jgroups.blocks.RpcDispatcher.Marshaller2o - object to marshallExceptionCopyright © 2012 JBoss, a division of Red Hat. All Rights Reserved.