|
||||||||||
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 . |
void |
execute(ExecutorService threadPool)
Execute this task using the passed 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()
Task
Tash
type.
getType
in interface Task
public void setSelectorThread(SelectorThread selectorThread)
SelectorThread
object.
setSelectorThread
in interface Task
public SelectorThread getSelectorThread()
SelectorThread
getSelectorThread
in interface Task
public SelectorHandler getSelectorHandler()
SelectorHandler
, which handles this taks's SelectionKey
getSelectorHandler
in interface Task
SelectorHandler
, which handles this taks's SelectionKey
public void setSelectorHandler(SelectorHandler selectorHandler)
SelectorHandler
, which handles this taks's SelectionKey
setSelectorHandler
in interface Task
public void setThreadPool(ExecutorService threadPool)
setThreadPool
in interface Task
public ExecutorService getThreadPool()
getThreadPool
in interface Task
public void setSelectionKey(SelectionKey key)
SelectionKey
setSelectionKey
in interface Task
public SelectionKey getSelectionKey()
SelectionKey
associated with this task.
getSelectionKey
in interface Task
public void execute()
ExecutorService
. If the
ExecutorService
is null, then execute the task on using the
calling thread.
execute
in interface Task
public void execute(ExecutorService threadPool)
ExecutorService
.
If the ExecutorService
is null, the task's doTask()
method will be invoked.
execute
in interface Task
public void recycle()
recycle
in interface Task
public 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 Callable
Exception
public 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 |