Module org.glassfish.grizzly
Class TemporarySelectorReader
java.lang.Object
org.glassfish.grizzly.AbstractReader<SocketAddress>
org.glassfish.grizzly.nio.tmpselectors.TemporarySelectorReader
- All Implemented Interfaces:
Reader<SocketAddress>
- Direct Known Subclasses:
TCPNIOTemporarySelectorReader
,UDPNIOTemporarySelectorReader
- Author:
- oleksiys
-
Field Summary
Fields inherited from interface org.glassfish.grizzly.Reader
COMPLETE_EVENT, INCOMPLETE_EVENT, READ_EVENT
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected Buffer
acquireBuffer
(Connection connection) void
read
(Connection<SocketAddress> connection, Buffer message, CompletionHandler<ReadResult<Buffer, SocketAddress>> completionHandler, Interceptor<ReadResult> interceptor) Method reads data to the buffer.void
read
(Connection<SocketAddress> connection, Buffer message, CompletionHandler<ReadResult<Buffer, SocketAddress>> completionHandler, Interceptor<ReadResult> interceptor, long timeout, TimeUnit timeunit) Method reads data to the message.protected final 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) Methods inherited from class org.glassfish.grizzly.AbstractReader
read, read, read
-
Field Details
-
transport
-
-
Constructor Details
-
TemporarySelectorReader
-
-
Method Details
-
read
public void read(Connection<SocketAddress> connection, Buffer message, CompletionHandler<ReadResult<Buffer, SocketAddress>> completionHandler, Interceptor<ReadResult> interceptor) Description copied from interface:Reader
Method reads data to the buffer.- Parameters:
connection
- theConnection
to read frommessage
- theBuffer
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.
-
read
public void read(Connection<SocketAddress> connection, Buffer message, CompletionHandler<ReadResult<Buffer, SocketAddress>> completionHandler, Interceptor<ReadResult> interceptor, long timeout, TimeUnit timeunit) Method reads data to the message.- Parameters:
connection
- theConnection
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 unit- Throws:
IOException
-
read0
protected final int read0(NIOConnection connection, ReadResult<Buffer, SocketAddress> currentResult, Buffer buffer, long timeout, TimeUnit timeunit) throws IOException- Throws:
IOException
-
readNow0
protected abstract int readNow0(NIOConnection connection, Buffer buffer, ReadResult<Buffer, SocketAddress> currentResult) throws IOException- Throws:
IOException
-
acquireBuffer
-
getTransport
-