org.jboss.util.threadpool
Interface ThreadPool

All Known Implementing Classes:
BasicThreadPool (src)

public interface ThreadPool

A thread pool.


Method Summary
 void run(java.lang.Runnable runnable)
          Run a runnable
 void run(java.lang.Runnable runnable, long startTimeout, long completeTimeout)
           
 void runTask(Task (src)  task)
          Run a task
 void runTaskWrapper(TaskWrapper (src)  wrapper)
          Run a task wrapper
 void stop(boolean immediate)
          Stop the pool
 void waitForTasks()
          Wait on the queued tasks to complete.
 void waitForTasks(long maxWaitTime)
          Wait on the queued tasks to complete upto maxWaitTime milliseconds.
 

Method Detail

stop

public void stop(boolean immediate)
Stop the pool

Parameters:
immediate - whether to shutdown immediately

waitForTasks

public void waitForTasks()
                  throws java.lang.InterruptedException
Wait on the queued tasks to complete. This can only be called after after stop.

Throws:
java.lang.InterruptedException

waitForTasks

public void waitForTasks(long maxWaitTime)
                  throws java.lang.InterruptedException
Wait on the queued tasks to complete upto maxWaitTime milliseconds. This can only be called after after stop.

Parameters:
maxWaitTime -
Throws:
java.lang.InterruptedException

runTaskWrapper

public void runTaskWrapper(TaskWrapper (src)  wrapper)
Run a task wrapper

Parameters:
wrapper - the task wrapper

runTask

public void runTask(Task (src)  task)
Run a task

Parameters:
task - the task
Throws:
java.lang.IllegalArgumentException - for a null task

run

public void run(java.lang.Runnable runnable)
Run a runnable

Parameters:
runnable - the runnable
Throws:
java.lang.IllegalArgumentException - for a null runnable

run

public void run(java.lang.Runnable runnable,
                long startTimeout,
                long completeTimeout)
Parameters:
runnable -
startTimeout -
completeTimeout -