com.sun.grizzly.arp
Class AsyncProtocolFilter

java.lang.Object
  extended by com.sun.grizzly.arp.AsyncProtocolFilter
All Implemented Interfaces:
TaskListener, ProtocolFilter
Direct Known Subclasses:
SSLAsyncProtocolFilter

public class AsyncProtocolFilter
extends Object
implements ProtocolFilter, TaskListener

A ProtocolFilter that allow asynchronous http request processing.

Author:
Jeanfrancois Arcand

Field Summary
protected  int bbSize
          Default size for ByteBuffer.
 
Fields inherited from interface com.sun.grizzly.ProtocolFilter
SUCCESSFUL_READ
 
Constructor Summary
AsyncProtocolFilter(Class algorithmClass, int port)
           
 
Method Summary
protected  void configureByteBufferInputStream(ByteBufferInputStream inputStream, Context context, HttpWorkerThread workerThread)
          Configure ByteBufferInputStream
protected  void configureProcessorTask(ProcessorTask processorTask, Context context, HttpWorkerThread workerThread, Interceptor handler, InputStream inputStream)
          Configure SSLProcessorTask.
protected  ByteBufferInputStream createByteBufferInputStream()
          Creates ByteBufferInputStream
 boolean execute(Context ctx)
          Execute a unit of processing work to be performed.
protected  boolean isSecure()
          Is ProtocolFilter secured
 boolean postExecute(Context ctx)
          Execute any cleanup activities, such as releasing resources that were acquired during the execute() method of this ProtocolFilter instance.
 void taskEvent(TaskEvent event)
          Called when the Asynchronous Request Processing is resuming.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

bbSize

protected int bbSize
Default size for ByteBuffer.

Constructor Detail

AsyncProtocolFilter

public AsyncProtocolFilter(Class algorithmClass,
                           int port)
Method Detail

execute

public boolean execute(Context ctx)
                throws IOException
Execute a unit of processing work to be performed. This ProtocolFilter may either complete the required processing and return false, or delegate remaining processing to the next ProtocolFilter in a ProtocolChain containing this ProtocolFilter by returning true.

Specified by:
execute in interface ProtocolFilter
Parameters:
ctx - Context
Returns:
Throws:
IOException

taskEvent

public void taskEvent(TaskEvent event)
Called when the Asynchronous Request Processing is resuming.

Specified by:
taskEvent in interface TaskListener

postExecute

public boolean postExecute(Context ctx)
                    throws IOException
Execute any cleanup activities, such as releasing resources that were acquired during the execute() method of this ProtocolFilter instance.

Specified by:
postExecute in interface ProtocolFilter
Parameters:
ctx - Context
Returns:
Throws:
IOException

configureProcessorTask

protected void configureProcessorTask(ProcessorTask processorTask,
                                      Context context,
                                      HttpWorkerThread workerThread,
                                      Interceptor handler,
                                      InputStream inputStream)
Configure SSLProcessorTask.


configureByteBufferInputStream

protected void configureByteBufferInputStream(ByteBufferInputStream inputStream,
                                              Context context,
                                              HttpWorkerThread workerThread)
Configure ByteBufferInputStream

Parameters:
ByteBufferInputStream -

isSecure

protected boolean isSecure()
Is ProtocolFilter secured

Returns:
is ProtocolFilter secured

createByteBufferInputStream

protected ByteBufferInputStream createByteBufferInputStream()
Creates ByteBufferInputStream



Copyright © 2008 SUN Microsystems. All Rights Reserved.