|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.lang.Thread org.apache.jetspeed.aggregator.impl.WorkerImpl
public class WorkerImpl
Worker thread processes jobs 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
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.lang.Thread |
---|
Thread.State, Thread.UncaughtExceptionHandler |
Field Summary | |
---|---|
private AccessControlContext |
context
Context to process job within |
private Runnable |
job
Job to process |
private int |
jobCount
Counter of consecutive jobs that can be processed before the worker being actually put back on the idle queue |
protected static org.apache.commons.logging.Log |
log
Commons logging |
private org.apache.jetspeed.aggregator.WorkerMonitor |
monitor
Monitor for this Worker |
private boolean |
running
Running status of this worker |
Fields inherited from class java.lang.Thread |
---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
---|---|
WorkerImpl(org.apache.jetspeed.aggregator.WorkerMonitor monitor)
|
|
WorkerImpl(org.apache.jetspeed.aggregator.WorkerMonitor monitor,
ThreadGroup tg,
String name)
|
Method Summary | |
---|---|
Runnable |
getJob()
Retrieves the job to execute |
int |
getJobCount()
Return the number of jobs processed by this worker since the last time it has been on the idle queue |
void |
resetJobCount()
Reset the processed job counter |
void |
run()
Process the job assigned, then notify Monitor. |
void |
setJob(Runnable job)
Sets the job to execute |
void |
setJob(Runnable job,
AccessControlContext context)
Sets the job to execute in security context |
void |
setMonitor(org.apache.jetspeed.aggregator.WorkerMonitor monitor)
Sets the moitor of this worker |
void |
setRunning(boolean status)
Sets the running status of this Worker. |
Methods inherited from class java.lang.Thread |
---|
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.apache.jetspeed.aggregator.Worker |
---|
start |
Field Detail |
---|
protected static final org.apache.commons.logging.Log log
private boolean running
private int jobCount
private Runnable job
private AccessControlContext context
private org.apache.jetspeed.aggregator.WorkerMonitor monitor
Constructor Detail |
---|
public WorkerImpl(org.apache.jetspeed.aggregator.WorkerMonitor monitor)
public WorkerImpl(org.apache.jetspeed.aggregator.WorkerMonitor monitor, ThreadGroup tg, String name)
Method Detail |
---|
public int getJobCount()
getJobCount
in interface org.apache.jetspeed.aggregator.Worker
public void resetJobCount()
resetJobCount
in interface org.apache.jetspeed.aggregator.Worker
public void setRunning(boolean status)
setRunning
in interface org.apache.jetspeed.aggregator.Worker
public void setMonitor(org.apache.jetspeed.aggregator.WorkerMonitor monitor)
setMonitor
in interface org.apache.jetspeed.aggregator.Worker
public void setJob(Runnable job, AccessControlContext context)
setJob
in interface org.apache.jetspeed.aggregator.Worker
public void setJob(Runnable job)
setJob
in interface org.apache.jetspeed.aggregator.Worker
public Runnable getJob()
getJob
in interface org.apache.jetspeed.aggregator.Worker
public void run()
run
in interface Runnable
run
in class Thread
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |