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 Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
static boolean
existedJob
(DynamicJob job) Checking the job is existed or not 检查JOB是否存在static boolean
pauseJob
(DynamicJob existJob) Pause exist job 暂停已经存在的JOBstatic boolean
registerJob
(DynamicJob job) Register a job 添加(注册)一个动态的JOBstatic boolean
removeJob
(DynamicJob existJob) Remove exists job 删除一个已经存在的JOBstatic boolean
resumeJob
(DynamicJob existJob) Resume exist job 重启一个JOBvoid
setScheduler
(org.quartz.Scheduler scheduler)
-
Constructor Details
-
DynamicSchedulerFactory
public DynamicSchedulerFactory()
-
-
Method Details
-
registerJob
Register a job 添加(注册)一个动态的JOB- Parameters:
job
- DynamicJob- Returns:
- True is register successful
- Throws:
org.quartz.SchedulerException
- e
-
pauseJob
Pause exist job 暂停已经存在的JOB- Throws:
org.quartz.SchedulerException
-
resumeJob
Resume exist job 重启一个JOB- Throws:
org.quartz.SchedulerException
-
existedJob
Checking the job is existed or not 检查JOB是否存在- Parameters:
job
- Job- Returns:
- True is existed, otherwise false
- Throws:
org.quartz.SchedulerException
- e
-
removeJob
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
- Specified by:
afterPropertiesSet
in interfaceorg.springframework.beans.factory.InitializingBean
- Throws:
Exception
-