com.sun.grizzly.http
Interface Task

All Superinterfaces:
Callable, Runnable
All Known Subinterfaces:
AsyncTask
All Known Implementing Classes:
AjpProcessorTask, AsyncProcessorTask, ProcessorTask, SSLAsyncProcessorTask, SSLProcessorTask, 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 doTask()
          Execute the task.
 void execute()
          Execute this task by using the associated ExecutorService.
 void execute(ExecutorService threadPool)
          Execute this task using the passed ExecutorService.
 SelectionKey getSelectionKey()
          Return the SelectionKey associated with this tasks.
 SelectorHandler getSelectorHandler()
          Returns SelectorHandler, which handles this taks's SelectionKey
 SelectorThread getSelectorThread()
          Returns the SelectorThread used by this task.
 ExecutorService getThreadPool()
          Return the thread pool used by this object.
 int getType()
          Return this Tash type.
 void recycle()
          Recycle this task.
 void setSelectionKey(SelectionKey key)
          Set the SelectionKey
 void setSelectorHandler(SelectorHandler selectorHandler)
          Sets SelectorHandler, which handles this taks's SelectionKey
 void setSelectorThread(SelectorThread selectorThread)
          Set the SelectorThread used by this task.
 void setThreadPool(ExecutorService threadPool)
          Set the thread pool on which Worker Threads will synchronize.
 
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

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.


getSelectorHandler

SelectorHandler getSelectorHandler()
Returns SelectorHandler, which handles this taks's SelectionKey

Returns:
SelectorHandler, which handles this taks's SelectionKey

setSelectorHandler

void setSelectorHandler(SelectorHandler selectorHandler)
Sets SelectorHandler, which handles this taks's SelectionKey

Parameters:
{@link - SelectorHandler}, which handles this taks's SelectionKey

execute

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


execute

void execute(ExecutorService threadPool)
Execute this task using the passed ExecutorService. If the ExecutorService is null, the task's doTask() method will be invoked.


recycle

void recycle()
Recycle this task.


setThreadPool

void setThreadPool(ExecutorService threadPool)
Set the thread pool on which Worker Threads will synchronize.


getThreadPool

ExecutorService getThreadPool()
Return the thread pool used by this object.



Copyright © 2013 Oracle Corporation. All Rights Reserved.