Package org.glassfish.grizzly
Interface Reader<L>
-
- Type Parameters:
L- the reader address type
- All Known Subinterfaces:
AsyncQueueReader<L>
- All Known Implementing Classes:
AbstractNIOAsyncQueueReader,AbstractReader,TCPNIOAsyncQueueReader,TCPNIOTemporarySelectorReader,TemporarySelectorReader,UDPNIOAsyncQueueReader,UDPNIOTemporarySelectorReader
public interface Reader<L>Implementations of this interface are able to read data fromConnectionto aBuffer. There are two basic Reader implementations in Grizzly:AsyncQueueReader,TemporarySelectorReader.- Author:
- Alexey Stashok
-
-
Field Summary
Fields Modifier and Type Field Description static intCOMPLETE_EVENTstatic intINCOMPLETE_EVENTstatic intREAD_EVENT
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description GrizzlyFuture<ReadResult<Buffer,L>>read(Connection<L> connection)Method reads data.GrizzlyFuture<ReadResult<Buffer,L>>read(Connection<L> connection, Buffer buffer)Method reads data to the buffer.voidread(Connection<L> connection, Buffer buffer, CompletionHandler<ReadResult<Buffer,L>> completionHandler)Method reads data to the buffer.voidread(Connection<L> connection, Buffer buffer, CompletionHandler<ReadResult<Buffer,L>> completionHandler, Interceptor<ReadResult> interceptor)Method reads data to the buffer.
-
-
-
Field Detail
-
READ_EVENT
static final int READ_EVENT
- See Also:
- Constant Field Values
-
COMPLETE_EVENT
static final int COMPLETE_EVENT
- See Also:
- Constant Field Values
-
INCOMPLETE_EVENT
static final int INCOMPLETE_EVENT
- See Also:
- Constant Field Values
-
-
Method Detail
-
read
GrizzlyFuture<ReadResult<Buffer,L>> read(Connection<L> connection)
Method reads data.- Parameters:
connection- theConnectionto read from- Returns:
Future, using which it's possible to check the result
-
read
GrizzlyFuture<ReadResult<Buffer,L>> read(Connection<L> connection, Buffer buffer)
Method reads data to the buffer.- Parameters:
connection- theConnectionto read frombuffer- the buffer, where data will be read- Returns:
Future, using which it's possible to check the result
-
read
void read(Connection<L> connection, Buffer buffer, CompletionHandler<ReadResult<Buffer,L>> completionHandler)
Method reads data to the buffer.- Parameters:
connection- theConnectionto read frombuffer- the buffer, where data will be readcompletionHandler-CompletionHandler, which will get notified, when read will be completed
-
read
void read(Connection<L> connection, Buffer buffer, CompletionHandler<ReadResult<Buffer,L>> completionHandler, Interceptor<ReadResult> interceptor)
Method reads data to the buffer.- Parameters:
connection- theConnectionto read frombuffer- 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.
-
-