Class CmsScheduleManager

  • All Implemented Interfaces:
    org.quartz.Job

    public class CmsScheduleManager
    extends java.lang.Object
    implements org.quartz.Job
    Manages the OpenCms scheduled jobs.

    Please see the documentation of the class CmsScheduledJobInfo for a full description of the OpenCms scheduling capabilities.

    The OpenCms scheduler implementation internally uses the Quartz scheduler from the OpenSymphony project.

    This manager class implements the org.quartz.Job interface and wraps all calls to the I_CmsScheduledJob implementing classes.

    Since:
    6.0.0
    See Also:
    CmsScheduledJobInfo
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String SCHEDULER_JOB_INFO
      Key for the scheduled job description in the job data map.
    • Constructor Summary

      Constructors 
      Constructor Description
      CmsScheduleManager()
      Default constructor for the scheduler manager, used only when a new job is scheduled.
      CmsScheduleManager​(java.util.List<CmsScheduledJobInfo> configuredJobs)
      Used by the configuration to create a new Scheduler during system startup.
    • Constructor Detail

      • CmsScheduleManager

        public CmsScheduleManager()
        Default constructor for the scheduler manager, used only when a new job is scheduled.

      • CmsScheduleManager

        public CmsScheduleManager​(java.util.List<CmsScheduledJobInfo> configuredJobs)
        Used by the configuration to create a new Scheduler during system startup.

        Parameters:
        configuredJobs - the jobs from the configuration
    • Method Detail

      • execute

        public void execute​(org.quartz.JobExecutionContext context)
        Implementation of the Quartz job interface.

        The architecture is that this scheduler manager generates a new (empty) instance of itself for every OpenCms job scheduled with Quartz. When the Quartz job is executed, the configured implementation of I_CmsScheduledJob will be called from this method.

        Specified by:
        execute in interface org.quartz.Job
        See Also:
        Job.execute(org.quartz.JobExecutionContext)
      • executeDirectly

        public void executeDirectly​(java.lang.String jobId)
        Given a job ID, this directly executes the corresponding job.

        Parameters:
        jobId - the job id
      • getJob

        public CmsScheduledJobInfo getJob​(java.lang.String id)
        Returns the currently scheduled job description identified by the given id.
        Parameters:
        id - the job id
        Returns:
        a job or null if not found
      • getJobs

        public java.util.List<CmsScheduledJobInfogetJobs()
        Returns the currently scheduled job descriptions in an unmodifiable list.

        The objects in the List are of type CmsScheduledJobInfo.

        Returns:
        the currently scheduled job descriptions in an unmodifiable list
      • shutDown

        public void shutDown()
        Shuts down this instance of the OpenCms scheduler manager.