|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jboss.util.threadpool.BasicTaskWrapper
A wrapper for the task.
Field Summary | |
static int |
TASK_ACCEPTED
The task has been accepted |
static int |
TASK_COMPLETED
The task has completed |
static int |
TASK_NOT_ACCEPTED
The task has not been accepted |
static int |
TASK_REJECTED
The task was rejected |
static int |
TASK_STARTED
The task has been started |
static int |
TASK_STOPPED
The task has been stopped |
Constructor Summary | |
protected |
BasicTaskWrapper()
Create a task wrapper without a task |
|
BasicTaskWrapper(Task task)
Create a new task wrapper |
Method Summary | |
void |
acceptTask()
The task has been accepted |
protected long |
getElapsedTime()
Calculate the elapsed time since the task was started |
long |
getTaskCompletionTimeout()
The time before the task must be completed |
int |
getTaskPriority()
The priority of the task |
long |
getTaskStartTimeout()
The time before the task must be accepted |
int |
getTaskWaitType()
Get the type of wait |
boolean |
isComplete()
Indicate if the task has exited the Runnable#run method |
void |
rejectTask(RuntimeException e)
The task has been rejected |
void |
run()
Called by the thread pool executor |
protected void |
setTask(Task task)
Set thetask for this wrapper |
void |
stopTask()
Invoked by the threadpool when it wants to stop the task |
protected boolean |
taskAccepted()
Notify the task it has been accepted |
protected boolean |
taskCompleted(Throwable throwable)
Notify the task it has completed |
protected boolean |
taskRejected(RuntimeException e)
Notify the task it has been rejected |
protected boolean |
taskStarted()
Notify the task it has started |
protected boolean |
taskStop()
Stop the task |
void |
waitForTask()
Wait according the wait type |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int TASK_NOT_ACCEPTED
public static final int TASK_ACCEPTED
public static final int TASK_STARTED
public static final int TASK_COMPLETED
public static final int TASK_REJECTED
public static final int TASK_STOPPED
Constructor Detail |
protected BasicTaskWrapper()
public BasicTaskWrapper(Task task)
task
- the task
IllegalArgumentException
- for a null taskMethod Detail |
public int getTaskWaitType()
TaskWrapper
getTaskWaitType
in interface TaskWrapper
public int getTaskPriority()
TaskWrapper
getTaskPriority
in interface TaskWrapper
public long getTaskStartTimeout()
TaskWrapper
getTaskStartTimeout
in interface TaskWrapper
public long getTaskCompletionTimeout()
TaskWrapper
getTaskCompletionTimeout
in interface TaskWrapper
public void acceptTask()
TaskWrapper
acceptTask
in interface TaskWrapper
public void rejectTask(RuntimeException e)
TaskWrapper
rejectTask
in interface TaskWrapper
e
- any error associated with the rejectionpublic boolean isComplete()
TaskWrapper
isComplete
in interface TaskWrapper
public void stopTask()
TaskWrapper
stopTask
in interface TaskWrapper
public void waitForTask()
TaskWrapper
waitForTask
in interface TaskWrapper
public void run()
protected void setTask(Task task)
task
- the taskprotected boolean taskAccepted()
protected boolean taskRejected(RuntimeException e)
e
- any error associated with the rejection
protected boolean taskStarted()
protected boolean taskCompleted(Throwable throwable)
throwable
- any throwable associated with the completion
protected boolean taskStop()
protected long getElapsedTime()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |