Top Fields Constructors Methods
org.glassfish.grizzly.nio.tmpselectors

public abstract Class TemporarySelectorReader

extends AbstractReader<SocketAddress>
Class Inheritance
Known Direct Subclasses
org.glassfish.grizzly.nio.transport.TCPNIOTemporarySelectorReader, org.glassfish.grizzly.nio.transport.UDPNIOTemporarySelectorReader
Imports
java.io.EOFException, .IOException, java.net.SocketAddress, java.nio.channels.SelectableChannel, .SelectionKey, .Selector, java.util.concurrent.Future, .TimeUnit, .TimeoutException, org.glassfish.grizzly.AbstractReader, .Buffer, .CompletionHandler, .Connection, .Interceptor, .ReadResult, .Reader, .Transport, org.glassfish.grizzly.nio.NIOConnection

Author
oleksiys

Field Summary

Modifier and TypeField and Description
private static final int
protected final TemporarySelectorsEnabledTransport

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected Buffer
acquireBuffer(Connection<L> connection)

private static void
failure(final Throwable failure, final CompletionHandler<ReadResult<Buffer, SocketAddress>> completionHandler)

public TemporarySelectorsEnabledTransport
public void
read(Connection<SocketAddress> connection, Buffer message, CompletionHandler<ReadResult<Buffer, SocketAddress>> completionHandler, Interceptor<ReadResult<K, L>> interceptor)

Implements org.glassfish.grizzly.Reader.read.

Method reads data to the buffer.

public void

Returns:

Future, using which it's possible to check the result
read
(final Connection<SocketAddress>
the Connection to read from
connection
,
final Buffer
the message, where data will be read
message
,
final CompletionHandler<ReadResult<Buffer, SocketAddress>>
CompletionHandler, which will get notified, when read will be completed
completionHandler
,
final Interceptor<ReadResult<K, L>>
intercept to invoke on operation
interceptor
,
final long
operation timeout value value
timeout
,
final TimeUnit
the timeout unit
timeunit
)

Method reads data to the message.

private int
read0(NIOConnection connection, Interceptor<ReadResult<K, L>> interceptor, ReadResult<Buffer, SocketAddress> currentResult, Buffer buffer, long timeout, TimeUnit timeunit)

protected final int
read0(final NIOConnection connection, final ReadResult<Buffer, SocketAddress> currentResult, final Buffer buffer, final long timeout, final TimeUnit timeunit)

protected abstract int
readNow0(NIOConnection connection, Buffer buffer, ReadResult<Buffer, SocketAddress> currentResult)

Inherited from org.glassfish.grizzly.AbstractReader:
readreadread

Field Detail

DEFAULT_BUFFER_SIZEback to summary
private static final int DEFAULT_BUFFER_SIZE
transportback to summary
protected final TemporarySelectorsEnabledTransport transport

Constructor Detail

TemporarySelectorReaderback to summary
public TemporarySelectorReader(TemporarySelectorsEnabledTransport transport)

Method Detail

acquireBufferback to summary
protected Buffer acquireBuffer(Connection<L> connection)
failureback to summary
private static void failure(final Throwable failure, final CompletionHandler<ReadResult<Buffer, SocketAddress>> completionHandler)
getTransportback to summary
public TemporarySelectorsEnabledTransport getTransport()
readback to summary
public void read(Connection<SocketAddress> connection, Buffer message, CompletionHandler<ReadResult<Buffer, SocketAddress>> completionHandler, Interceptor<ReadResult<K, L>> interceptor)

Implements org.glassfish.grizzly.Reader.read.

Doc from org.glassfish.grizzly.Reader.read.

Method reads data to the buffer.

Annotations
@Override
readback to summary
public void read(final Connection<SocketAddress> connection, final Buffer message, final CompletionHandler<ReadResult<Buffer, SocketAddress>> completionHandler, final Interceptor<ReadResult<K, L>> interceptor, final long timeout, final TimeUnit timeunit)

Method reads data to the message.

Parameters
connection:Connection<SocketAddress>

the Connection to read from

message:Buffer

the message, where data will be read

completionHandler:CompletionHandler<ReadResult<Buffer, SocketAddress>>

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

interceptor:Interceptor<ReadResult<K, L>>

intercept to invoke on operation

timeout:long

operation timeout value value

timeunit:TimeUnit

the timeout unit

Returns:void

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

read0back to summary
private int read0(NIOConnection connection, Interceptor<ReadResult<K, L>> interceptor, ReadResult<Buffer, SocketAddress> currentResult, Buffer buffer, long timeout, TimeUnit timeunit) throws IOException
read0back to summary
protected final int read0(final NIOConnection connection, final ReadResult<Buffer, SocketAddress> currentResult, final Buffer buffer, final long timeout, final TimeUnit timeunit) throws IOException
readNow0back to summary
protected abstract int readNow0(NIOConnection connection, Buffer buffer, ReadResult<Buffer, SocketAddress> currentResult) throws IOException