org.jfree.report.util
public class WorkerPool extends Object
Constructor Summary | |
---|---|
WorkerPool()
Creates a new worker pool with the default size of 10 workers and the default name. | |
WorkerPool(int size)
Creates a new workerpool with the given number of workers and the default name.
| |
WorkerPool(int size, String namePrefix)
Creates a new worker pool for the given number of workers and with the given name
prefix.
|
Method Summary | |
---|---|
void | finishAll()
Finishes all worker of this pool. |
WorkerHandle | getWorkerForWorkload(Runnable r)
Returns a workerhandle for the given workload. |
boolean | isWorkerAvailable()
Checks, whether workers are available.
|
void | workerAvailable(Worker worker)
Marks the given worker as available.
|
void | workerFinished(Worker worker)
Marks the given worker as finished. |
Parameters: size the maximum number of workers available.
Parameters: size the size of the worker pool. namePrefix the name prefix for all created workers.
Parameters: r the workload for the worker
Returns: a handle to the worker.
Returns: true, if at least one worker is idle, false otherwise.
Parameters: worker the worker which was available.
Parameters: worker the worker which was finished.