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
ConstructorDescriptionTaskSchedulingServiceImpl
(L10N l10n, org.quartz.Scheduler scheduler, ProgressPersistenceManager progressPersistenceManager, SecurityManager securityManager) -
Method Summary
Modifier and TypeMethodDescriptionvoid
Interrupt a running job.void
cancelJob
(org.quartz.JobKey jobKey) Interrupt a running job.protected void
checkAccess
(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).void
removeScheduledJob
(Entity taskExecution) Remove a scheduled job.void
rescheduleJob
(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.void
setBatchJobContributions
(List<BatchJobContribution> contributions) void
setConverters
(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:TaskSchedulingService
Schedule a task which will be executed immediately (unless all threads are already occupied).- Specified by:
executeJobImmediately
in interfaceTaskSchedulingService
- Returns:
- the
JobKey
if 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:TaskSchedulingService
Schedule a task to be executed at a specific date and time.- Specified by:
scheduleJob
in interfaceTaskSchedulingService
- Returns:
- the
JobKey
if 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:TaskSchedulingService
Interrupt a running job. The job must extend fromAbstractInterruptableJob
and must properly implement the cancellation.- Specified by:
cancelJob
in interfaceTaskSchedulingService
- Parameters:
jobKey
- the key of the job
-
cancelJob
Description copied from interface:TaskSchedulingService
Interrupt a running job. The job must extend fromAbstractInterruptableJob
and must properly implement the cancellation.- Specified by:
cancelJob
in interfaceTaskSchedulingService
- Parameters:
taskExecution
- the 'Task_execution' entity that represents the job to cancel
-
removeScheduledJob
Description copied from interface:TaskSchedulingService
Remove a scheduled job.- Specified by:
removeScheduledJob
in interfaceTaskSchedulingService
- Parameters:
taskExecution
- the 'Task_execution' entity that represents the job to delete
-
rescheduleJob
Description copied from interface:TaskSchedulingService
Change the scheduled start time of a given job.- Specified by:
rescheduleJob
in interfaceTaskSchedulingService
- Parameters:
taskExecution
- the 'Task_execution' entity that represents the job to reschedule
-
checkAccess
protected void checkAccess(org.quartz.JobKey jobKey)
-