|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Scheduler
It is the main interface of a Silverpeas scheduler. It provides the features needed by Silverpeas components to schedule some jobs at given moments in time or at regular time. A Scheduler object should maintain a registry of Job and Trigger instances. Once registered, the scheduler is responsible for executing the jobs when their associated trigger fires (when their scheduled time arrives). A job can be executed in a two ways: by an event listener at trigger firing event reception or by a Job object carrying the operation to run. A listener of scheduler's events can be specified at job registering to handle, for example, the status of the job execution or to perform some non-business operations out of the job. Scheduler instances are produced by a SchedulerFactory that encapsulates the actual backend used to implement the scheduling system. Whatever the instances returned by the factory, they share a single entry point to the scheduling backend so that a job scheduled with an instance can be found with another one.
Method Summary | |
---|---|
boolean |
isJobScheduled(String jobName)
Is the job identified by the specified name is scheduled by this scheduler? |
ScheduledJob |
scheduleJob(Job theJob,
JobTrigger trigger)
Schedules the specified job. |
ScheduledJob |
scheduleJob(Job theJob,
JobTrigger trigger,
SchedulerEventListener listener)
Schedules the specified job. |
ScheduledJob |
scheduleJob(String jobName,
JobTrigger trigger,
SchedulerEventListener listener)
Schedules a job under the specified name, that will be fired with the specified trigger, and by setting the specified listener to recieve the events mapped with the job execution state. |
void |
shutdown()
Shutdowns this scheduler. |
void |
unscheduleJob(String jobName)
Unschedules the job with the specified name. |
Method Detail |
---|
ScheduledJob scheduleJob(String jobName, JobTrigger trigger, SchedulerEventListener listener) throws SchedulerException
jobName
- the name under which the job should be registered in this scheduler.trigger
- the trigger that will command the job execution in the timeline.listener
- a listener of scheduler's events. It will recieve the different events fired by
the scheduler and mapped with the job execution state. It is expected it will accomplish the
job itself at trigger firing. It is required.
SchedulerException
- if either a job is already scheduled under the specified name or if
the job scheduling fails.ScheduledJob scheduleJob(Job theJob, JobTrigger trigger, SchedulerEventListener listener) throws SchedulerException
theJob
- the job to schedule.trigger
- the trigger that will fire the job execution.listener
- a listener of scheduler's events mapped with the state of the job execution.
Null means no listener to register with the job.
SchedulerException
- if either a job is already scheduled under the same name that the
specified job or if the job scheduling fails.ScheduledJob scheduleJob(Job theJob, JobTrigger trigger) throws SchedulerException
theJob
- the job to schedule.trigger
- the trigger that will fire the job execution.
SchedulerException
- if either a job is already scheduled under the same name that the
specified job or if the job scheduling fails.void unscheduleJob(String jobName) throws SchedulerException
jobName
- the name of the job to unschedule.
SchedulerException
- if the specified job cannot be unscheduled.boolean isJobScheduled(String jobName)
jobName
- the job name.
void shutdown() throws SchedulerException
SchedulerException
- if the scheduler shutdown failed.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |