| java.lang.Object org.apache.jetspeed.scheduler.AbstractScheduler
All known Subclasses: org.apache.jetspeed.scheduler.MemoryBasedScheduler,
AbstractScheduler | abstract public class AbstractScheduler implements Scheduler(Code) | | Service for a cron like scheduler.
author: Dave Bryson version: $Id: AbstractScheduler.java 516448 2007-03-09 16:25:47Z ate $ |
Inner Class :protected class MainLoop implements Runnable | |
Method Summary | |
abstract public void | addJob(JobEntry je) Add a new job to the queue. | abstract public JobEntry | getJob(int oid) Get a specific Job from Storage.
Parameters: oid - The int id for the job. | public synchronized Thread | getThread() Return the thread being used to process commands, or null if
there is no such thread. | public List | listJobs() List jobs in the queue. | abstract public void | removeJob(JobEntry je) Remove a job from the queue. | public synchronized void | restart() Start (or restart) a thread to process commands, or wake up an
existing thread if one is already running. | public void | start() | public void | stop() | abstract public void | updateJob(JobEntry je) Modify a Job. |
mainLoop | protected MainLoop mainLoop(Code) | | The main loop for starting jobs.
|
thread | protected Thread thread(Code) | | The thread used to process commands.
|
AbstractScheduler | public AbstractScheduler()(Code) | | Creates a new instance.
|
addJob | abstract public void addJob(JobEntry je) throws Exception(Code) | | Add a new job to the queue. Before adding a job, calculate the runtime
to make sure the entry will be placed at the right order in the queue.
Parameters: je - A JobEntry with the job to add. exception: Exception - , a generic exception. |
getJob | abstract public JobEntry getJob(int oid) throws Exception(Code) | | Get a specific Job from Storage.
Parameters: oid - The int id for the job. A JobEntry. exception: Exception - , a generic exception. |
getThread | public synchronized Thread getThread()(Code) | | Return the thread being used to process commands, or null if
there is no such thread. You can use this to invoke any
special methods on the thread, for example, to interrupt it.
A Thread. |
listJobs | public List listJobs()(Code) | | List jobs in the queue. This is used by the scheduler UI.
A List of jobs. |
removeJob | abstract public void removeJob(JobEntry je) throws Exception(Code) | | Remove a job from the queue.
Parameters: je - A JobEntry with the job to remove. exception: Exception - , a generic exception. |
restart | public synchronized void restart()(Code) | | Start (or restart) a thread to process commands, or wake up an
existing thread if one is already running. This method can be
invoked if the background thread crashed due to an
unrecoverable exception in an executed command.
|
start | public void start()(Code) | | |
updateJob | abstract public void updateJob(JobEntry je) throws Exception(Code) | | Modify a Job.
Parameters: je - A JobEntry with the job to modify exception: Exception - , a generic exception. |
|
|