Interface JobManager
-
- All Known Implementing Classes:
DefaultJobManager
@Internal public interface JobManager
Contains methods that are not tied to any specific job type (async, timer, suspended or deadletter), but which are generally applicable or are about going from one type to another.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description AbstractJobEntityactivateSuspendedJob(SuspendedJobEntity job)Transforms aSuspendedJobEntityback to anAbstractJobEntity(i.e.JobEntitycreateAsyncJob(ExecutionEntity execution, boolean exclusive)Creates an async job for the providedExecutionEntity, so that it can be continued later in a background thread.TimerJobEntitycreateTimerJob(org.activiti.bpmn.model.TimerEventDefinition timerEventDefinition, boolean interrupting, ExecutionEntity execution, java.lang.String timerEventType, java.lang.String jobHandlerConfiguration)Creates aTimerJobEntitybased on the currentExecutionEntityand the configuration in theTimerEventDefinition.voidexecute(Job job)Execute a job, which means that the logic (async logic, timer that fires, etc) is executed, typically by a background thread of an executor.JobEntitymoveDeadLetterJobToExecutableJob(DeadLetterJobEntity deadLetterJobEntity, int retries)Transforms aDeadLetterJobEntityto aJobEntity, thus making it executable again.DeadLetterJobEntitymoveJobToDeadLetterJob(AbstractJobEntity job)Transforms anAbstractJobEntityto aDeadLetterJobEntity.SuspendedJobEntitymoveJobToSuspendedJob(AbstractJobEntity job)Moves anAbstractJobEntityto become aSuspendedJobEntity, such that theAsyncExecutorwon't pick it up anymore for execution.TimerJobEntitymoveJobToTimerJob(AbstractJobEntity job)Moves anAbstractJobEntityto become aTimerJobEntity.JobEntitymoveTimerJobToExecutableJob(TimerJobEntity timerJob)Moves aTimerJobEntityto become an asyncJobEntity.voidscheduleAsyncJob(JobEntity job)Schedules and async job.voidscheduleTimerJob(TimerJobEntity timerJob)Schedules a timer, meaning it will be inserted in the datastore.voidsetProcessEngineConfiguration(ProcessEngineConfigurationImpl processEngineConfiguration)The ProcessEngineCongiguration instance will be passed when theProcessEngineis built.voidunacquire(Job job)Unacquires a job, meaning that this job was previously locked, and it is now freed to be acquired by other executor nodes.
-
-
-
Method Detail
-
execute
void execute(Job job)
Execute a job, which means that the logic (async logic, timer that fires, etc) is executed, typically by a background thread of an executor.
-
unacquire
void unacquire(Job job)
Unacquires a job, meaning that this job was previously locked, and it is now freed to be acquired by other executor nodes.
-
createAsyncJob
JobEntity createAsyncJob(ExecutionEntity execution, boolean exclusive)
Creates an async job for the providedExecutionEntity, so that it can be continued later in a background thread.
-
scheduleAsyncJob
void scheduleAsyncJob(JobEntity job)
Schedules and async job. If theAsyncExecutoris running, it can be executed immediately after the transaction. Otherwise it can be picked up by other executors.
-
createTimerJob
TimerJobEntity createTimerJob(org.activiti.bpmn.model.TimerEventDefinition timerEventDefinition, boolean interrupting, ExecutionEntity execution, java.lang.String timerEventType, java.lang.String jobHandlerConfiguration)
Creates aTimerJobEntitybased on the currentExecutionEntityand the configuration in theTimerEventDefinition.
-
scheduleTimerJob
void scheduleTimerJob(TimerJobEntity timerJob)
Schedules a timer, meaning it will be inserted in the datastore.
-
moveTimerJobToExecutableJob
JobEntity moveTimerJobToExecutableJob(TimerJobEntity timerJob)
Moves aTimerJobEntityto become an asyncJobEntity. This happens for example when the due date of a timer is reached, the timer entity then becomes a 'regular' async job that can be picked up by theAsyncExecutor.
-
moveJobToTimerJob
TimerJobEntity moveJobToTimerJob(AbstractJobEntity job)
Moves anAbstractJobEntityto become aTimerJobEntity. This happens for example when an async job is executed and fails. It then becomes a timer, as it needs to be retried later.
-
moveJobToSuspendedJob
SuspendedJobEntity moveJobToSuspendedJob(AbstractJobEntity job)
Moves anAbstractJobEntityto become aSuspendedJobEntity, such that theAsyncExecutorwon't pick it up anymore for execution.
-
activateSuspendedJob
AbstractJobEntity activateSuspendedJob(SuspendedJobEntity job)
Transforms aSuspendedJobEntityback to anAbstractJobEntity(i.e. to what it was originally). The job will now again be able to picked up by theAsyncExecutor.
-
moveJobToDeadLetterJob
DeadLetterJobEntity moveJobToDeadLetterJob(AbstractJobEntity job)
Transforms anAbstractJobEntityto aDeadLetterJobEntity. This means that the job has been tried a configurable amount of times, but kept failing.
-
moveDeadLetterJobToExecutableJob
JobEntity moveDeadLetterJobToExecutableJob(DeadLetterJobEntity deadLetterJobEntity, int retries)
Transforms aDeadLetterJobEntityto aJobEntity, thus making it executable again. Note that a 'retries' parameter needs to be passed, as the job got into the deadletter table because of it failed and retries became 0.
-
setProcessEngineConfiguration
void setProcessEngineConfiguration(ProcessEngineConfigurationImpl processEngineConfiguration)
The ProcessEngineCongiguration instance will be passed when theProcessEngineis built.
-
-