Package com.sun.corba.ee.impl.encoding
Class BufferManagerWrite
- java.lang.Object
-
- com.sun.corba.ee.impl.encoding.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.
-
-
Field Summary
Fields Modifier and Type Field Description protected ORB
orb
protected java.lang.Object
outputObject
protected boolean
sentFullMessage
protected static ORBUtilSystemException
wrapper
-
Constructor Summary
Constructors Constructor Description BufferManagerWrite(ORB orb)
-
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.
-
-
-
Field Detail
-
orb
protected ORB orb
-
wrapper
protected static final ORBUtilSystemException wrapper
-
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.
-
-