org.glassfish.grizzly.streams
Class StreamReaderDecorator

java.lang.Object
  extended by org.glassfish.grizzly.streams.AbstractStreamReader
      extended by org.glassfish.grizzly.streams.StreamReaderDecorator
All Implemented Interfaces:
Closeable, StreamReader
Direct Known Subclasses:
SSLStreamReader

public abstract class StreamReaderDecorator
extends AbstractStreamReader

Author:
oleksiys

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

Field Detail

underlyingReader

protected StreamReader underlyingReader
Constructor Detail

StreamReaderDecorator

public StreamReaderDecorator(StreamReader underlyingReader)
Method Detail

getUnderlyingReader

public StreamReader getUnderlyingReader()

setUnderlyingReader

public void setUnderlyingReader(StreamReader underlyingReader)

isBlocking

public boolean isBlocking()
Returns the StreamReader mode. true, if StreamReader is operating in blocking mode, or false otherwise.

Specified by:
isBlocking in interface StreamReader
Overrides:
isBlocking in class AbstractStreamReader
Returns:
the StreamReader mode.

setBlocking

public void setBlocking(boolean isBlocking)
Sets the StreamReader mode.

Specified by:
setBlocking in interface StreamReader
Overrides:
setBlocking in class AbstractStreamReader
Parameters:
isBlocking - true, if StreamReader is operating in blocking mode, or false otherwise.

getConnection

public Connection getConnection()
Description copied from class: AbstractStreamReader
Get the Connection this StreamReader belongs to.

Specified by:
getConnection in interface StreamReader
Overrides:
getConnection in class AbstractStreamReader
Returns:
the Connection this StreamReader belongs to.

notifyCondition

public Future<Integer> notifyCondition(Condition<StreamReader> condition,
                                       CompletionHandler<Integer> completionHandler)
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.

pull

public void pull()
Pulls data out from underlying StreamReader chain into this StreamReader



Copyright © 2009 SUN Microsystems. All Rights Reserved.