com.sun.grizzly.http
Interface Task

All Superinterfaces:
Callable, Runnable
All Known Subinterfaces:
AsyncTask, ProcessorTask
All Known Implementing Classes:
AsyncProcessorTask, CometTask, DefaultProcessorTask, SSLAsyncProcessorTask, SSLDefaultProcessorTask, TaskBase

public interface Task
extends Runnable, Callable

Wrapper object used by the WorkerThread

Author:
Jean-Francois Arcand

Field Summary
static int ACCEPT_TASK
           
static int PROCESSOR_TASK
           
static int READ_TASK
           
 
Method Summary
 void addTaskListener(TaskListener task)
          Add a Task to this class.
 void cancelTask(String message, String httpCode)
          Cancel the task.
 void clearTaskListeners()
          Remove all listeners
 void doTask()
          Execute the task.
 void execute()
          Execute this task by using the associated Pipeline.
 KeepAliveStats getKeepAliveStats()
          Gets the KeepAliveStats associated with this task.
 Pipeline getPipeline()
          Return the pipeline used by this object.
 boolean getRecycle()
          Return true if this Task will be recycled.
 RequestGroupInfo getRequestGroupInfo()
          Gets the RequestGroupInfo from this task.
 SelectionKey getSelectionKey()
          Return the SelectionKey associated with this tasks.
 SelectorThread getSelectorThread()
          Returns the SelectorThread used by this task.
 ArrayList getTaskListeners()
          Return the ArrauList containing the listeners.
 int getType()
          Return this Tash type.
 boolean isMonitoringEnabled()
          Returns true if monitoring has been enabled, false otherwise.
 void recycle()
          Recycle this task.
 void removeTaskListener(TaskListener task)
          Remove a Task to this class.
 void setPipeline(Pipeline pipeline)
          Set the pipeline on which Worker Threads will synchronize.
 void setRecycle(boolean recycle)
          Recycle the Task after every doTask invokation.
 void setSelectionKey(SelectionKey key)
          Set the SelectionKey
 void setSelectorThread(SelectorThread selectorThread)
          Set the SelectorThread used by this task.
 
Methods inherited from interface java.lang.Runnable
run
 
Methods inherited from interface java.util.concurrent.Callable
call
 

Field Detail

ACCEPT_TASK

static final int ACCEPT_TASK
See Also:
Constant Field Values

READ_TASK

static final int READ_TASK
See Also:
Constant Field Values

PROCESSOR_TASK

static final int PROCESSOR_TASK
See Also:
Constant Field Values
Method Detail

getType

int getType()
Return this Tash type.


doTask

void doTask()
            throws IOException
Execute the task.

Throws:
IOException

cancelTask

void cancelTask(String message,
                String httpCode)
Cancel the task.


setSelectionKey

void setSelectionKey(SelectionKey key)
Set the SelectionKey


getSelectionKey

SelectionKey getSelectionKey()
Return the SelectionKey associated with this tasks.


setSelectorThread

void setSelectorThread(SelectorThread selectorThread)
Set the SelectorThread used by this task.


getSelectorThread

SelectorThread getSelectorThread()
Returns the SelectorThread used by this task.


getRequestGroupInfo

RequestGroupInfo getRequestGroupInfo()
Gets the RequestGroupInfo from this task.


isMonitoringEnabled

boolean isMonitoringEnabled()
Returns true if monitoring has been enabled, false otherwise.


getKeepAliveStats

KeepAliveStats getKeepAliveStats()
Gets the KeepAliveStats associated with this task.


addTaskListener

void addTaskListener(TaskListener task)
Add a Task to this class.


removeTaskListener

void removeTaskListener(TaskListener task)
Remove a Task to this class.


execute

void execute()
Execute this task by using the associated Pipeline. If the Pipeline is null, the task's doTask() method will be invoked.


recycle

void recycle()
Recycle this task.


getTaskListeners

ArrayList getTaskListeners()
Return the ArrauList containing the listeners.


clearTaskListeners

void clearTaskListeners()
Remove all listeners


setRecycle

void setRecycle(boolean recycle)
Recycle the Task after every doTask invokation.


getRecycle

boolean getRecycle()
Return true if this Task will be recycled.


setPipeline

void setPipeline(Pipeline pipeline)
Set the pipeline on which Worker Threads will synchronize.


getPipeline

Pipeline getPipeline()
Return the pipeline used by this object.



Copyright © 2011 SUN Microsystems. All Rights Reserved.