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
public abstract class TemporarySelectorReader extends AbstractReader<SocketAddress>
- Author:
- oleksiys
-
-
Field Summary
Fields Modifier and Type Field Description protected TemporarySelectorsEnabledTransporttransport-
Fields inherited from interface org.glassfish.grizzly.Reader
COMPLETE_EVENT, INCOMPLETE_EVENT, READ_EVENT
-
-
Constructor Summary
Constructors Constructor Description TemporarySelectorReader(TemporarySelectorsEnabledTransport transport)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected BufferacquireBuffer(Connection connection)TemporarySelectorsEnabledTransportgetTransport()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 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 Detail
-
transport
protected final TemporarySelectorsEnabledTransport transport
-
-
Constructor Detail
-
TemporarySelectorReader
public TemporarySelectorReader(TemporarySelectorsEnabledTransport transport)
-
-
Method Detail
-
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
protected Buffer acquireBuffer(Connection connection)
-
getTransport
public TemporarySelectorsEnabledTransport getTransport()
-
-