Class ScheduleManager
java.lang.Object
de.xima.fc.timing.ScheduleManager
Manager-class for starting, stopping and removing schedules jobs
- Author:
- XIMA MEDIA GmbH
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddJob(IJobWrapper job, org.quartz.Trigger trigger) Attempt to add a job to the scheduler.static booleanaddJobIfPossible(IJobWrapper job, org.quartz.Trigger trigger) Attempt to add a job to the scheduler.static org.quartz.SchedulerDeprecated.static PropertiesMethod to get the defaultPropertiesto start the scheduler withstatic org.quartz.JobDetailgetJob(org.quartz.JobKey key) Method to get a scheduled job by his keystatic Set<org.quartz.JobKey> getJobs(NameMatcher<org.quartz.JobKey> nameMatcher) Finds all quartz jobs with a certain name.static Set<org.quartz.JobKey> getJobs(org.quartz.impl.matchers.GroupMatcher<org.quartz.JobKey> groupMatcher) Finds all jobs that belong to the given groups.static Set<org.quartz.JobKey> getJobs(org.quartz.impl.matchers.GroupMatcher<org.quartz.JobKey> groupMatcher, NameMatcher<org.quartz.JobKey> nameMatcher) Finds all jobs with a certain name in the given groups.static ExecutorServicestatic org.quartz.Schedulerstatic org.quartz.TriggergetTrigger(org.quartz.TriggerKey key) Method to get a trigger by its keystatic Set<org.quartz.TriggerKey> getTriggers(NameMatcher<org.quartz.TriggerKey> nameMatcher) Finds all quartz triggers with a certain name.static Set<org.quartz.TriggerKey> getTriggers(org.quartz.impl.matchers.GroupMatcher<org.quartz.TriggerKey> groupMatcher) Finds all triggers that belong to the given groups.static Set<org.quartz.TriggerKey> getTriggers(org.quartz.impl.matchers.GroupMatcher<org.quartz.TriggerKey> groupMatcher, NameMatcher<org.quartz.TriggerKey> nameMatcher) Finds all triggers with a certain name in the given groups.static voidDeprecated.Scheduler lifecycle is now managed by SchedulerProviderImpl, this method does not have any effect anymore.static voidDeprecated.Use observer withSchedulerStartedEventstatic voidremoveJob(org.quartz.JobKey key) Method to remove a job by his keystatic voidremoveJobs(Set<org.quartz.JobKey> jobKeys) Removes all jobs that match the given job keys.static voidremoveJobs(org.quartz.impl.matchers.GroupMatcher<org.quartz.JobKey> groupMatcher) Removes all job that match the given group.static voidremoveJobs(org.quartz.impl.matchers.GroupMatcher<org.quartz.JobKey> groupMatcher, NameMatcher<org.quartz.JobKey> nameMatcher) Removes all job that match the given group and name.static voidDeprecated.Use observer withSchedulerStartedEventstatic voidsetCustomProperties(Properties properties) Deprecated, for removal: This API element is subject to removal in a future version.will be removed, does not have any effect anymore.static voidshutdown()Method to shut down the schedulerstatic voidstandBy()static voidstart()Method to start the scheduler
-
Constructor Details
-
ScheduleManager
public ScheduleManager()
-
-
Method Details
-
addJob
Attempt to add a job to the scheduler. If the job could not be added, logs an error. PreferaddJobIfPossible(IJobWrapper, Trigger)if you need to check whether the job was successfully added.- Parameters:
job- The data for the job to add.trigger- The trigger that controls the execution time of the job.
-
addJobIfPossible
Attempt to add a job to the scheduler. If the job could not be added, logs an error and returns false.- Parameters:
job- The data for the job to add.trigger- The trigger that controls the execution time of the job.- Returns:
trueif the job was successfully added,falseotherwise.
-
getDefaultProperties
Method to get the defaultPropertiesto start the scheduler with- Returns:
Propertiesto start the scheduler with
-
getJob
public static org.quartz.JobDetail getJob(org.quartz.JobKey key) Method to get a scheduled job by his key- Parameters:
key-JobKeyto search the job with- Returns:
JobDetailthe found job ornull
-
getJobs
public static Set<org.quartz.JobKey> getJobs(org.quartz.impl.matchers.GroupMatcher<org.quartz.JobKey> groupMatcher) Finds all jobs that belong to the given groups.- Parameters:
groupMatcher- Details on the groups to match.- Returns:
- All jobs that belong to a group matching the given matcher.
-
getJobs
public static Set<org.quartz.JobKey> getJobs(org.quartz.impl.matchers.GroupMatcher<org.quartz.JobKey> groupMatcher, NameMatcher<org.quartz.JobKey> nameMatcher) Finds all jobs with a certain name in the given groups.- Parameters:
groupMatcher- Details on the group to match.nameMatcher- Details on the name to match.- Returns:
- All jobs with a name that matches the given name matcher that also belongs to a group matching the given group matcher.
-
getJobs
Finds all quartz jobs with a certain name.- Parameters:
nameMatcher- Details on the name to match.- Returns:
- All jobs with a name that match the given matcher.
-
getScheduler
public static org.quartz.Scheduler getScheduler()- Returns:
- The current quartz scheduler. When quartz is not active, this returns
null.
-
getTrigger
public static org.quartz.Trigger getTrigger(org.quartz.TriggerKey key) Method to get a trigger by its key- Parameters:
key- The trigger key to search the trigger for- Returns:
- The trigger if found, or
nullotherwise.
-
getTriggers
public static Set<org.quartz.TriggerKey> getTriggers(org.quartz.impl.matchers.GroupMatcher<org.quartz.TriggerKey> groupMatcher) Finds all triggers that belong to the given groups.- Parameters:
groupMatcher- Details on the groups to match.- Returns:
- All triggers that belong to a group matching the given matcher.
-
getTriggers
public static Set<org.quartz.TriggerKey> getTriggers(org.quartz.impl.matchers.GroupMatcher<org.quartz.TriggerKey> groupMatcher, NameMatcher<org.quartz.TriggerKey> nameMatcher) Finds all triggers with a certain name in the given groups.- Parameters:
groupMatcher- Details on the group to match.nameMatcher- Details on the name to match.- Returns:
- All triggers with a name that matches the given name matcher that also belongs to a group matching the given group matcher.
-
getTriggers
public static Set<org.quartz.TriggerKey> getTriggers(NameMatcher<org.quartz.TriggerKey> nameMatcher) Finds all quartz triggers with a certain name.- Parameters:
nameMatcher- Details on the name to match.- Returns:
- All triggers with a name that match the given matcher.
-
initialize
Deprecated.Scheduler lifecycle is now managed by SchedulerProviderImpl, this method does not have any effect anymore.Initializes the schedule manager. Checks whether all preconditions are met (database running etc.) -
registerStartupListener
Deprecated.Use observer withSchedulerStartedEvent- Parameters:
listener- Listener to invoke when the scheduler is started.
-
removeJob
public static void removeJob(org.quartz.JobKey key) Method to remove a job by his key- Parameters:
key-JobKeyto find the job to remove
-
removeJobs
public static void removeJobs(org.quartz.impl.matchers.GroupMatcher<org.quartz.JobKey> groupMatcher) Removes all job that match the given group.- Parameters:
groupMatcher- Groups of jobs to remove.
-
removeJobs
Removes all jobs that match the given job keys.- Parameters:
jobKeys- JobKeys of jobs to remove.
-
removeJobs
public static void removeJobs(org.quartz.impl.matchers.GroupMatcher<org.quartz.JobKey> groupMatcher, NameMatcher<org.quartz.JobKey> nameMatcher) Removes all job that match the given group and name.- Parameters:
groupMatcher- Groups of jobs to remove.nameMatcher- Name of jobs to remove.
-
removeStartupListener
Deprecated.Use observer withSchedulerStartedEvent- Parameters:
listener- Listener not to invoke anymore when the scheduler is started.
-
setCustomProperties
Deprecated, for removal: This API element is subject to removal in a future version.will be removed, does not have any effect anymore.Method to override the default properties- Parameters:
properties-Propertiesto start the scheduler with
-
shutdown
public static void shutdown()Method to shut down the scheduler -
start
public static void start()Method to start the scheduler -
standBy
public static void standBy() -
createUnstartedScheduler
Deprecated. -
getQuartzDeletionExecutor
-