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 TemporarySelectorsEnabledTransport
transport
-
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 Buffer
acquireBuffer(Connection connection)
TemporarySelectorsEnabledTransport
getTransport()
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 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 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: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
protected Buffer acquireBuffer(Connection connection)
-
getTransport
public TemporarySelectorsEnabledTransport getTransport()
-
-