com.sun.grizzly.arp
Class AsyncProcessorTask

java.lang.Object
  extended by com.sun.grizzly.http.TaskBase
      extended by com.sun.grizzly.arp.AsyncProcessorTask
All Implemented Interfaces:
AsyncTask, Task, TaskListener, Runnable, Callable

public class AsyncProcessorTask
extends TaskBase
implements AsyncTask

A Task that wraps the execution of an asynchronous execution of a ProcessorTask. Internaly, this class invoke the associated AsyncExecutor method to execute the ProcessorTask lifecycle operations.

Author:
Jeanfrancois Arcand

Field Summary
 
Fields inherited from class com.sun.grizzly.http.TaskBase
key, listeners, pipeline, recycle, selectorThread, type
 
Fields inherited from interface com.sun.grizzly.http.AsyncTask
COMPLETED, EXECUTE, INTERRUPTED, POST_EXECUTE, PRE_EXECUTE
 
Fields inherited from interface com.sun.grizzly.http.Task
ACCEPT_TASK, PROCESSOR_TASK, READ_TASK
 
Constructor Summary
AsyncProcessorTask()
           
 
Method Summary
 void doTask()
          Execute the AsyncExecutor based on the stage of the ProcessorTask execution.
 AsyncExecutor getAsyncExecutor()
          Get the AsyncExecutor.
 ProcessorTask getProcessorTask()
          Return the ProcessorTask.
 int getStage()
          Return the stage of the current execution.
 void recycle()
          Reset the object.
 void setAsyncExecutor(AsyncExecutor asyncExecutor)
          Set the AsyncExecutor used by this Task to delegate the execution of a ProcessorTask.
 void setProcessorTask(ProcessorTask processorTask)
          Set the ProcessorTask that needs to be executed asynchronously.
 void setStage(int stage)
           
 void taskEvent(TaskEvent event)
          Not used.
 
Methods inherited from class com.sun.grizzly.http.TaskBase
addTaskListener, call, cancelTask, clearTaskListeners, execute, fireTaskEvent, getKeepAliveStats, getPipeline, getRecycle, getRequestGroupInfo, getSelectionKey, getSelectorThread, getSocket, getTaskListeners, getType, isMonitoringEnabled, removeTaskListener, run, setPipeline, setRecycle, setSelectionKey, setSelectorThread
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.sun.grizzly.http.Task
addTaskListener, cancelTask, clearTaskListeners, execute, getKeepAliveStats, getPipeline, getRecycle, getRequestGroupInfo, getSelectionKey, getSelectorThread, getTaskListeners, getType, isMonitoringEnabled, removeTaskListener, setPipeline, setRecycle, setSelectionKey, setSelectorThread
 
Methods inherited from interface java.lang.Runnable
run
 
Methods inherited from interface java.util.concurrent.Callable
call
 

Constructor Detail

AsyncProcessorTask

public AsyncProcessorTask()
Method Detail

doTask

public void doTask()
            throws IOException
Execute the AsyncExecutor based on the stage of the ProcessorTask execution.

Specified by:
doTask in interface Task
Throws:
IOException

taskEvent

public void taskEvent(TaskEvent event)
Not used.

Specified by:
taskEvent in interface TaskListener
Overrides:
taskEvent in class TaskBase

getStage

public int getStage()
Return the stage of the current execution.

Specified by:
getStage in interface AsyncTask

recycle

public void recycle()
Reset the object.

Specified by:
recycle in interface Task
Overrides:
recycle in class TaskBase

setAsyncExecutor

public void setAsyncExecutor(AsyncExecutor asyncExecutor)
Set the AsyncExecutor used by this Task to delegate the execution of a ProcessorTask.

Specified by:
setAsyncExecutor in interface AsyncTask

getAsyncExecutor

public AsyncExecutor getAsyncExecutor()
Get the AsyncExecutor.

Specified by:
getAsyncExecutor in interface AsyncTask

setProcessorTask

public void setProcessorTask(ProcessorTask processorTask)
Set the ProcessorTask that needs to be executed asynchronously.

Specified by:
setProcessorTask in interface AsyncTask

getProcessorTask

public ProcessorTask getProcessorTask()
Return the ProcessorTask.

Specified by:
getProcessorTask in interface AsyncTask

setStage

public void setStage(int stage)


Copyright © 2011 SUN Microsystems. All Rights Reserved.