org.glassfish.grizzly.nio.tmpselectors
Class TemporarySelectorReader
java.lang.Object
org.glassfish.grizzly.AbstractReader<java.net.SocketAddress>
org.glassfish.grizzly.nio.tmpselectors.TemporarySelectorReader
- All Implemented Interfaces:
- Reader<java.net.SocketAddress>
- Direct Known Subclasses:
- TCPNIOTemporarySelectorReader, UDPNIOTemporarySelectorReader
public abstract class TemporarySelectorReader
- extends AbstractReader<java.net.SocketAddress>
- Author:
- oleksiys
|
Method Summary |
protected Buffer |
acquireBuffer(Connection connection)
|
TemporarySelectorsEnabledTransport |
getTransport()
|
GrizzlyFuture<ReadResult<Buffer,java.net.SocketAddress>> |
read(Connection connection,
Buffer message,
CompletionHandler<ReadResult<Buffer,java.net.SocketAddress>> completionHandler,
Interceptor<ReadResult> interceptor)
Method reads data to the buffer. |
GrizzlyFuture<ReadResult<Buffer,java.net.SocketAddress>> |
read(Connection connection,
Buffer message,
CompletionHandler<ReadResult<Buffer,java.net.SocketAddress>> completionHandler,
Interceptor<ReadResult> interceptor,
long timeout,
java.util.concurrent.TimeUnit timeunit)
Method reads data to the message. |
protected int |
read0(NIOConnection connection,
ReadResult<Buffer,java.net.SocketAddress> currentResult,
Buffer buffer,
long timeout,
java.util.concurrent.TimeUnit timeunit)
|
protected abstract int |
readNow0(NIOConnection connection,
Buffer buffer,
ReadResult<Buffer,java.net.SocketAddress> currentResult)
|
| 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 final int defaultBufferSize
- See Also:
- Constant Field Values
transport
protected final TemporarySelectorsEnabledTransport transport
TemporarySelectorReader
public TemporarySelectorReader(TemporarySelectorsEnabledTransport transport)
read
public GrizzlyFuture<ReadResult<Buffer,java.net.SocketAddress>> read(Connection connection,
Buffer message,
CompletionHandler<ReadResult<Buffer,java.net.SocketAddress>> completionHandler,
Interceptor<ReadResult> interceptor)
throws java.io.IOException
- Description copied from interface:
Reader
- Method reads data to the buffer.
- Parameters:
connection - the Connection to read frommessage - the Buffer to which 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:
java.io.IOException
read
public GrizzlyFuture<ReadResult<Buffer,java.net.SocketAddress>> read(Connection connection,
Buffer message,
CompletionHandler<ReadResult<Buffer,java.net.SocketAddress>> completionHandler,
Interceptor<ReadResult> interceptor,
long timeout,
java.util.concurrent.TimeUnit timeunit)
throws java.io.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 completedinterceptor - intercept to invoke on operationtimeout - operation timeout value valuetimeunit - the timeout unit
- Returns:
Future, using which it's possible to check the result
- Throws:
java.io.IOException
read0
protected final int read0(NIOConnection connection,
ReadResult<Buffer,java.net.SocketAddress> currentResult,
Buffer buffer,
long timeout,
java.util.concurrent.TimeUnit timeunit)
throws java.io.IOException
- Throws:
java.io.IOException
readNow0
protected abstract int readNow0(NIOConnection connection,
Buffer buffer,
ReadResult<Buffer,java.net.SocketAddress> currentResult)
throws java.io.IOException
- Throws:
java.io.IOException
acquireBuffer
protected Buffer acquireBuffer(Connection connection)
getTransport
public TemporarySelectorsEnabledTransport getTransport()
Copyright © 2011 Oracle Corpration. All Rights Reserved.