| java.lang.Object org.jfree.report.util.WorkerPool
WorkerPool | public class WorkerPool (Code) | | A simple static workpool. Worker threads are created when necessary.
author: Thomas Morgner |
Constructor Summary | |
public | WorkerPool() Creates a new worker pool with the default size of 10 workers and the default name. | public | WorkerPool(int size) Creates a new workerpool with the given number of workers and the default name. | public | WorkerPool(int size, String namePrefix) Creates a new worker pool for the given number of workers and with the given name
prefix. |
WorkerPool | public WorkerPool()(Code) | | Creates a new worker pool with the default size of 10 workers and the default name.
|
WorkerPool | public WorkerPool(int size)(Code) | | Creates a new workerpool with the given number of workers and the default name.
Parameters: size - the maximum number of workers available. |
WorkerPool | public WorkerPool(int size, String namePrefix)(Code) | | Creates a new worker pool for the given number of workers and with the given name
prefix.
Parameters: size - the size of the worker pool. Parameters: namePrefix - the name prefix for all created workers. |
finishAll | public void finishAll()(Code) | | Finishes all worker of this pool.
|
getWorkerForWorkload | public synchronized WorkerHandle getWorkerForWorkload(Runnable r)(Code) | | Returns a workerhandle for the given workload. This method will wait until an idle
worker is found.
Parameters: r - the workload for the worker a handle to the worker. |
isWorkerAvailable | public synchronized boolean isWorkerAvailable()(Code) | | Checks, whether workers are available.
true, if at least one worker is idle, false otherwise. |
workerAvailable | public synchronized void workerAvailable(Worker worker)(Code) | | Marks the given worker as available.
Parameters: worker - the worker which was available. |
workerFinished | public void workerFinished(Worker worker)(Code) | | Marks the given worker as finished. The worker will be removed from the list of the
available workers.
Parameters: worker - the worker which was finished. |
|
|