Interface IScheduler

All Known Implementing Classes:
DefaultScheduler

public interface IScheduler
This is the interface of the Blueriq Scheduler.

The IScheduler exposes the main methods for handling Jobs inside Blueriq application. This mantains a registry of Jobs and Triggers. Once a Job is registered, it is responsible to fire it's execution when the scheduling time arrives.

This Blueriq Scheduler interface is a wrapper upon the Quartz Scheduler which exposes the required methods for scheduling/unscheduling/starting/shutting down the quartz scheduler. The default implementation can be found in the DefaultScheduler class.

After a Scheduler has been created, it is in "stand-by" mode, and must have its startScheduler() method called before it will fire any Jobs. When the Scheduler is not needed it's execution can be fired down with the shutdownScheduler() method.

SchedulerJobConfiguration objects are created at runtime, by defining the necessary information (task id, job object, trigger parameters) to schedule a job instance wia the scheduleJob(SchedulerJobConfiguration) method. Jobs can be unscheduled when needed with the unscheduleJob(SchedulerJobConfiguration) method.

Since:
10.2
Author:
TimeaP
  • Method Details

    • scheduleJob

      void scheduleJob(SchedulerJobConfiguration schedulerJobConfiguration)
      Schedule a given job defined in SchedulerJobConfiguration with the related set of triggers from SchedulerJobConfiguration associated with it.
      Parameters:
      schedulerJobConfiguration - the configuration
    • startScheduler

      void startScheduler()
      This method starts the scheduler which assumes that the execution of its jobs can begin. Until this point, the scheduler will be in 'stand-by' mode.
    • shutdownScheduler

      void shutdownScheduler()
      This method stops the execution of all the jobs registered to the scheduler.
    • unscheduleJob

      void unscheduleJob(SchedulerJobConfiguration schedulerJobConfiguration)
      This method stops the execution of a certain job by unregistering its trigger(s) defined in SchedulerJobConfiguration. If the job has no other triggers, the job itself will be deleted as well.
      Parameters:
      schedulerJobConfiguration - the configuration
    • schedule

      IJobId schedule(Class<? extends IJob> jobClass, IJobParameters params, ISchedule schedule)
      This method schedules a job.
      Parameters:
      jobClass - the class of the job
      params - the parameters of the job
      schedule - the schedule of the job
      Returns:
      the id of the job
      Throws:
      SchedulerException - if the job can not be scheduled
    • unschedule

      void unschedule(IJobId jobId)
      This method unschedules a previously scheduled job
      Parameters:
      jobId - the ID of the job
    • reschedule

      void reschedule(IJobId jobId, ISchedule schedule)
      This method reschedules a job. The old schedule is replaced by the new schedule
      Parameters:
      jobId - the ID of the job
      schedule - the new schedule of the job
    • getScheduleBuilder

      IScheduleBuilder getScheduleBuilder()
      This method returns a schedule builder which can be used for creating ISchedule objects.
      Returns:
      the created scheduleBuilder
    • createJobParameters

      IJobParameters createJobParameters()
      This method creates the object representing the job parameters.
      Returns:
      a new job parameters object
    • updateJobData

      void updateJobData(SchedulerJobConfiguration config)
      This method updates the job data map with the new values sent in the parameter.
      Parameters:
      config - Job configuration with the new values.