Top Description Fields Methods
org.glassfish.grizzly

public Interface Reader<L>

Known Direct Subinterfaces
org.glassfish.grizzly.asyncqueue.AsyncQueueReader
Known Direct Implementers
org.glassfish.grizzly.AbstractReader
Type Parameters
<L>
the reader address type
Imports
java.util.concurrent.Future

Implementations of this interface are able to read data from Connection to a Buffer. There are two basic Reader implementations in Grizzly: org.glassfish.grizzly.asyncqueue.AsyncQueueReader, org.glassfish.grizzly.nio.tmpselectors.TemporarySelectorReader.
Author
Alexey Stashok

Field Summary

Modifier and TypeField and Description
public static final int
public static final int
public static final int

Method Summary

Modifier and TypeMethod and Description
public GrizzlyFuture<ReadResult<Buffer, L>>

Returns:

Future, using which it's possible to check the result
read
(Connection<L>
the Connection to read from
connection
)

Method reads data.

public GrizzlyFuture<ReadResult<Buffer, L>>

Returns:

Future, using which it's possible to check the result
read
(Connection<L>
the Connection to read from
connection
,
Buffer
the buffer, where data will be read
buffer
)

Method reads data to the buffer.

public void
read(Connection<L>
the Connection to read from
connection
,
Buffer
the buffer, where data will be read
buffer
,
CompletionHandler<ReadResult<Buffer, L>>
CompletionHandler, which will get notified, when read will be completed
completionHandler
)

Method reads data to the buffer.

public void
read(Connection<L>
the Connection to read from
connection
,
Buffer
the Buffer to which data will be read
buffer
,
CompletionHandler<ReadResult<Buffer, L>>
CompletionHandler, which will get notified, when read will be completed
completionHandler
,
Interceptor<ReadResult<K, L>>
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.
interceptor
)

Method reads data to the buffer.

Field Detail

COMPLETE_EVENTback to summary
public static final int COMPLETE_EVENT
INCOMPLETE_EVENTback to summary
public static final int INCOMPLETE_EVENT
READ_EVENTback to summary
public static final int READ_EVENT

Method Detail

readback to summary
public GrizzlyFuture<ReadResult<Buffer, L>> read(Connection<L> connection)

Method reads data.

Parameters
connection:Connection<L>

the Connection to read from

Returns:GrizzlyFuture<ReadResult<Buffer, L>>

Future, using which it's possible to check the result

readback to summary
public GrizzlyFuture<ReadResult<Buffer, L>> read(Connection<L> connection, Buffer buffer)

Method reads data to the buffer.

Parameters
connection:Connection<L>

the Connection to read from

buffer:Buffer

the buffer, where data will be read

Returns:GrizzlyFuture<ReadResult<Buffer, L>>

Future, using which it's possible to check the result

readback to summary
public void read(Connection<L> connection, Buffer buffer, CompletionHandler<ReadResult<Buffer, L>> completionHandler)

Method reads data to the buffer.

Parameters
connection:Connection<L>

the Connection to read from

buffer:Buffer

the buffer, where data will be read

completionHandler:CompletionHandler<ReadResult<Buffer, L>>

CompletionHandler, which will get notified, when read will be completed

readback to summary
public void read(Connection<L> connection, Buffer buffer, CompletionHandler<ReadResult<Buffer, L>> completionHandler, Interceptor<ReadResult<K, L>> interceptor)

Method reads data to the buffer.

Parameters
connection:Connection<L>

the Connection to read from

buffer:Buffer

the Buffer to which data will be read

completionHandler:CompletionHandler<ReadResult<Buffer, L>>

CompletionHandler, which will get notified, when read will be completed

interceptor:Interceptor<ReadResult<K, L>>

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.