org.glassfish.grizzly.nio.tmpselectors
Class TemporarySelectorReader

java.lang.Object
  extended by org.glassfish.grizzly.AbstractReader<SocketAddress>
      extended by 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
static int DEFAULT_BUFFER_SIZE
           
protected  int defaultBufferSize
           
protected  TemporarySelectorsEnabledTransport transport
           
 
Fields inherited from interface org.glassfish.grizzly.Reader
COMPLETE_EVENT, INCOMPLETE_EVENT, READ_EVENT
 
Constructor Summary
TemporarySelectorReader(TemporarySelectorsEnabledTransport transport)
           
 
Method Summary
protected  Buffer acquireBuffer(Connection connection)
           
 TemporarySelectorsEnabledTransport getTransport()
           
 void read(Connection connection, Buffer message, CompletionHandler<ReadResult<Buffer,SocketAddress>> completionHandler, Interceptor<ReadResult> interceptor)
          Method reads data to the buffer.
 void read(Connection 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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_BUFFER_SIZE

public static final int DEFAULT_BUFFER_SIZE
See Also:
Constant Field Values

defaultBufferSize

protected final int defaultBufferSize
See Also:
Constant Field Values

transport

protected final TemporarySelectorsEnabledTransport transport
Constructor Detail

TemporarySelectorReader

public TemporarySelectorReader(TemporarySelectorsEnabledTransport transport)
Method Detail

read

public void read(Connection connection,
                 Buffer message,
                 CompletionHandler<ReadResult<Buffer,SocketAddress>> completionHandler,
                 Interceptor<ReadResult> interceptor)
Description copied from interface: Reader
Method reads data to the buffer.

Parameters:
connection - the Connection to read from
message - the Buffer to which data will be read
completionHandler - CompletionHandler, which will get notified, when read will be completed
interceptor - 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 connection,
                 Buffer message,
                 CompletionHandler<ReadResult<Buffer,SocketAddress>> completionHandler,
                 Interceptor<ReadResult> interceptor,
                 long timeout,
                 TimeUnit timeunit)
Method reads data to the message.

Parameters:
connection - the Connection to read from
message - the message, where data will be read
completionHandler - CompletionHandler, which will get notified, when read will be completed
interceptor - intercept to invoke on operation
timeout - operation timeout value value
timeunit - 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()


Copyright © 2013 Oracle Corporation. All Rights Reserved.