org.glassfish.grizzly.nio.transport
Class TCPNIOStreamReader

java.lang.Object
  extended by org.glassfish.grizzly.streams.AbstractStreamReader
      extended by org.glassfish.grizzly.nio.transport.TCPNIOStreamReader
All Implemented Interfaces:
Closeable, StreamReader

public class TCPNIOStreamReader
extends AbstractStreamReader

Author:
oleksiys

Nested Class Summary
 
Nested classes/interfaces inherited from class org.glassfish.grizzly.streams.AbstractStreamReader
AbstractStreamReader.NotifyObject
 
Field Summary
 
Fields inherited from class org.glassfish.grizzly.streams.AbstractStreamReader
bufferSize, dataRecords, notifyObject, sync, timeoutMillis
 
Constructor Summary
TCPNIOStreamReader(TCPNIOConnection connection)
           
 
Method Summary
 Future<Integer> notifyCondition(Condition<StreamReader> condition, CompletionHandler<Integer> completionHandler)
          Method returns Future, using which it's possible check if StreamReader meets specific Condition.
protected  Buffer read0()
           
protected  Buffer unwrap(Object data)
           
protected  Object wrap(Buffer buffer)
           
 
Methods inherited from class org.glassfish.grizzly.streams.AbstractStreamReader
append, appendBuffer, availableDataSize, close, current, ensureRead, ensureRead, finishBuffer, getBuffer, getBufferSize, getConnection, getTimeout, isBlocking, isClosed, newBuffer, notifyAvailable, notifyAvailable, notifyCondition, poll, pollBuffer, prepend, prependBuffer, readBoolean, readBooleanArray, readBuffer, readByte, readByteArray, readByteArray, readBytes, readChar, readCharArray, readDouble, readDoubleArray, readFloat, readFloatArray, readInt, readIntArray, readLong, readLongArray, readShort, readShortArray, setBlocking, setBufferSize, setConnection, setTimeout
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TCPNIOStreamReader

public TCPNIOStreamReader(TCPNIOConnection connection)
Method Detail

notifyCondition

public Future<Integer> notifyCondition(Condition<StreamReader> condition,
                                       CompletionHandler<Integer> completionHandler)
Description copied from interface: StreamReader
Method returns Future, using which it's possible check if StreamReader meets specific Condition. CompletionHandler is also passed to get notified, once the Condition will be satisfied.

Parameters:
condition - Condition StreamReader should meet.
completionHandler - CompletionHandler, which will be notified, once the Condition will be satisfied.
Returns:
Future, using which it's possible to check whether StreamReader meets the required Condition.

read0

protected Buffer read0()
                throws IOException
Specified by:
read0 in class AbstractStreamReader
Throws:
IOException

wrap

protected final Object wrap(Buffer buffer)
Specified by:
wrap in class AbstractStreamReader

unwrap

protected final Buffer unwrap(Object data)
Specified by:
unwrap in class AbstractStreamReader


Copyright © 2009 SUN Microsystems. All Rights Reserved.