Package com.sun.corba.ee.impl.encoding
Class BufferManagerWrite
java.lang.Object
com.sun.corba.ee.impl.encoding.BufferManagerWrite
- Direct Known Subclasses:
BufferManagerWriteGrow
,BufferManagerWriteStream
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.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ORB
protected Object
protected boolean
protected static final ORBUtilSystemException
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract void
close()
Close the BufferManagerWrite and do any outstanding cleanup.abstract int
Returns the correct buffer size for this type of buffer manager as set in the ORB.abstract boolean
Returns true if this buffer manager fragments when an overflow occurs.protected abstract ByteBuffer
overflow
(ByteBuffer byteBuffer, int numBytesNeeded) abstract void
Called after Stub._invoke (i.e., before complete message has been sent).abstract boolean
Has the stream sent out any fragments so far?boolean
Has the entire message been sent? (Has sendMessage been called?)void
setOutputObject
(Object outputObject) A reference to the connection level stream will be required when sending fragments.
-
Field Details
-
orb
-
wrapper
-
outputObject
-
sentFullMessage
protected boolean sentFullMessage
-
-
Constructor Details
-
BufferManagerWrite
BufferManagerWrite(ORB orb)
-
-
Method Details
-
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
-
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
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.
-