Class BufferManagerWrite

  • Direct Known Subclasses:
    BufferManagerWriteGrow, BufferManagerWriteStream

    public abstract class BufferManagerWrite
    extends java.lang.Object
    Defines the contract between the BufferManager and CDR stream on the writing side. The CDR stream calls back to the BufferManagerWrite when it needs more room in the output buffer to continue. The BufferManager can then grow the output buffer or use some kind of fragmentation technique.
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      abstract void close()
      Close the BufferManagerWrite and do any outstanding cleanup.
      abstract int getBufferSize()
      Returns the correct buffer size for this type of buffer manager as set in the ORB.
      abstract boolean isFragmentOnOverflow()
      Returns true if this buffer manager fragments when an overflow occurs.
      protected abstract java.nio.ByteBuffer overflow​(java.nio.ByteBuffer byteBuffer, int numBytesNeeded)  
      abstract void sendMessage()
      Called after Stub._invoke (i.e., before complete message has been sent).
      abstract boolean sentFragment()
      Has the stream sent out any fragments so far?
      boolean sentFullMessage()
      Has the entire message been sent? (Has sendMessage been called?)
      void setOutputObject​(java.lang.Object outputObject)
      A reference to the connection level stream will be required when sending fragments.
      • Methods inherited from class java.lang.Object

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

      • orb

        protected ORB orb
      • outputObject

        protected java.lang.Object outputObject
      • sentFullMessage

        protected boolean sentFullMessage
    • Constructor Detail

      • BufferManagerWrite

        BufferManagerWrite​(ORB orb)
    • Method Detail

      • sentFragment

        public abstract boolean sentFragment()
        Has the stream sent out any fragments so far?
        Returns:
        If any fragments have been sent
      • sentFullMessage

        public boolean sentFullMessage()
        Has the entire message been sent? (Has sendMessage been called?)
        Returns:
        If sendMessage() has been called
      • getBufferSize

        public abstract int getBufferSize()
        Returns the correct buffer size for this type of buffer manager as set in the ORB.
        Returns:
        buffer size
      • overflow

        protected abstract java.nio.ByteBuffer overflow​(java.nio.ByteBuffer byteBuffer,
                                                        int numBytesNeeded)
      • isFragmentOnOverflow

        public abstract boolean isFragmentOnOverflow()
        Returns true if this buffer manager fragments when an overflow occurs.
        Returns:
        If this buffer manager fragments
      • sendMessage

        public abstract void sendMessage()
        Called after Stub._invoke (i.e., before complete message has been sent). IIOPOutputStream.writeTo called from IIOPOutputStream.invoke Case: overflow was never called (bbwi.buf contains complete message). Backpatch size field. If growing or collecting: this.bufQ.put(bbwi). this.bufQ.iterate // However, see comment in getBufferQ this.connection.send(fragment) If streaming: this.connection.send(bbwi). Case: overflow was called N times (bbwi.buf contains last buffer). If growing or collecting: this.bufQ.put(bbwi). backpatch size field in first buffer. this.bufQ.iterate // However, see comment in getBufferQ this.connection.send(fragment) If streaming: backpatch fragment size field in bbwi.buf. Set no more fragments bit. this.connection.send(bbwi).
      • setOutputObject

        public void setOutputObject​(java.lang.Object outputObject)
        A reference to the connection level stream will be required when sending fragments.
        Parameters:
        outputObject - GIOPObject to use.
      • close

        public abstract void close()
        Close the BufferManagerWrite and do any outstanding cleanup.