com.sun.grizzly.nio.transport
Class UDPNIOStreamReader

java.lang.Object
  extended by com.sun.grizzly.streams.AbstractStreamReader
      extended by com.sun.grizzly.nio.transport.UDPNIOStreamReader
All Implemented Interfaces:
AddressableStreamReader<SocketAddress>, StreamReader, Closeable

public class UDPNIOStreamReader
extends AbstractStreamReader
implements AddressableStreamReader<SocketAddress>

Author:
oleksiys

Nested Class Summary
 
Nested classes/interfaces inherited from class com.sun.grizzly.streams.AbstractStreamReader
AbstractStreamReader.NotifyObject
 
Field Summary
 
Fields inherited from class com.sun.grizzly.streams.AbstractStreamReader
bufferSize, dataRecords, notifyObject, sync, timeoutMillis
 
Constructor Summary
UDPNIOStreamReader(UDPNIOConnection connection)
           
 
Method Summary
protected  boolean append(Object data)
           
 SocketAddress getPeerAddress()
          Get the address of StreamReader data source.
 Future<Integer> notifyCondition(Condition<StreamReader> condition, CompletionHandler<Integer> completionHandler)
          Method returns Future, using which it's possible check if StreamReader meets specific Condition.
protected  ReadResult read0()
           
protected  Buffer unwrap(Object record)
           
protected  Object wrap(Buffer buffer)
           
 
Methods inherited from class com.sun.grizzly.streams.AbstractStreamReader
appendBuffer, availableDataSize, close, current, ensureRead, ensureRead, finishBuffer, getBuffer, getBufferSize, getConnection, getTimeout, hasAvailableData, 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
 
Methods inherited from interface com.sun.grizzly.streams.StreamReader
appendBuffer, availableDataSize, finishBuffer, getBuffer, getBufferSize, getConnection, getTimeout, hasAvailableData, isBlocking, isClosed, notifyAvailable, notifyAvailable, notifyCondition, prependBuffer, readBoolean, readBooleanArray, readBuffer, readByte, readByteArray, readByteArray, readBytes, readChar, readCharArray, readDouble, readDoubleArray, readFloat, readFloatArray, readInt, readIntArray, readLong, readLongArray, readShort, readShortArray, setBlocking, setBufferSize, setTimeout
 
Methods inherited from interface java.io.Closeable
close
 

Constructor Detail

UDPNIOStreamReader

public UDPNIOStreamReader(UDPNIOConnection 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.

Specified by:
notifyCondition in interface StreamReader
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 ReadResult read0()
                    throws IOException
Specified by:
read0 in class AbstractStreamReader
Throws:
IOException

getPeerAddress

public SocketAddress getPeerAddress()
Description copied from interface: AddressableStreamReader
Get the address of StreamReader data source.

Specified by:
getPeerAddress in interface AddressableStreamReader<SocketAddress>
Returns:
the address of StreamReader data source.

append

protected final boolean append(Object data)
Overrides:
append in class AbstractStreamReader

wrap

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

unwrap

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


Copyright © 2009 SUN Microsystems. All Rights Reserved.