org.jfree.report.util
public final class Worker extends Thread
Constructor Summary | |
---|---|
Worker()
Creates a new worker. |
Method Summary | |
---|---|
void | finish()
Kills the worker after he completed his work. |
WorkerPool | getWorkerPool()
Returns the worker's assigned pool.
|
Runnable | getWorkload()
Returns the workload object.
|
boolean | isAvailable()
Checks, whether this worker has some work to do.
|
boolean | isFinish()
Checks whether this worker has received the signal to finish and die.
|
void | run()
If a workload is set, process it. |
void | setWorkerPool(WorkerPool workerPool)
Defines the worker's assigned pool.
|
void | setWorkload(Runnable r)
Set the next workload for this worker.
|
Returns: the worker pool (or null, if the worker is not assigned to a pool).
Returns: the runnable executed by this worker thread.
Returns: true, if this worker has no more work and is currently sleeping.
Returns: true, if the worker should finish the work and end the thread.
Parameters: workerPool the worker pool (or null, if the worker is not assigned to a pool).
Parameters: r the next workload for the worker.
Throws: IllegalStateException if the worker is not idle.