Package org.jgroups.blocks
Class RpcDispatcher.MarshallerAdapter
- java.lang.Object
-
- org.jgroups.blocks.RpcDispatcher.MarshallerAdapter
-
- All Implemented Interfaces:
RpcDispatcher.Marshaller
,RpcDispatcher.Marshaller2
- Enclosing class:
- RpcDispatcher
public static class RpcDispatcher.MarshallerAdapter extends java.lang.Object implements RpcDispatcher.Marshaller2
Used to provide a Marshaller2 interface to a Marshaller. This class is for internal use only, and will be removed in 3.0 when Marshaller and Marshaller2 get merged. Do not use, but provide an implementation of Marshaller directly, e.g. in setRequestMarshaller().
-
-
Constructor Summary
Constructors Constructor Description MarshallerAdapter(RpcDispatcher.Marshaller marshaller)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object
objectFromByteBuffer(byte[] buf)
java.lang.Object
objectFromByteBuffer(byte[] buf, int offset, int length)
Buffer
objectToBuffer(java.lang.Object obj)
Marshals the object into a byte[] buffer and returns a Buffer with a ref to the underlying byte[] buffer, offset and length.
Note that the underlying byte[] buffer must not be changed as this would change the buffer of a message which potentially can get retransmitted, and such a retransmission would then carry a ref to a changed byte[] buffer !byte[]
objectToByteBuffer(java.lang.Object obj)
-
-
-
Constructor Detail
-
MarshallerAdapter
public MarshallerAdapter(RpcDispatcher.Marshaller marshaller)
-
-
Method Detail
-
objectToByteBuffer
public byte[] objectToByteBuffer(java.lang.Object obj) throws java.lang.Exception
- Specified by:
objectToByteBuffer
in interfaceRpcDispatcher.Marshaller
- Throws:
java.lang.Exception
-
objectFromByteBuffer
public java.lang.Object objectFromByteBuffer(byte[] buf) throws java.lang.Exception
- Specified by:
objectFromByteBuffer
in interfaceRpcDispatcher.Marshaller
- Throws:
java.lang.Exception
-
objectToBuffer
public Buffer objectToBuffer(java.lang.Object obj) throws java.lang.Exception
Description copied from interface:RpcDispatcher.Marshaller2
Marshals the object into a byte[] buffer and returns a Buffer with a ref to the underlying byte[] buffer, offset and length.
Note that the underlying byte[] buffer must not be changed as this would change the buffer of a message which potentially can get retransmitted, and such a retransmission would then carry a ref to a changed byte[] buffer !- Specified by:
objectToBuffer
in interfaceRpcDispatcher.Marshaller2
- Returns:
- Throws:
java.lang.Exception
-
objectFromByteBuffer
public java.lang.Object objectFromByteBuffer(byte[] buf, int offset, int length) throws java.lang.Exception
- Specified by:
objectFromByteBuffer
in interfaceRpcDispatcher.Marshaller2
- Throws:
java.lang.Exception
-
-