|
TopoWeb Commons API | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Encapsulates a socket's conversational state.
Session
instances are not long-lived. That is,
an instance is not supposed to span over the lifetime of multiple
socket connections.
Session
instances are passed around as event objects
in queues. These event objects (Session
s) are then processed
(consumed) in stages.
SessionPool
Method Summary | |
void |
appendReadBuffer(java.nio.ByteBuffer buffer)
Append the given buffer into this instance's
internal "read buffer". |
int |
getReadAmount()
Returns the content-length of the internal "read buffer". |
byte[] |
getReadArray()
Returns the internal "read buffer". |
java.nio.channels.SocketChannel |
getSocketChannel()
Returns the socket channel used by this session. |
java.nio.ByteBuffer[] |
getWriteBuffers()
Returns the "write buffers". |
void |
setWriteBuffers(java.nio.ByteBuffer[] buffers)
Sets the "write buffers". |
Method Detail |
public java.nio.channels.SocketChannel getSocketChannel()
public void appendReadBuffer(java.nio.ByteBuffer buffer)
buffer
into this instance's
internal "read buffer". The "read amount" is incremented by
the buffer.remaining()
.
buffer
- the buffer whose contents are appendedgetReadArray()
,
getReadAmount()
public byte[] getReadArray()
getReadAmount()
method.
appendReadBuffer(ByteBuffer)
,
getReadAmount()
public int getReadAmount()
appendReadBuffer(ByteBuffer)
,
getReadArray()
public void setWriteBuffers(java.nio.ByteBuffer[] buffers)
buffers
are
to be written out to the client.
buffers
- the write buffersgetWriteBuffers()
public java.nio.ByteBuffer[] getWriteBuffers()
setWriteBuffers(ByteBuffer[])
|
TopoWeb Commons API | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |