public class SchedulerUtilQuartzImpl extends Object implements SchedulerUtil
Modifier and Type | Field and Description |
---|---|
static String |
FIXED_DELAY_ENABLED |
static String |
FIXED_DELAY_TIME_UNIT |
static String |
FIXED_DELAY_VALUE |
static String |
RUN_METHOD_NAME |
static String |
RUN_METHOD_PARAM |
static String |
RUN_METHOD_PARAM_TYPE |
static String |
RUNNABLE_INSTANCE |
Constructor and Description |
---|
SchedulerUtilQuartzImpl() |
Modifier and Type | Method and Description |
---|---|
void |
create()
This method is called upon the bean creation as part
of the management Service bean lifecycle.
|
void |
deleteJob(String jobId)
Delete the identified Job from the Scheduler
|
static Date |
getFutureDate(long delay,
TimeUnit timeUnit) |
static SchedulerUtil |
getInstance()
Returns the single instance of this Class.
|
org.quartz.Scheduler |
getRawScheduler() |
void |
pauseJob(String jobId)
pauses a job with the given jobId assuming the job is in the default
quartz group
|
void |
rescheduleAJob(String oldTriggerName,
String oldTriggerGroup,
org.quartz.Trigger newTrigger)
reschedule the job associated with the given old trigger with the new
trigger.
|
void |
resumeJob(String jobId)
resume a job with the given jobId assuming the job is in the default
quartz group
|
String |
scheduleACronJob(Object instance,
String methodName,
Class[] inputTypes,
Object[] inputParams,
String cronExpression)
schedules a cron job.
|
String |
scheduleAFixedDelayJob(Object instance,
String methodName,
Class[] inputTypes,
Object[] inputParams,
long initialDelay,
long taskDelay,
TimeUnit timeUnit)
schedules a fixed delay job.
|
String |
scheduleAOneTimeJob(Object instance,
String methodName,
Class[] inputTypes,
Object[] inputParams,
long initialDelay,
TimeUnit timeUnit)
schedules a one time job.
|
void |
setup() |
void |
shutDown()
Halts the Scheduler, and cleans up all resources associated with the
Scheduler.
|
void |
teardown() |
public static final String RUNNABLE_INSTANCE
public static final String RUN_METHOD_NAME
public static final String RUN_METHOD_PARAM_TYPE
public static final String RUN_METHOD_PARAM
public static final String FIXED_DELAY_ENABLED
public static final String FIXED_DELAY_VALUE
public static final String FIXED_DELAY_TIME_UNIT
@PostConstruct public void create()
create
in interface SchedulerUtil
public void setup()
@PreDestroy public void teardown()
public static SchedulerUtil getInstance()
public String scheduleAFixedDelayJob(Object instance, String methodName, Class[] inputTypes, Object[] inputParams, long initialDelay, long taskDelay, TimeUnit timeUnit)
scheduleAFixedDelayJob
in interface SchedulerUtil
instance
- - the instance to activate the method on timeoutmethodName
- - the name of the method to activate on the instanceinputTypes
- - the method input typesinputParams
- - the method input parametersinitialDelay
- - the initial delay before the first activationtaskDelay
- - the delay between jobstimeUnit
- - the unit of time used for initialDelay and taskDelay.public String scheduleAOneTimeJob(Object instance, String methodName, Class[] inputTypes, Object[] inputParams, long initialDelay, TimeUnit timeUnit)
scheduleAOneTimeJob
in interface SchedulerUtil
instance
- - the instance to activate the method on timeoutmethodName
- - the name of the method to activate on the instanceinputTypes
- - the method input typesinputParams
- - the method input parametersinitialDelay
- - the initial delay before the job activationtimeUnit
- - the unit of time used for initialDelay and taskDelay.public String scheduleACronJob(Object instance, String methodName, Class[] inputTypes, Object[] inputParams, String cronExpression)
scheduleACronJob
in interface SchedulerUtil
instance
- - the instance to activate the method on timeoutmethodName
- - the name of the method to activate on the instanceinputTypes
- - the method input typesinputParams
- - the method input parameterscronExpression
- - cron expression to run this jobpublic void rescheduleAJob(String oldTriggerName, String oldTriggerGroup, org.quartz.Trigger newTrigger)
rescheduleAJob
in interface SchedulerUtil
oldTriggerName
- - the name of the trigger to remove.oldTriggerGroup
- - the group of the trigger to remove.newTrigger
- - the new Trigger to associate the job withpublic void pauseJob(String jobId)
pauseJob
in interface SchedulerUtil
jobId
- public void deleteJob(String jobId)
deleteJob
in interface SchedulerUtil
jobId
- - the id of the job to deletepublic void resumeJob(String jobId)
resumeJob
in interface SchedulerUtil
jobId
- public void shutDown()
shutDown
in interface SchedulerUtil
Scheduler.shutdown(boolean waitForJobsToComplete)
public org.quartz.Scheduler getRawScheduler()
getRawScheduler
in interface SchedulerUtil
Copyright © 2012. All Rights Reserved.