|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sun.enterprise.web.connector.grizzly.TaskBase
public abstract class TaskBase
Abstract implementation of a Task object.
| Field Summary | |
|---|---|
protected SelectionKey |
key
The SelectionKey used by this task. |
protected ArrayList<TaskListener> |
listeners
List of listeners |
protected Pipeline |
pipeline
The Pipeline object associated with this
Task |
protected boolean |
recycle
Recycle this task |
protected SelectorThread |
selectorThread
The SelectorThread who created this task. |
protected int |
type
This number represent a specific implementation of a Task
instance. |
| Fields inherited from interface com.sun.enterprise.web.connector.grizzly.Task |
|---|
ACCEPT_TASK, PROCESSOR_TASK, READ_TASK |
| Constructor Summary | |
|---|---|
TaskBase()
|
|
| Method Summary | |
|---|---|
void |
addTaskListener(TaskListener task)
Add the given TaskListener to this Task. |
Object |
call()
By default, do nothing when a Callable is invoked. |
void |
cancelTask(String message,
String code)
Cancel the task. |
void |
clearTaskListeners()
Clean all the listeners of this Task |
void |
execute()
Execute the task based on its Pipeline. |
protected void |
fireTaskEvent(TaskEvent<?> event)
Notify listeners. |
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 is recyclable. |
RequestGroupInfo |
getRequestGroupInfo()
Gets the RequestGroupInfo from this task. |
SelectionKey |
getSelectionKey()
Return the SelectionKey associated with this task. |
SelectorThread |
getSelectorThread()
Return the SelectorThread |
Socket |
getSocket()
Return the current Socket used by this instance |
ArrayList |
getTaskListeners()
Return all listeners of this Task. |
int |
getType()
Return this Tash type. |
boolean |
isMonitoringEnabled()
Returns true if monitoring has been enabled, false
otherwise. |
void |
recycle()
Recycle internal state. |
void |
removeTaskListener(TaskListener task)
Remove the given TaskListener/code> from this
|
void |
run()
Some Pipeline implementation requires a instance of
Runnable instance. |
void |
setPipeline(Pipeline pipeline)
Set the pipeline on which Worker Threads will synchronize. |
void |
setRecycle(boolean recycle)
Declare whether this Task is recyclable. |
void |
setSelectionKey(SelectionKey key)
Set the SelectionKey |
void |
setSelectorThread(SelectorThread selectorThread)
Set the SelectorThread object. |
void |
taskEvent(TaskEvent event)
This method is invoked when a WorkerThread starts
processing a Task object. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface com.sun.enterprise.web.connector.grizzly.Task |
|---|
doTask |
| Field Detail |
|---|
protected int type
Task
instance.
protected ArrayList<TaskListener> listeners
protected Pipeline pipeline
Pipeline object associated with this
Task
protected SelectionKey key
SelectionKey used by this task.
protected boolean recycle
protected SelectorThread selectorThread
SelectorThread who created this task.
| 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 void setPipeline(Pipeline pipeline)
setPipeline in interface Taskpublic Pipeline getPipeline()
getPipeline in interface Taskpublic void setSelectionKey(SelectionKey key)
SelectionKey
setSelectionKey in interface Taskpublic SelectionKey getSelectionKey()
SelectionKey associated with this task.
getSelectionKey in interface Taskpublic RequestGroupInfo getRequestGroupInfo()
RequestGroupInfo from this task.
getRequestGroupInfo in interface Taskpublic boolean isMonitoringEnabled()
true if monitoring has been enabled, false
otherwise.
isMonitoringEnabled in interface Taskpublic KeepAliveStats getKeepAliveStats()
KeepAliveStats associated with this task.
getKeepAliveStats in interface Taskpublic void execute()
Pipeline. If the
Pipeline is null, then execute the task on using the
calling thread.
execute in interface Taskpublic void addTaskListener(TaskListener task)
TaskListener to this Task.
addTaskListener in interface Taskpublic void removeTaskListener(TaskListener task)
TaskListener/code> from this
Task.
- Specified by:
removeTaskListener in interface Task
public void clearTaskListeners()
Task
clearTaskListeners in interface Taskprotected void fireTaskEvent(TaskEvent<?> event)
public void recycle()
recycle in interface Taskpublic ArrayList getTaskListeners()
Task.
getTaskListeners in interface TaskTaskListener
instances registered with this Taskpublic void run()
Pipeline implementation requires a instance of
Runnable instance.
run in interface Runnablepublic void setRecycle(boolean recycle)
Task is recyclable. If so, this
Task will be recycled after every invocation of
doTask().
setRecycle in interface Taskpublic boolean getRecycle()
true if this Task is recyclable.
getRecycle in interface Taskpublic Socket getSocket()
Socket used by this instance
Socket used by this instance
public void cancelTask(String message,
String code)
cancelTask in interface Taskmessage - the HTTP message to included within the html pagecode - The http code to use. If null, automatically close the
connection without sending an error page.
public Object call()
throws Exception
Callable is invoked.
call in interface CallableExceptionpublic void taskEvent(TaskEvent event)
TaskListenerWorkerThread starts
processing a Task object.
taskEvent in interface TaskListener
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||