Class 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().
    • 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)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • 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