## 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
`RpcDispatcher.MarshallerAdapter(RpcDispatcher.Marshaller marshaller)`

Method Summary
`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)`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### RpcDispatcher.MarshallerAdapter

    public RpcDispatcher.MarshallerAdapter(RpcDispatcher.Marshaller marshaller)

Method Detail

### objectToByteBuffer

    public byte[] objectToByteBuffer(java.lang.Object obj)
                              throws java.lang.Exception

  Specified by:
    `objectToByteBuffer` in interface `RpcDispatcher.Marshaller`
  Throws:
    `java.lang.Exception`

### objectFromByteBuffer

    public java.lang.Object objectFromByteBuffer(byte[] buf)
                                          throws java.lang.Exception

  Specified by:
    `objectFromByteBuffer` in interface `RpcDispatcher.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 interface `RpcDispatcher.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 interface `RpcDispatcher.Marshaller2`
  Throws:
    `java.lang.Exception`

Copyright © 1998-2009 Bela Ban / Red Hat. All Rights Reserved.