public interface Worker
RenderingJob
and notify its WorkerMonitor when completed.
When no work is available, the worker simply sets itself in a waiting mode
pending reactivation by the WorkerMonitor.Modifier and Type | Method and Description |
---|---|
Runnable |
getJob()
Retrieves the job to execute for this worker
|
int |
getJobCount()
Return the count of jobs this worker is processing
|
void |
resetJobCount()
Reset the processed job counter
|
void |
setJob(Runnable job)
Sets the job to execute
|
void |
setJob(Runnable job,
AccessControlContext context)
Deprecated.
Use only
setJob(Runnable) because AccessControlContext must not be directly accessed by
a worker thread. Instead AccessControlContext must be accessed directly by the job implementation in order
to use the AccessControlContext instance safely regardless of the physical worker thread implementation
(e.g, WorkerImpl or container managed thread by commonj worker monitor). |
void |
setMonitor(WorkerMonitor monitor)
Sets the WorkMonitor for this worker
|
void |
setRunning(boolean status)
Sets the running status of this Worker.
|
void |
start()
Start executing the job on this worker thread
|
int getJobCount()
void resetJobCount()
void setRunning(boolean status)
status
- set to true to set this worker to running, false to turn off runningvoid setMonitor(WorkerMonitor monitor)
monitor
- the WorkerMonitor who is monitoring this workervoid setJob(Runnable job, AccessControlContext context)
setJob(Runnable)
because AccessControlContext must not be directly accessed by
a worker thread. Instead AccessControlContext must be accessed directly by the job implementation in order
to use the AccessControlContext instance safely regardless of the physical worker thread implementation
(e.g, WorkerImpl or container managed thread by commonj worker monitor).job
- the job to runvoid setJob(Runnable job)
job
- the job to execute for this workerRunnable getJob()
void start()
Copyright © 1999–2016 The Apache Software Foundation. All rights reserved.