Class DynamicSchedulerFactory

java.lang.Object
com.andaily.service.scheduler.dynamic.DynamicSchedulerFactory
All Implemented Interfaces:
org.springframework.beans.factory.InitializingBean

public final class DynamicSchedulerFactory extends Object implements org.springframework.beans.factory.InitializingBean
对JOb操作的核心类
Author:
Shengzhao Li
  • Constructor Details

    • DynamicSchedulerFactory

      public DynamicSchedulerFactory()
  • Method Details

    • registerJob

      public static boolean registerJob(DynamicJob job) throws org.quartz.SchedulerException
      Register a job 添加(注册)一个动态的JOB
      Parameters:
      job - DynamicJob
      Returns:
      True is register successful
      Throws:
      org.quartz.SchedulerException - e
    • pauseJob

      public static boolean pauseJob(DynamicJob existJob) throws org.quartz.SchedulerException
      Pause exist job 暂停已经存在的JOB
      Throws:
      org.quartz.SchedulerException
    • resumeJob

      public static boolean resumeJob(DynamicJob existJob) throws org.quartz.SchedulerException
      Resume exist job 重启一个JOB
      Throws:
      org.quartz.SchedulerException
    • existedJob

      public static boolean existedJob(DynamicJob job) throws org.quartz.SchedulerException
      Checking the job is existed or not 检查JOB是否存在
      Parameters:
      job - Job
      Returns:
      True is existed, otherwise false
      Throws:
      org.quartz.SchedulerException - e
    • removeJob

      public static boolean removeJob(DynamicJob existJob) throws org.quartz.SchedulerException
      Remove exists job 删除一个已经存在的JOB
      Parameters:
      existJob - A DynamicJob which exists in Scheduler
      Returns:
      True is remove successful
      Throws:
      org.quartz.SchedulerException - e
    • setScheduler

      public void setScheduler(org.quartz.Scheduler scheduler)
    • afterPropertiesSet

      public void afterPropertiesSet() throws Exception
      Specified by:
      afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
      Throws:
      Exception