|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Marshaller
A marshaller is a class that is able to marshall and unmarshall objects efficiently.
The reason why this is implemented specially in JBoss Cache rather than resorting to Java serialization or even the more efficient JBoss serialization is that a lot of efficiency can be gained when a majority of the serialization that occurs has to do with a small set of known types such asFqn
or MethodCall
, 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 MethodCall
s, 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.
Method Summary | |
---|---|
java.lang.Object |
objectFromObjectStream(java.io.ObjectInputStream in)
Unmarshalls an object from an ObjectInputStream |
java.lang.Object |
objectFromStream(java.io.InputStream is)
Unmarshalls an object from an InputStream |
void |
objectToObjectStream(java.lang.Object obj,
java.io.ObjectOutputStream out)
Marshalls an object to a given ObjectOutputStream |
void |
objectToObjectStream(java.lang.Object obj,
java.io.ObjectOutputStream out,
Fqn region)
Overloaded form of objectToObjectStream(Object,java.io.ObjectOutputStream) which adds a hint to the Fqn region |
Methods inherited from interface org.jgroups.blocks.RpcDispatcher.Marshaller |
---|
objectFromByteBuffer, objectToByteBuffer |
Method Detail |
---|
void objectToObjectStream(java.lang.Object obj, java.io.ObjectOutputStream out) throws java.lang.Exception
ObjectOutputStream
obj
- object to marshallout
- stream to marshall to
java.lang.Exception
java.lang.Object objectFromObjectStream(java.io.ObjectInputStream in) throws java.lang.Exception
ObjectInputStream
in
- stream to unmarshall from
java.lang.Exception
java.lang.Object objectFromStream(java.io.InputStream is) throws java.lang.Exception
InputStream
is
- stream to unmarshall from
java.lang.Exception
void objectToObjectStream(java.lang.Object obj, java.io.ObjectOutputStream out, Fqn region) throws java.lang.Exception
objectToObjectStream(Object,java.io.ObjectOutputStream)
which adds a hint to the Fqn
region
obj
- object to marshallregion
- fqn that this object pertains toout
- stream to marshall to
java.lang.Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |