org.glassfish.grizzly.nio.transport
Class UDPNIOAsyncQueueReader

java.lang.Object
  extended by org.glassfish.grizzly.AbstractReader<SocketAddress>
      extended by org.glassfish.grizzly.nio.AbstractNIOAsyncQueueReader
          extended by org.glassfish.grizzly.nio.transport.UDPNIOAsyncQueueReader
All Implemented Interfaces:
AsyncQueueProcessor, AsyncQueueReader<SocketAddress>, Processor, Reader<SocketAddress>

public class UDPNIOAsyncQueueReader
extends AbstractNIOAsyncQueueReader

The UDP transport AsyncQueueReader implementation, based on the Java NIO

Author:
Alexey Stashok

Field Summary
 
Fields inherited from class org.glassfish.grizzly.nio.AbstractNIOAsyncQueueReader
DEFAULT_BUFFER_SIZE, defaultBufferSize, transport
 
Fields inherited from interface org.glassfish.grizzly.Reader
COMPLETE_EVENT, INCOMPLETE_EVENT, READ_EVENT
 
Fields inherited from interface org.glassfish.grizzly.asyncqueue.AsyncQueueProcessor
NOT_REGISTER_KEY
 
Constructor Summary
UDPNIOAsyncQueueReader(NIOTransport transport)
           
 
Method Summary
protected  void addRecord(Connection connection, Buffer buffer, CompletionHandler completionHandler, Interceptor<ReadResult> interceptor)
           
 void afterProcess(Context context)
          Method will be called by framework after Processor execution, so it can release associated resources.
 void beforeProcess(Context context)
          Method will be called by framework before executing this Processor.
 Context context()
          Creates Context
protected  void onReadyToRead(Connection connection)
           
protected  int read0(Connection connection, Buffer buffer, ReadResult<Buffer,SocketAddress> currentResult)
           
 
Methods inherited from class org.glassfish.grizzly.nio.AbstractNIOAsyncQueueReader
close, doRead, failReadRecord, getContextPool, isInterested, isReady, onClose, onReadCompleted, onReadFailure, onReadIncompleted, process, processAsync, read, setInterested
 
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
 

Constructor Detail

UDPNIOAsyncQueueReader

public UDPNIOAsyncQueueReader(NIOTransport transport)
Method Detail

read0

protected int read0(Connection connection,
                    Buffer buffer,
                    ReadResult<Buffer,SocketAddress> currentResult)
             throws IOException
Specified by:
read0 in class AbstractNIOAsyncQueueReader
Throws:
IOException

addRecord

protected void addRecord(Connection connection,
                         Buffer buffer,
                         CompletionHandler completionHandler,
                         Interceptor<ReadResult> interceptor)

onReadyToRead

protected void onReadyToRead(Connection connection)
                      throws IOException
Specified by:
onReadyToRead in class AbstractNIOAsyncQueueReader
Throws:
IOException

context

public Context context()
Description copied from interface: Processor
Creates Context

Returns:
Context, or null, if default Context could be used.

beforeProcess

public void beforeProcess(Context context)
                   throws IOException
Description copied from interface: Processor
Method will be called by framework before executing this Processor.

Parameters:
context - processing context
Throws:
IOException

afterProcess

public void afterProcess(Context context)
                  throws IOException
Description copied from interface: Processor
Method will be called by framework after Processor execution, so it can release associated resources.

Parameters:
context - processing context
Throws:
IOException


Copyright © 2009 SUN Microsystems. All Rights Reserved.