com.sun.grizzly.arp
Class DefaultAsyncHandler

java.lang.Object
  extended by com.sun.grizzly.arp.DefaultAsyncHandler
All Implemented Interfaces:
AsyncHandler

public class DefaultAsyncHandler
extends Object
implements AsyncHandler

Default implementation of AsyncHandler. This class handle the aysnchronous execution of a ProcessorTask. The request processing is executed by doing: (1) Wrap the ProcessorTask using an instance of AsyncTask (2) Execute the AsyncTask using the wrapped ProcessorTask Pipeline (3) If the AsyncTask has been interrupted but ready to be removed from the interrupted queue, remove it and execute the remaining operations.

Author:
Jeanfrancois Arcand

Constructor Summary
DefaultAsyncHandler()
           
 
Method Summary
 void addAsyncFilter(AsyncFilter asyncFilter)
          Add an AsyncFilter
 void addToInterruptedQueue(AsyncTask task)
          Add a Task to the interrupted queue.
 String getAsyncExecutorClassName()
          Get the code>AsyncExecutor used by this object.
 void handle(Task task)
          Handle an instance of a Task.
 boolean removeAsyncFilter(AsyncFilter asyncFilter)
          Remove an AsyncFilter
 void removeFromInterruptedQueue(AsyncTask task)
          Remove the Task from the interrupted queue.
 void returnTask(AsyncTask asyncTask)
          Return th Task to the pool
 void setAsyncExecutorClassName(String asyncExecutorClassName)
          Set the AsyncExecutor used by this object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultAsyncHandler

public DefaultAsyncHandler()
Method Detail

handle

public void handle(Task task)
Handle an instance of a Task. This method is invoked first by a ProcessorTask, which delegate its execution to this handler. Second, this method is invoked once a ProcessorTask needs to be removed from the interrupted queue.

Specified by:
handle in interface AsyncHandler

returnTask

public void returnTask(AsyncTask asyncTask)
Return th Task to the pool

Specified by:
returnTask in interface AsyncHandler

addToInterruptedQueue

public void addToInterruptedQueue(AsyncTask task)
Add a Task to the interrupted queue.

Specified by:
addToInterruptedQueue in interface AsyncHandler

removeFromInterruptedQueue

public void removeFromInterruptedQueue(AsyncTask task)
Remove the Task from the interrupted queue.

Specified by:
removeFromInterruptedQueue in interface AsyncHandler

setAsyncExecutorClassName

public void setAsyncExecutorClassName(String asyncExecutorClassName)
Set the AsyncExecutor used by this object.

Specified by:
setAsyncExecutorClassName in interface AsyncHandler

getAsyncExecutorClassName

public String getAsyncExecutorClassName()
Get the code>AsyncExecutor used by this object.

Specified by:
getAsyncExecutorClassName in interface AsyncHandler

addAsyncFilter

public void addAsyncFilter(AsyncFilter asyncFilter)
Add an AsyncFilter

Specified by:
addAsyncFilter in interface AsyncHandler

removeAsyncFilter

public boolean removeAsyncFilter(AsyncFilter asyncFilter)
Remove an AsyncFilter

Specified by:
removeAsyncFilter in interface AsyncHandler


Copyright © 2010 SUN Microsystems. All Rights Reserved.