Package org.jboss.util.threadpool
Interface ThreadPool
-
- All Known Implementing Classes:
BasicThreadPool
public interface ThreadPoolA thread pool.- Version:
- $Revision$
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidrun(java.lang.Runnable runnable)Run a runnablevoidrun(java.lang.Runnable runnable, long startTimeout, long completeTimeout)Run runnable with start and complete time out set explicitely.voidrunTask(Task task)Run a taskvoidrunTaskWrapper(TaskWrapper wrapper)Run a task wrappervoidstop(boolean immediate)Stop the poolvoidwaitForTasks()Wait on the queued tasks to complete.voidwaitForTasks(long maxWaitTime)Wait on the queued tasks to complete upto maxWaitTime milliseconds.
-
-
-
Method Detail
-
stop
void stop(boolean immediate)
Stop the pool- Parameters:
immediate- whether to shutdown immediately
-
waitForTasks
void waitForTasks() throws java.lang.InterruptedExceptionWait on the queued tasks to complete. This can only be called after stop.- Throws:
java.lang.InterruptedException- for any iterruption error
-
waitForTasks
void waitForTasks(long maxWaitTime) throws java.lang.InterruptedExceptionWait on the queued tasks to complete upto maxWaitTime milliseconds. This can only be called after stop.- Parameters:
maxWaitTime- the max wait time- Throws:
java.lang.InterruptedException- for any interruption error
-
runTaskWrapper
void runTaskWrapper(TaskWrapper wrapper)
Run a task wrapper- Parameters:
wrapper- the task wrapper
-
runTask
void runTask(Task task)
Run a task- Parameters:
task- the task- Throws:
java.lang.IllegalArgumentException- for a null task
-
run
void run(java.lang.Runnable runnable)
Run a runnable- Parameters:
runnable- the runnable- Throws:
java.lang.IllegalArgumentException- for a null runnable
-
run
void run(java.lang.Runnable runnable, long startTimeout, long completeTimeout)Run runnable with start and complete time out set explicitely.- Parameters:
runnable- the runnablestartTimeout- the start timeoutcompleteTimeout- the complete timeout- Throws:
java.lang.IllegalArgumentException- for a null runnable
-
-