|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.jetspeed.scheduler.AbstractScheduler
public abstract class AbstractScheduler
Service for a cron like scheduler.
Nested Class Summary | |
---|---|
protected class |
AbstractScheduler.MainLoop
Inner class. |
Field Summary | |
---|---|
private static org.apache.commons.logging.Log |
log
|
protected AbstractScheduler.MainLoop |
mainLoop
The main loop for starting jobs. |
protected JobQueue |
scheduleQueue
The queue. |
protected Thread |
thread
The thread used to process commands. |
Fields inherited from interface org.apache.jetspeed.scheduler.Scheduler |
---|
SERVICE_NAME |
Constructor Summary | |
---|---|
AbstractScheduler()
Creates a new instance. |
Method Summary | |
---|---|
abstract void |
addJob(JobEntry je)
Add a new job to the queue. |
private void |
clearThread()
Set thread to null to indicate termination. |
abstract JobEntry |
getJob(int oid)
Get a specific Job from Storage. |
Thread |
getThread()
Return the thread being used to process commands, or null if there is no such thread. |
List |
listJobs()
List jobs in the queue. |
private JobEntry |
nextJob()
Return the next Job to execute, or null if thread is interrupted. |
abstract void |
removeJob(JobEntry je)
Remove a job from the queue. |
void |
restart()
Start (or restart) a thread to process commands, or wake up an existing thread if one is already running. |
void |
start()
|
void |
stop()
|
abstract void |
updateJob(JobEntry je)
Modify a Job. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final org.apache.commons.logging.Log log
protected JobQueue scheduleQueue
protected AbstractScheduler.MainLoop mainLoop
protected Thread thread
Constructor Detail |
---|
public AbstractScheduler()
Method Detail |
---|
public void start()
public void stop()
public abstract JobEntry getJob(int oid) throws Exception
getJob
in interface Scheduler
oid
- The int id for the job.
Exception,
- a generic exception.
Exception
public abstract void addJob(JobEntry je) throws Exception
addJob
in interface Scheduler
je
- A JobEntry with the job to add.
Exception,
- a generic exception.
Exception
public abstract void removeJob(JobEntry je) throws Exception
removeJob
in interface Scheduler
je
- A JobEntry with the job to remove.
Exception,
- a generic exception.
Exception
public abstract void updateJob(JobEntry je) throws Exception
updateJob
in interface Scheduler
je
- A JobEntry with the job to modify
Exception,
- a generic exception.
Exception
public List listJobs()
listJobs
in interface Scheduler
public Thread getThread()
private void clearThread()
public void restart()
private JobEntry nextJob() throws Exception
Exception,
- a generic exception.
Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |