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
FieldsFields inherited from interface org.glassfish.grizzly.Reader
COMPLETE_EVENT, INCOMPLETE_EVENT, READ_EVENT -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected BufferacquireBuffer(Connection connection) voidread(Connection<SocketAddress> connection, Buffer message, CompletionHandler<ReadResult<Buffer, SocketAddress>> completionHandler, Interceptor<ReadResult> interceptor) Method reads data to the buffer.voidread(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 intread0(NIOConnection connection, ReadResult<Buffer, SocketAddress> currentResult, Buffer buffer, long timeout, TimeUnit timeunit) protected abstract intreadNow0(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:ReaderMethod reads data to the buffer.- Parameters:
connection- theConnectionto read frommessage- theBufferto 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- theConnectionto 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
-