| |
|
| java.lang.Object org.apache.jetspeed.aggregator.impl.WorkerMonitorImpl
WorkerMonitorImpl | public class WorkerMonitorImpl implements WorkerMonitor(Code) | | The WorkerMonitor is responsible for dispatching jobs to workers
It uses an Apache HTTPd configuration style of min/max/spare workers
threads to throttle the rendering work.
If jobs come in faster that processing, they are stored in a queue
which is flushed periodically by a QueueMonitor.
author: Rapha\u00ebl Luta author: David Sean Taylor version: $Id: WorkerMonitorImpl.java 591867 2007-11-05 02:20:06Z woonsan $ |
Inner Class :class RenderingJobTimeoutMonitor extends Thread | |
Constructor Summary | |
public | WorkerMonitorImpl(int minWorkers, int maxWorkers, int spareWorkers, int maxJobsPerWorker) |
ACCESS_CONTROL_CONTEXT_WORKER_ATTR | final public static String ACCESS_CONTROL_CONTEXT_WORKER_ATTR(Code) | | |
jobMonitor | protected RenderingJobTimeoutMonitor jobMonitor(Code) | | Renering Job Timeout monitor
|
log | final protected static Log log(Code) | | Commons logging
|
maxJobsPerWorker | protected int maxJobsPerWorker(Code) | | Maximum of job processed by a worker before being released
|
maxWorkers | protected int maxWorkers(Code) | | Maximum number of workers
|
minWorkers | protected int minWorkers(Code) | | Minimum number of wokers to create
|
runningJobs | protected int runningJobs(Code) | | Count of running jobs *
|
sCount | protected static long sCount(Code) | | Static counters for identifying workers
|
spareWorkers | protected int spareWorkers(Code) | | Minimum amount of spare workers
|
workers | protected Stack workers(Code) | | Stack containing currently idle workers
|
workersMonitored | protected List workersMonitored(Code) | | Workers to be monitored for timeout checking
|
WorkerMonitorImpl | public WorkerMonitorImpl(int minWorkers, int maxWorkers, int spareWorkers, int maxJobsPerWorker)(Code) | | |
addWorkers | protected synchronized void addWorkers(int wCount)(Code) | | Create the request number of workers and add them to
list of available workers.
Parameters: wCount - the number of workers to create |
getAvailableJobsCount | public int getAvailableJobsCount()(Code) | | Returns a snapshot of the available jobs
available jobs |
getQueuedJobsCount | public int getQueuedJobsCount()(Code) | | |
getRunningJobsCount | public int getRunningJobsCount()(Code) | | |
getWorker | protected Worker getWorker()(Code) | | Retrieves an idle worker
a Worker from the idle pool or null if non available |
process | public void process(RenderingJob job)(Code) | | Assign a job to a worker and execute it or queue the job if no
worker is available.
Parameters: job - the Job to process |
release | protected void release(Worker worker)(Code) | | Put back the worker in the idle queue unless there are pending jobs and
worker can still be committed to a new job before being released.
|
start | public void start()(Code) | | |
waitForRenderingJobs | public void waitForRenderingJobs(List renderingJobs)(Code) | | Wait for all rendering jobs in the collection to finish successfully or otherwise.
Parameters: renderingJobs - the Collection of rendering job objects to wait for. |
|
|
|