com.sun.grizzly.nio.tmpselectors
Class TemporarySelectorReader
java.lang.Object
com.sun.grizzly.AbstractReader<SocketAddress>
com.sun.grizzly.nio.tmpselectors.TemporarySelectorReader
- All Implemented Interfaces:
- Reader<SocketAddress>
- Direct Known Subclasses:
- TCPNIOTemporarySelectorReader, UDPNIOTemporarySelectorReader
public abstract class TemporarySelectorReader
- extends AbstractReader<SocketAddress>
- Author:
- oleksiys
|
Method Summary |
protected Buffer |
acquireBuffer(Connection connection)
|
int |
getTimeout()
|
TemporarySelectorsEnabledTransport |
getTransport()
|
Future<ReadResult<Buffer,SocketAddress>> |
read(Connection connection,
Buffer buffer,
CompletionHandler<ReadResult<Buffer,SocketAddress>> completionHandler,
Interceptor<ReadResult> interceptor)
Method reads data to the buffer. |
Future<ReadResult<Buffer,SocketAddress>> |
read(Connection connection,
Buffer buffer,
CompletionHandler<ReadResult<Buffer,SocketAddress>> completionHandler,
Interceptor<ReadResult> interceptor,
long timeout,
TimeUnit timeunit)
Method reads data to the message. |
protected int |
read0(Connection connection,
ReadResult currentResult,
Buffer buffer,
long timeout,
TimeUnit timeunit)
|
protected abstract int |
readNow0(Connection connection,
Buffer buffer,
ReadResult currentResult)
|
void |
setTimeout(int timeout)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DEFAULT_BUFFER_SIZE
public static final int DEFAULT_BUFFER_SIZE
- See Also:
- Constant Field Values
defaultBufferSize
protected int defaultBufferSize
transport
protected final TemporarySelectorsEnabledTransport transport
TemporarySelectorReader
public TemporarySelectorReader(TemporarySelectorsEnabledTransport transport)
getTimeout
public int getTimeout()
setTimeout
public void setTimeout(int timeout)
read
public Future<ReadResult<Buffer,SocketAddress>> read(Connection connection,
Buffer buffer,
CompletionHandler<ReadResult<Buffer,SocketAddress>> completionHandler,
Interceptor<ReadResult> interceptor)
throws IOException
- Method reads data to the buffer.
- Parameters:
connection - the Connection to read frombuffer - the buffer, where data will be readcompletionHandler - CompletionHandler,
which will get notified, when read will be completedinterceptor - 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.
- Returns:
Future, using which it's possible to check the result
- Throws:
IOException
read
public Future<ReadResult<Buffer,SocketAddress>> read(Connection connection,
Buffer buffer,
CompletionHandler<ReadResult<Buffer,SocketAddress>> completionHandler,
Interceptor<ReadResult> interceptor,
long timeout,
TimeUnit timeunit)
throws IOException
- Method reads data to the message.
- Parameters:
connection - the Connection to read frommessage - the message, where data will be readcompletionHandler - CompletionHandler,
which will get notified, when read will be completedcondition - Condition, which will be checked
each time new portion of a data was read to a buffer.
The condition can decide, whether asynchronous read is
completed or not.timeout - operation timeout value valuetimeunit - the timeout unit
- Returns:
Future, using which it's possible to check the result
- Throws:
IOException
read0
protected int read0(Connection connection,
ReadResult currentResult,
Buffer buffer,
long timeout,
TimeUnit timeunit)
throws IOException
- Throws:
IOException
readNow0
protected abstract int readNow0(Connection connection,
Buffer buffer,
ReadResult currentResult)
throws IOException
- Throws:
IOException
acquireBuffer
protected Buffer acquireBuffer(Connection connection)
getTransport
public TemporarySelectorsEnabledTransport getTransport()
Copyright © 2009 SUN Microsystems. All Rights Reserved.