Package pro.taskana.common.internal.jobs
Class AbstractTaskanaJob
java.lang.Object
pro.taskana.common.internal.jobs.AbstractTaskanaJob
- All Implemented Interfaces:
TaskanaJob
- Direct Known Subclasses:
ClassificationChangedJob,TaskCleanupJob,TaskRefreshJob,TaskUpdatePriorityJob,WorkbasketCleanupJob
Abstract base for all background jobs of TASKANA.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Instantprotected Durationprotected final ScheduledJobprotected final TaskanaEngineImplprotected final TaskanaTransactionProvider -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractTaskanaJob(TaskanaEngine taskanaEngine, TaskanaTransactionProvider txProvider, ScheduledJob job, boolean async) -
Method Summary
Modifier and TypeMethodDescriptionstatic TaskanaJobcreateFromScheduledJob(TaskanaEngine engine, TaskanaTransactionProvider txProvider, ScheduledJob job) protected abstract voidexecute()static DurationgetLockExpirationPeriod(TaskanaConfiguration taskanaConfiguration) protected Instantprotected abstract StringgetType()static voidinitializeSchedule(TaskanaEngine taskanaEngine, Class<?> jobClass) Initializes the TaskCleanupJob schedule.booleanisAsync()final voidrun()Execute the TaskanaJob.protected void
-
Field Details
-
taskanaEngineImpl
-
txProvider
-
scheduledJob
-
firstRun
-
runEvery
-
-
Constructor Details
-
AbstractTaskanaJob
protected AbstractTaskanaJob(TaskanaEngine taskanaEngine, TaskanaTransactionProvider txProvider, ScheduledJob job, boolean async)
-
-
Method Details
-
createFromScheduledJob
public static TaskanaJob createFromScheduledJob(TaskanaEngine engine, TaskanaTransactionProvider txProvider, ScheduledJob job) -
run
Description copied from interface:TaskanaJobExecute the TaskanaJob.- Specified by:
runin interfaceTaskanaJob- Throws:
TaskanaException- if any exception occurs during the execution.
-
initializeSchedule
Initializes the TaskCleanupJob schedule.
All scheduled cleanup jobs are cancelled/deleted and a new one is scheduled.- Parameters:
taskanaEngine- the TASKANA engine.jobClass- the class of the job which should be scheduled- Throws:
SystemException- if the jobClass could not be scheduled.
-
isAsync
public boolean isAsync() -
getFirstRun
-
getRunEvery
-
getLockExpirationPeriod
-
getType
-
execute
- Throws:
TaskanaException
-
getNextDueForJob
-
scheduleNextJob
protected void scheduleNextJob()
-