Author:
A thread pool for executing non-GUI related tasks in a separate thread, avoiding blocking the GUI.
The pool working by adding "requests", which are instances of java.lang.Runnable, which are then picked up by the running worker threads and executed asynchronously. By adding a collection of requests instead of a single request the user forces the pool to create enough threads to handle all the requests simultaneouslty, so that tasks that need this functionality (such as reading from forked processes) can be easily run using this mechanism.
Normally plugins use the "single request" add method, which means that only one worker thread will be created. The caller can force new threads to be created by first calling the class's "ensureCapacity(int)" method, which will guarantee that at least the number of requested worker threads are running.
This is a simplified version of Java 5's ThreadPoolExecutor, and also provides a simplified version of the "Future" class (called "WorkRequest"). Callers can use the WorkRequest instances returned by the pool to control when the requests are finished.