|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sun.jini.jeri.internal.mux.ConnectionIO
com.sun.jini.jeri.internal.mux.StreamConnectionIO
final class StreamConnectionIO
StreamConnectionIO implements the ConnectionIO abstraction for a connection accessible through standard (blocking) I/O streams, i.e. java.io.OutputStream and java.io.InputStream.
Nested Class Summary | |
---|---|
private class |
StreamConnectionIO.Reader
|
private class |
StreamConnectionIO.Writer
|
Field Summary | |
---|---|
private InputStream |
in
|
private ReadableByteChannel |
inChannel
|
private ByteBuffer |
inputBuffer
buffer for reading incoming data from connection |
private static Logger |
logger
mux logger |
private OutputStream |
out
I/O streams for underlying connection |
private WritableByteChannel |
outChannel
channels wrapped around underlying I/O streams |
private static int |
RECEIVE_BUFFER_SIZE
|
private LinkedList |
sendQueue
queue of buffers of data to be sent over connection, interspersed with IOFuture objects that need to be notified in sequence |
private static Executor |
systemThreadPool
pool of threads for executing tasks in system thread group: used for I/O (reader and writer) threads |
Fields inherited from class com.sun.jini.jeri.internal.mux.ConnectionIO |
---|
mux |
Constructor Summary | |
---|---|
StreamConnectionIO(Mux mux,
OutputStream out,
InputStream in)
Creates a new StreamConnectionIO for the connection represented by the supplied OutputStream and InputStream pair. |
Method Summary | |
---|---|
(package private) void |
asyncSend(ByteBuffer buffer)
Sends the sequence of bytes contained in the supplied buffer to the underlying connection. |
(package private) void |
asyncSend(ByteBuffer first,
ByteBuffer second)
Sends the sequence of bytes contained in the supplied buffers to the underlying connection. |
private void |
drainQueue(LinkedList queue)
|
(package private) IOFuture |
futureSend(ByteBuffer first,
ByteBuffer second)
Sends the sequence of bytes contained in the supplied buffers to the underlying connection. |
static ReadableByteChannel |
newChannel(InputStream in)
The following two methods are modifications of their equivalents in java.nio.channels.Channels with the assumption that the supplied byte buffers are backed by arrays, so no additional copying is required. |
static WritableByteChannel |
newChannel(OutputStream out)
|
(package private) void |
start()
Starts processing connection data. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final int RECEIVE_BUFFER_SIZE
private static final Executor systemThreadPool
private static final Logger logger
private final OutputStream out
private final InputStream in
private final WritableByteChannel outChannel
private final ReadableByteChannel inChannel
private LinkedList sendQueue
private final ByteBuffer inputBuffer
Constructor Detail |
---|
StreamConnectionIO(Mux mux, OutputStream out, InputStream in)
Method Detail |
---|
void start() throws IOException
start
in class ConnectionIO
IOException
void asyncSend(ByteBuffer buffer)
ConnectionIO
asyncSend
in class ConnectionIO
void asyncSend(ByteBuffer first, ByteBuffer second)
ConnectionIO
asyncSend
in class ConnectionIO
IOFuture futureSend(ByteBuffer first, ByteBuffer second)
ConnectionIO
futureSend
in class ConnectionIO
private void drainQueue(LinkedList queue)
public static ReadableByteChannel newChannel(InputStream in)
public static WritableByteChannel newChannel(OutputStream out)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |