com.sun.grizzly
Class AbstractReader<L>

java.lang.Object
  extended by com.sun.grizzly.AbstractReader<L>
All Implemented Interfaces:
Reader<L>
Direct Known Subclasses:
AbstractNIOAsyncQueueReader, TemporarySelectorReader

public abstract class AbstractReader<L>
extends Object
implements Reader<L>

Abstract class, which provides transitive dependencies for overloaded Reader#read(...) methods.

Author:
Alexey Stashok

Field Summary
 
Fields inherited from interface com.sun.grizzly.Reader
COMPLETE_EVENT, INCOMPLETE_EVENT, READ_EVENT
 
Constructor Summary
AbstractReader()
           
 
Method Summary
 Future<ReadResult<Buffer,L>> read(Connection connection)
          Method reads data.
 Future<ReadResult<Buffer,L>> read(Connection connection, Buffer buffer)
          Method reads data to the buffer.
 Future<ReadResult<Buffer,L>> read(Connection connection, Buffer buffer, CompletionHandler<ReadResult<Buffer,L>> completionHandler)
          Method reads data to the buffer.
 
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.Reader
read
 

Constructor Detail

AbstractReader

public AbstractReader()
Method Detail

read

public Future<ReadResult<Buffer,L>> read(Connection connection)
                                  throws IOException
Method reads data.

Specified by:
read in interface Reader<L>
Parameters:
connection - the Connection to read from
Returns:
Future, using which it's possible to check the result
Throws:
IOException

read

public Future<ReadResult<Buffer,L>> read(Connection connection,
                                         Buffer buffer)
                                  throws IOException
Method reads data to the buffer.

Specified by:
read in interface Reader<L>
Parameters:
connection - the Connection to read from
buffer - the buffer, where data will be read
Returns:
Future, using which it's possible to check the result
Throws:
IOException

read

public Future<ReadResult<Buffer,L>> read(Connection connection,
                                         Buffer buffer,
                                         CompletionHandler<ReadResult<Buffer,L>> completionHandler)
                                  throws IOException
Method reads data to the buffer.

Specified by:
read in interface Reader<L>
Parameters:
connection - the Connection to read from
buffer - the buffer, where data will be read
completionHandler - CompletionHandler, which will get notified, when read will be completed
Returns:
Future, using which it's possible to check the result
Throws:
IOException


Copyright © 2009 SUN Microsystems. All Rights Reserved.