com.silverpeas.scheduler.simple
Class SimpleScheduler

java.lang.Object
  extended by com.silverpeas.scheduler.simple.SimpleScheduler
All Implemented Interfaces:
Scheduler

Deprecated.

@Deprecated
public class SimpleScheduler
extends Object
implements Scheduler

A simple scheduler implementation. It provides a easy way to schedule jobs at given moments in time. The job execution policy is provided by a job trigger, represented as a JobTrigger object; JobTrigger objects control when the job has to be executed in a repeatedly way. The execution of the job itself can be actually performed in two ways:


Constructor Summary
protected SimpleScheduler()
          Deprecated. The constructor is private because it will be created internal.
 
Method Summary
 boolean isJobScheduled(String jobName)
          Deprecated. Is the job identified by the specified name is scheduled by this scheduler?
 ScheduledJob scheduleJob(Job theJob, JobTrigger trigger)
          Deprecated. Schedules the specified job.
 ScheduledJob scheduleJob(Job theJob, JobTrigger trigger, SchedulerEventListener listener)
          Deprecated. Schedules the specified job.
 ScheduledJob scheduleJob(String jobName, JobTrigger trigger, SchedulerEventListener listener)
          Deprecated. 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()
          Deprecated. This method kills all active jobs.
 void unscheduleJob(String jobName)
          Deprecated. Unschedules the job with the specified name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleScheduler

protected SimpleScheduler()
Deprecated. 
The constructor is private because it will be created internal.

Method Detail

isJobScheduled

public boolean isJobScheduled(String jobName)
Deprecated. 
Is the job identified by the specified name is scheduled by this scheduler?

Specified by:
isJobScheduled in interface Scheduler
Parameters:
jobName - the job name.
Returns:
true if the job identified by the specified name is scheduled by this scheduler, false otherwise.

unscheduleJob

public void unscheduleJob(String jobName)
Deprecated. 
Unschedules the job with the specified name. If no job is scheduled under the specified name, nothing is done.

Specified by:
unscheduleJob in interface Scheduler
Parameters:
jobName - the name of the job to unschedule.

shutdown

public void shutdown()
Deprecated. 
This method kills all active jobs. The unique instance of the SimpleScheduler will be destroyed.

Specified by:
shutdown in interface Scheduler

scheduleJob

public ScheduledJob scheduleJob(String jobName,
                                JobTrigger trigger,
                                SchedulerEventListener listener)
                         throws SchedulerException
Deprecated. 
Description copied from interface: Scheduler
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. A scheduled job will be registered in the scheduler under the specified name and its execution will be fired by the specified trigger. The computation of the job will be delegated to the event listener when the associated trigger fires (it will recieve the event mapped with this trigger firing). If a job is already scheduled under the specified name, then a SchedulerException exception is thrown.

Specified by:
scheduleJob in interface Scheduler
Parameters:
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.
Returns:
the job scheduled in the scheduler.
Throws:
SchedulerException - if either a job is already scheduled under the specified name or if the job scheduling fails.

scheduleJob

public ScheduledJob scheduleJob(Job theJob,
                                JobTrigger trigger,
                                SchedulerEventListener listener)
                         throws SchedulerException
Deprecated. 
Description copied from interface: Scheduler
Schedules the specified job. It will be fired with the specified trigger and the specified event listener will recieve the events mapped with the state of the job execution. The specified job will be registered as a scheduled job in the scheduler under its name and its execution will be fired by the specified trigger. In the case an event listener is specified, it will recieve the events mapped with the state of the job execution. If a job is already scheduled under the same name of the specified job, then a SchedulerException exception is thrown.

Specified by:
scheduleJob in interface Scheduler
Parameters:
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.
Returns:
the job scheduled in the scheduler.
Throws:
SchedulerException - if either a job is already scheduled under the same name that the specified job or if the job scheduling fails.

scheduleJob

public ScheduledJob scheduleJob(Job theJob,
                                JobTrigger trigger)
                         throws SchedulerException
Deprecated. 
Description copied from interface: Scheduler
Schedules the specified job. It will be fired with the specified trigger. The specified job will be registered as a scheduled job in the scheduler under its name and its execution will be fired by the specified trigger. If a job is already scheduled under the same name of the specified job, then a SchedulerException exception is thrown.

Specified by:
scheduleJob in interface Scheduler
Parameters:
theJob - the job to schedule.
trigger - the trigger that will fire the job execution.
Returns:
the job scheduled in the scheduler.
Throws:
SchedulerException - if either a job is already scheduled under the same name that the specified job or if the job scheduling fails.


Copyright © 2016 Silverpeas. All Rights Reserved.