public class SundialJobScheduler extends Object
| Constructor and Description |
|---|
SundialJobScheduler() |
| Modifier and Type | Method and Description |
|---|---|
static void |
addCronTrigger(String triggerName,
String jobName,
String cronExpression) |
static void |
addCronTrigger(String triggerName,
String jobName,
String cronExpression,
Date startTime,
Date endTime) |
static void |
addJob(String jobName,
Class<? extends Job> jobClass)
Adds a Job to the scheduler.
|
static void |
addJob(String jobName,
Class<? extends Job> jobClass,
Map<String,Object> params,
boolean isConcurrencyAllowed)
Adds a Job to the scheduler.
|
static void |
addJob(String jobName,
String jobClassName)
Adds a Job to the scheduler.
|
static void |
addJob(String jobName,
String jobClassName,
Map<String,Object> params,
boolean isConcurrencyAllowed)
Adds a Job to the scheduler.
|
static void |
addSimpleTrigger(String triggerName,
String jobName,
int repeatCount,
long repeatInterval) |
static void |
addSimpleTrigger(String triggerName,
String jobName,
int repeatCount,
long repeatInterval,
Date startTime,
Date endTime) |
static Scheduler |
createScheduler(int threadPoolSize,
String annotatedJobsPackageName)
Creates the Sundial Scheduler
|
static Scheduler |
createScheduler(SchedulerFactory schedulerFactory)
Creates the Sundial Scheduler
|
static List<String> |
getAllJobNames()
Generates an alphabetically sorted List of all Job names in the DEFAULT job group
|
static Map<String,List<Trigger>> |
getAllJobsAndTriggers()
Generates a Map of all Job names with corresponding Triggers
|
static boolean |
getGlobalLock() |
static Scheduler |
getScheduler()
Gets the underlying Quartz scheduler
|
static javax.servlet.ServletContext |
getServletContext() |
static boolean |
isJobRunning(String jobName) |
static void |
lockScheduler() |
static void |
removeJob(String jobName)
Removes a Job matching the given Job Name
|
static void |
removeTrigger(String triggerName)
Removes a Trigger matching the the given Trigger Name
|
static void |
setServletContext(javax.servlet.ServletContext servletContext) |
static void |
shutdown()
Halts the Scheduler's firing of Triggers, and cleans up all resources associated with the Scheduler.
|
static void |
startJob(String jobName)
Starts a Job matching the given Job Name
|
static void |
startJob(String jobName,
Map<String,Object> params)
Starts a Job matching the the given Job Name found in jobs.xml
|
static void |
startScheduler()
Starts the Sundial Scheduler
|
static void |
startScheduler(int threadPoolSize)
Starts the Sundial Scheduler
|
static void |
startScheduler(int threadPoolSize,
String annotatedJobsPackageName)
Starts the Sundial Scheduler
|
static void |
startScheduler(String annotatedJobsPackageName)
Starts the Sundial Scheduler
|
static void |
stopJob(String jobName)
Triggers a Job interrupt on all Jobs matching the given Job Name.
|
static void |
stopJob(String jobName,
String key,
String pValue)
Triggers a Job interrupt on all Jobs matching the given Job Name, key and (String) value.
|
static void |
toggleGlobalLock() |
static void |
unlockScheduler() |
public static void startScheduler()
throws SundialSchedulerException
SundialSchedulerExceptionpublic static void startScheduler(int threadPoolSize)
throws SundialSchedulerException
threadPoolSize - SundialSchedulerExceptionpublic static void startScheduler(String annotatedJobsPackageName) throws SundialSchedulerException
annotatedJobsPackageName - SundialSchedulerExceptionpublic static void startScheduler(int threadPoolSize,
String annotatedJobsPackageName)
throws SundialSchedulerException
threadPoolSize - annotatedJobsPackageName - SundialSchedulerExceptionpublic static Scheduler createScheduler(int threadPoolSize, String annotatedJobsPackageName) throws SundialSchedulerException
threadPoolSize - the thread pool size used by the schedulerannotatedJobsPackageName - the package where trigger annotated Job classes can be foundSundialSchedulerExceptionpublic static Scheduler createScheduler(SchedulerFactory schedulerFactory) throws SundialSchedulerException
schedulerFactory - factory to create the schedulerSundialSchedulerExceptionpublic static Scheduler getScheduler()
public static void toggleGlobalLock()
public static void lockScheduler()
public static void unlockScheduler()
public static boolean getGlobalLock()
public static javax.servlet.ServletContext getServletContext()
public static void setServletContext(javax.servlet.ServletContext servletContext)
servletContext - the ServletContext to setpublic static void addJob(String jobName, Class<? extends Job> jobClass) throws SundialSchedulerException
jobName - jobClass - SundialSchedulerExceptionpublic static void addJob(String jobName, String jobClassName) throws SundialSchedulerException
jobName - jobClassName - SundialSchedulerExceptionpublic static void addJob(String jobName, Class<? extends Job> jobClass, Map<String,Object> params, boolean isConcurrencyAllowed) throws SundialSchedulerException
jobName - jobClass - params - Set this null if there are no paramsisConcurrencyAllowed - SundialSchedulerExceptionpublic static void addJob(String jobName, String jobClassName, Map<String,Object> params, boolean isConcurrencyAllowed) throws SundialSchedulerException
jobName - jobClassName - params - Set this null if there are no paramsisConcurrencyAllowed - SundialSchedulerExceptionpublic static void startJob(String jobName) throws SundialSchedulerException
jobName - SundialSchedulerExceptionpublic static void removeJob(String jobName) throws SundialSchedulerException
jobName - SundialSchedulerExceptionpublic static void startJob(String jobName, Map<String,Object> params) throws SundialSchedulerException
jobName - SundialSchedulerExceptionpublic static void stopJob(String jobName) throws SundialSchedulerException
jobName - The job nameSundialSchedulerExceptionpublic static void stopJob(String jobName, String key, String pValue) throws SundialSchedulerException
jobName - The job namekey - The key in the job data mappValue - The value in the job data mapSundialSchedulerExceptionpublic static void addCronTrigger(String triggerName, String jobName, String cronExpression) throws SundialSchedulerException
triggerName - jobName - cronExpression - SundialSchedulerExceptionpublic static void addCronTrigger(String triggerName, String jobName, String cronExpression, Date startTime, Date endTime) throws SundialSchedulerException
triggerName - jobName - cronExpression - startTime - - Trigger will NOT fire before this time, regardless of the Trigger's schedule.endTime - - Set the time at which the Trigger will no longer fire - even if it's schedule has remaining repeats. If null, the end time is
indefinite.SundialSchedulerExceptionpublic static void addSimpleTrigger(String triggerName, String jobName, int repeatCount, long repeatInterval) throws SundialSchedulerException
triggerName - jobName - repeatCount - - set to -1 to repeat indefinitelyrepeatInterval - SundialSchedulerExceptionpublic static void addSimpleTrigger(String triggerName, String jobName, int repeatCount, long repeatInterval, Date startTime, Date endTime) throws SundialSchedulerException
triggerName - jobName - repeatCount - - set to -1 to repeat indefinitelyrepeatInterval - startTime - endTime - SundialSchedulerExceptionpublic static void removeTrigger(String triggerName) throws SundialSchedulerException
triggerName - SundialSchedulerExceptionpublic static List<String> getAllJobNames() throws SundialSchedulerException
SundialSchedulerExceptionpublic static Map<String,List<Trigger>> getAllJobsAndTriggers() throws SundialSchedulerException
SundialSchedulerExceptionpublic static boolean isJobRunning(String jobName) throws SundialSchedulerException
SundialSchedulerExceptionpublic static void shutdown()
throws SundialSchedulerException
SundialSchedulerExceptionCopyright © 2011–2017 Knowm Inc.. All rights reserved.