|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.glassfish.grizzly.AbstractReader<java.net.SocketAddress>
org.glassfish.grizzly.nio.AbstractNIOAsyncQueueReader
public abstract class AbstractNIOAsyncQueueReader
The AsyncQueueReader implementation, based on the Java NIO
| Field Summary | |
|---|---|
static int |
DEFAULT_BUFFER_SIZE
|
protected int |
defaultBufferSize
|
protected NIOTransport |
transport
|
| Fields inherited from interface org.glassfish.grizzly.Reader |
|---|
COMPLETE_EVENT, INCOMPLETE_EVENT, READ_EVENT |
| Constructor Summary | |
|---|---|
AbstractNIOAsyncQueueReader(NIOTransport transport)
|
|
| Method Summary | |
|---|---|
void |
close()
Close AsyncQueueProcessor and release associated resources |
protected int |
doRead(Connection connection,
AsyncReadQueueRecord queueRecord)
Performs real read on the NIO channel |
protected void |
failReadRecord(AsyncReadQueueRecord record,
java.lang.Throwable e)
|
boolean |
isReady(Connection connection)
Checks whether there is ready data in AsyncQueue,
associated with the Connection. |
void |
onClose(Connection connection)
Callback method, which is called, when Connection has been closed,
to let processor release a connection associated resources. |
protected void |
onReadComplete(AsyncReadQueueRecord record)
|
protected void |
onReadFailure(Connection connection,
AsyncReadQueueRecord failedRecord,
java.io.IOException e)
|
protected void |
onReadIncomplete(AsyncReadQueueRecord record)
|
protected abstract void |
onReadyToRead(Connection connection)
|
boolean |
processAsync(Context context)
Callback method, which is called async. |
GrizzlyFuture<ReadResult<Buffer,java.net.SocketAddress>> |
read(Connection connection,
Buffer buffer,
CompletionHandler<ReadResult<Buffer,java.net.SocketAddress>> completionHandler,
Interceptor<ReadResult> interceptor)
Method reads data to the buffer. |
protected abstract int |
read0(Connection connection,
Buffer buffer,
ReadResult<Buffer,java.net.SocketAddress> currentResult)
|
| Methods inherited from class org.glassfish.grizzly.AbstractReader |
|---|
read, read, read |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.glassfish.grizzly.Reader |
|---|
read, read, read |
| Field Detail |
|---|
public static final int DEFAULT_BUFFER_SIZE
protected int defaultBufferSize
protected final NIOTransport transport
| Constructor Detail |
|---|
public AbstractNIOAsyncQueueReader(NIOTransport transport)
| Method Detail |
|---|
public GrizzlyFuture<ReadResult<Buffer,java.net.SocketAddress>> read(Connection connection,
Buffer buffer,
CompletionHandler<ReadResult<Buffer,java.net.SocketAddress>> completionHandler,
Interceptor<ReadResult> interceptor)
throws java.io.IOException
read in interface Reader<java.net.SocketAddress>connection - the Connection to read frombuffer - 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.
Future, using which it's possible to check the result
java.io.IOExceptionpublic final boolean isReady(Connection connection)
AsyncQueue,
associated with the Connection.
isReady in interface AsyncQueueconnection - Connection
public boolean processAsync(Context context)
throws java.io.IOException
AsyncQueue, which are associated with the given
Connection
processAsync in interface AsyncQueuecontext - Context
java.io.IOExceptionpublic void onClose(Connection connection)
Connection has been closed,
to let processor release a connection associated resources.
onClose in interface AsyncQueueconnection - Connectionpublic final void close()
close in interface AsyncQueue
protected final int doRead(Connection connection,
AsyncReadQueueRecord queueRecord)
throws java.io.IOException
connection - the Connection to read fromqueueRecord - the record to be read to
java.io.IOException
protected final void onReadComplete(AsyncReadQueueRecord record)
throws java.io.IOException
java.io.IOException
protected final void onReadIncomplete(AsyncReadQueueRecord record)
throws java.io.IOException
java.io.IOException
protected final void onReadFailure(Connection connection,
AsyncReadQueueRecord failedRecord,
java.io.IOException e)
protected final void failReadRecord(AsyncReadQueueRecord record,
java.lang.Throwable e)
protected abstract int read0(Connection connection,
Buffer buffer,
ReadResult<Buffer,java.net.SocketAddress> currentResult)
throws java.io.IOException
java.io.IOException
protected abstract void onReadyToRead(Connection connection)
throws java.io.IOException
java.io.IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||