Package ch.tocco.nice2.tasks.impl.quartz
Class TaskSchedulingServiceImpl
java.lang.Object
ch.tocco.nice2.tasks.impl.quartz.TaskSchedulingServiceImpl
- All Implemented Interfaces:
TaskSchedulingService
-
Field Summary
Fields inherited from interface ch.tocco.nice2.tasks.api.quartz.TaskSchedulingService
HIGH_LISTENER_PRIORITY, LOW_LISTENER_PRIORITY, NORMAL_LISTENER_PRIORITY -
Constructor Summary
ConstructorsConstructorDescriptionTaskSchedulingServiceImpl(L10N l10n, org.quartz.Scheduler scheduler, ProgressPersistenceManager progressPersistenceManager, SecurityManager securityManager) -
Method Summary
Modifier and TypeMethodDescriptionvoidInterrupt a running job.voidcancelJob(org.quartz.JobKey jobKey) Interrupt a running job.protected voidcheckAccess(org.quartz.JobKey jobKey) Optional<org.quartz.JobKey> executeJobImmediately(Class<? extends AbstractJob> jobClass, String taskName, CallableType taskType, JobDataMapBuilder jobData) Schedule a task which will be executed immediately (unless all threads are already occupied).voidremoveScheduledJob(Entity taskExecution) Remove a scheduled job.voidrescheduleJob(Entity taskExecution, org.joda.time.DateTime newDate) Change the scheduled start time of a given job.Optional<org.quartz.JobKey> scheduleJob(Class<? extends AbstractJob> jobClass, String taskName, CallableType taskType, JobDataMapBuilder jobData, org.joda.time.DateTime executionDate) Schedule a task to be executed at a specific date and time.voidsetBatchJobContributions(List<BatchJobContribution> contributions) voidsetConverters(List<com.thoughtworks.xstream.converters.Converter> converters)
-
Constructor Details
-
TaskSchedulingServiceImpl
public TaskSchedulingServiceImpl(L10N l10n, org.quartz.Scheduler scheduler, ProgressPersistenceManager progressPersistenceManager, SecurityManager securityManager)
-
-
Method Details
-
setBatchJobContributions
-
setConverters
@Autowired public void setConverters(List<com.thoughtworks.xstream.converters.Converter> converters) -
executeJobImmediately
public Optional<org.quartz.JobKey> executeJobImmediately(Class<? extends AbstractJob> jobClass, String taskName, CallableType taskType, JobDataMapBuilder jobData) Description copied from interface:TaskSchedulingServiceSchedule a task which will be executed immediately (unless all threads are already occupied).- Specified by:
executeJobImmediatelyin interfaceTaskSchedulingService- Returns:
- the
JobKeyif new job was scheduled (no new job is created if multiple schedules are disabled by settingJobDataMapBuilder.putMultipleSchedulesEnabled(boolean)to `false` and a job with the given `taskName` already exists)
-
scheduleJob
public Optional<org.quartz.JobKey> scheduleJob(Class<? extends AbstractJob> jobClass, String taskName, CallableType taskType, JobDataMapBuilder jobData, org.joda.time.DateTime executionDate) Description copied from interface:TaskSchedulingServiceSchedule a task to be executed at a specific date and time.- Specified by:
scheduleJobin interfaceTaskSchedulingService- Returns:
- the
JobKeyif new job was scheduled (no new job is created if multiple schedules are disabled by settingJobDataMapBuilder.putMultipleSchedulesEnabled(boolean)to `false` and a job with the given `taskName` already exists)
-
cancelJob
public void cancelJob(org.quartz.JobKey jobKey) Description copied from interface:TaskSchedulingServiceInterrupt a running job. The job must extend fromAbstractInterruptableJoband must properly implement the cancellation.- Specified by:
cancelJobin interfaceTaskSchedulingService- Parameters:
jobKey- the key of the job
-
cancelJob
Description copied from interface:TaskSchedulingServiceInterrupt a running job. The job must extend fromAbstractInterruptableJoband must properly implement the cancellation.- Specified by:
cancelJobin interfaceTaskSchedulingService- Parameters:
taskExecution- the 'Task_execution' entity that represents the job to cancel
-
removeScheduledJob
Description copied from interface:TaskSchedulingServiceRemove a scheduled job.- Specified by:
removeScheduledJobin interfaceTaskSchedulingService- Parameters:
taskExecution- the 'Task_execution' entity that represents the job to delete
-
rescheduleJob
Description copied from interface:TaskSchedulingServiceChange the scheduled start time of a given job.- Specified by:
rescheduleJobin interfaceTaskSchedulingService- Parameters:
taskExecution- the 'Task_execution' entity that represents the job to reschedule
-
checkAccess
protected void checkAccess(org.quartz.JobKey jobKey)
-