public class RunnableTaskWrapper extends Object implements TaskWrapper
Constructor and Description |
---|
RunnableTaskWrapper(Runnable runnable)
Create a new RunnableTaskWrapper
|
RunnableTaskWrapper(Runnable runnable,
long startTimeout,
long completeTimeout) |
Modifier and Type | Method and Description |
---|---|
void |
acceptTask()
The task has been accepted
|
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()
Is the task complete.
|
void |
rejectTask(RuntimeException t)
The task has been rejected
|
void |
run() |
void |
stopTask()
Invoked by the threadpool when it wants to stop the task
|
void |
waitForTask()
Wait according the wait type
|
public RunnableTaskWrapper(Runnable runnable)
runnable
- the runnableIllegalArgumentException
- for a null runnablepublic RunnableTaskWrapper(Runnable runnable, long startTimeout, long completeTimeout)
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 t)
TaskWrapper
rejectTask
in interface TaskWrapper
t
- any error associated with the rejectionpublic void stopTask()
TaskWrapper
stopTask
in interface TaskWrapper
public void waitForTask()
TaskWrapper
waitForTask
in interface TaskWrapper
public boolean isComplete()
TaskWrapper
isComplete
in interface TaskWrapper
Copyright © 2018 JBoss by Red Hat. All rights reserved.