Package org.jboss.util.threadpool
Interface Task
-
public interface Task
A task for a thread pool.- Version:
- $Revision$
-
-
Field Summary
Fields Modifier and Type Field Description static int
WAIT_FOR_COMPLETE
Synchronized task, wait for task to completestatic int
WAIT_FOR_START
Synchronized start, wait for task to startstatic int
WAIT_NONE
Don't wait for task
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
accepted(long time)
The task has been acceptedvoid
completed(long time, java.lang.Throwable t)
The task has been completedvoid
execute()
Execute the tasklong
getCompletionTimeout()
The time before the task must be completedint
getPriority()
The priority of the tasklong
getStartTimeout()
The time before the task must be acceptedint
getWaitType()
Get the type of waitvoid
rejected(long time, java.lang.Throwable t)
The task has been rejectedvoid
started(long time)
The task has been startedvoid
stop()
Invoked by the threadpool when it wants to stop the task
-
-
-
Field Detail
-
WAIT_NONE
static final int WAIT_NONE
Don't wait for task- See Also:
- Constant Field Values
-
WAIT_FOR_START
static final int WAIT_FOR_START
Synchronized start, wait for task to start- See Also:
- Constant Field Values
-
WAIT_FOR_COMPLETE
static final int WAIT_FOR_COMPLETE
Synchronized task, wait for task to complete- See Also:
- Constant Field Values
-
-
Method Detail
-
getWaitType
int getWaitType()
Get the type of wait- Returns:
- the wait type
-
getPriority
int getPriority()
The priority of the task- Returns:
- the task priority
-
getStartTimeout
long getStartTimeout()
The time before the task must be accepted- Returns:
- the start timeout
-
getCompletionTimeout
long getCompletionTimeout()
The time before the task must be completed- Returns:
- the completion timeout
-
execute
void execute()
Execute the task
-
stop
void stop()
Invoked by the threadpool when it wants to stop the task
-
accepted
void accepted(long time)
The task has been accepted- Parameters:
time
- the time taken to accept the task
-
rejected
void rejected(long time, java.lang.Throwable t)
The task has been rejected- Parameters:
time
- the time taken to reject the taskt
- any error associated with the rejection
-
started
void started(long time)
The task has been started- Parameters:
time
- the time taken to start the task
-
completed
void completed(long time, java.lang.Throwable t)
The task has been completed- Parameters:
time
- the time taken to reject the taskt
- any error associated with the completion
-
-