public abstract class TemporarySelectorReader extends AbstractReader<SocketAddress>
Modifier and Type | Field and Description |
---|---|
protected TemporarySelectorsEnabledTransport |
transport |
COMPLETE_EVENT, INCOMPLETE_EVENT, READ_EVENT
Constructor and Description |
---|
TemporarySelectorReader(TemporarySelectorsEnabledTransport transport) |
Modifier and Type | Method and Description |
---|---|
protected Buffer |
acquireBuffer(Connection connection) |
TemporarySelectorsEnabledTransport |
getTransport() |
void |
read(Connection connection,
Buffer message,
CompletionHandler<ReadResult<Buffer,SocketAddress>> completionHandler,
Interceptor<ReadResult> interceptor)
Method reads data to the buffer.
|
void |
read(Connection connection,
Buffer message,
CompletionHandler<ReadResult<Buffer,SocketAddress>> completionHandler,
Interceptor<ReadResult> interceptor,
long timeout,
TimeUnit timeunit)
Method reads data to the message.
|
protected int |
read0(NIOConnection connection,
ReadResult<Buffer,SocketAddress> currentResult,
Buffer buffer,
long timeout,
TimeUnit timeunit) |
protected abstract int |
readNow0(NIOConnection connection,
Buffer buffer,
ReadResult<Buffer,SocketAddress> currentResult) |
read, read, read
protected final TemporarySelectorsEnabledTransport transport
public TemporarySelectorReader(TemporarySelectorsEnabledTransport transport)
public void read(Connection connection, Buffer message, CompletionHandler<ReadResult<Buffer,SocketAddress>> completionHandler, Interceptor<ReadResult> interceptor)
Reader
connection
- the Connection
to read frommessage
- the Buffer
to which data will be readcompletionHandler
- CompletionHandler
,
which will get notified, when read will be completedinterceptor
- Interceptor
, which will be able to intercept
control each time new portion of a data was read to a
buffer.
The interceptor can decide, whether asynchronous read is
completed or not, or provide other processing instructions.public void read(Connection connection, Buffer message, CompletionHandler<ReadResult<Buffer,SocketAddress>> completionHandler, Interceptor<ReadResult> interceptor, long timeout, TimeUnit timeunit)
connection
- the Connection
to read frommessage
- the message, where data will be readcompletionHandler
- CompletionHandler
,
which will get notified, when read will be completedinterceptor
- intercept to invoke on operationtimeout
- operation timeout value valuetimeunit
- the timeout unitIOException
protected final int read0(NIOConnection connection, ReadResult<Buffer,SocketAddress> currentResult, Buffer buffer, long timeout, TimeUnit timeunit) throws IOException
IOException
protected abstract int readNow0(NIOConnection connection, Buffer buffer, ReadResult<Buffer,SocketAddress> currentResult) throws IOException
IOException
protected Buffer acquireBuffer(Connection connection)
public TemporarySelectorsEnabledTransport getTransport()
Copyright © 2014 Oracle Corporation. All rights reserved.