|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sun.grizzly.http.TaskBase
public abstract class TaskBase
Abstract implementation of a Task object.
| Field Summary | |
|---|---|
protected SelectionKey |
key
The SelectionKey used by this task. |
protected SelectorHandler |
selectorHandler
SelectorHandler, which handles this SelectionKey I/O events |
protected SelectorThread |
selectorThread
The SelectorThread who created this task. |
protected ExecutorService |
threadPool
The ExecutorService object associated with this
Task |
protected int |
type
This number represent a specific implementation of a Task
instance. |
| Fields inherited from interface com.sun.grizzly.http.Task |
|---|
ACCEPT_TASK, PROCESSOR_TASK, READ_TASK |
| Constructor Summary | |
|---|---|
TaskBase()
|
|
| Method Summary | |
|---|---|
Object |
call()
By default, do nothing when a Callable is invoked. |
void |
execute()
Execute the task based on its ExecutorService. |
SelectionKey |
getSelectionKey()
Return the SelectionKey associated with this task. |
SelectorHandler |
getSelectorHandler()
Returns SelectorHandler, which handles this taks's SelectionKey |
SelectorThread |
getSelectorThread()
Return the SelectorThread |
TaskListener |
getTaskListener()
The TaskListener associated with this instance. |
ExecutorService |
getThreadPool()
Return the thread pool used by this object. |
int |
getType()
Return this Tash type. |
void |
recycle()
Recycle internal state. |
void |
run()
Some ExecutorService implementation requires a instance of
Runnable instance. |
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 object. |
void |
setTaskListener(TaskListener taskListener)
Set the TaskListener associated with this class. |
void |
setThreadPool(ExecutorService threadPool)
Set the thread pool on which Worker Threads will synchronize. |
| 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 |
|---|
doTask |
| Field Detail |
|---|
protected int type
Task
instance.
protected ExecutorService threadPool
ExecutorService object associated with this
Task
protected SelectionKey key
SelectionKey used by this task.
protected SelectorThread selectorThread
SelectorThread who created this task.
protected SelectorHandler selectorHandler
SelectorHandler, which handles this SelectionKey I/O events
| Constructor Detail |
|---|
public TaskBase()
| Method Detail |
|---|
public int getType()
TaskTash type.
getType in interface Taskpublic void setSelectorThread(SelectorThread selectorThread)
SelectorThread object.
setSelectorThread in interface Taskpublic SelectorThread getSelectorThread()
SelectorThread
getSelectorThread in interface Taskpublic SelectorHandler getSelectorHandler()
SelectorHandler, which handles this taks's SelectionKey
getSelectorHandler in interface TaskSelectorHandler, which handles this taks's SelectionKeypublic void setSelectorHandler(SelectorHandler selectorHandler)
SelectorHandler, which handles this taks's SelectionKey
setSelectorHandler in interface Taskpublic void setThreadPool(ExecutorService threadPool)
setThreadPool in interface Taskpublic ExecutorService getThreadPool()
getThreadPool in interface Taskpublic void setSelectionKey(SelectionKey key)
SelectionKey
setSelectionKey in interface Taskpublic SelectionKey getSelectionKey()
SelectionKey associated with this task.
getSelectionKey in interface Taskpublic void execute()
ExecutorService. If the
ExecutorService is null, then execute the task on using the
calling thread.
execute in interface Taskpublic void recycle()
recycle in interface Taskpublic void run()
ExecutorService implementation requires a instance of
Runnable instance.
run in interface Runnable
public Object call()
throws Exception
Callable is invoked.
call in interface CallableExceptionpublic TaskListener getTaskListener()
TaskListener associated with this instance.
TaskListener associated with this instance.public void setTaskListener(TaskListener taskListener)
TaskListener associated with this class.
{@link - TaskListener} associated with this instance.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||