Class SequentialJobAcquisitionRunnable
- java.lang.Object
-
- org.camunda.bpm.engine.impl.jobexecutor.AcquireJobsRunnable
-
- org.camunda.bpm.engine.impl.jobexecutor.SequentialJobAcquisitionRunnable
-
- All Implemented Interfaces:
java.lang.Runnable
public class SequentialJobAcquisitionRunnable extends AcquireJobsRunnable
AcquireJobsRunnable
able to serve multiple process engines.Continuously acquires jobs for all registered process engines until interruption. For every such acquisition cycle, jobs are acquired and submitted for execution.
For one cycle, all acquisition-related events (acquired jobs by engine, rejected jobs by engine, exceptions during acquisition, etc.) are collected in an instance of
JobAcquisitionContext
. The context is then handed to aJobAcquisitionStrategy
that determines the there is before the next acquisition cycles begins and how many jobs are to be acquired next.- Author:
- Daniel Meyer
-
-
Field Summary
Fields Modifier and Type Field Description protected JobAcquisitionContext
acquisitionContext
protected JobExecutorLogger
LOG
-
Fields inherited from class org.camunda.bpm.engine.impl.jobexecutor.AcquireJobsRunnable
isInterrupted, isJobAdded, isWaiting, jobExecutor, MONITOR
-
-
Constructor Summary
Constructors Constructor Description SequentialJobAcquisitionRunnable(JobExecutor jobExecutor)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected AcquiredJobs
acquireJobs(JobAcquisitionContext context, JobAcquisitionStrategy acquisitionStrategy, ProcessEngineImpl currentProcessEngine)
protected void
configureNextAcquisitionCycle(JobAcquisitionContext acquisitionContext, JobAcquisitionStrategy acquisitionStrategy)
Reconfigure the acquisition strategy based on the current cycle's acquisition context.protected void
executeJobs(JobAcquisitionContext context, ProcessEngineImpl currentProcessEngine, AcquiredJobs acquiredJobs)
JobAcquisitionContext
getAcquisitionContext()
protected JobAcquisitionContext
initializeAcquisitionContext()
protected JobAcquisitionStrategy
initializeAcquisitionStrategy()
void
run()
-
Methods inherited from class org.camunda.bpm.engine.impl.jobexecutor.AcquireJobsRunnable
clearJobAddedNotification, isJobAdded, jobWasAdded, stop, suspendAcquisition
-
-
-
-
Field Detail
-
LOG
protected final JobExecutorLogger LOG
-
acquisitionContext
protected JobAcquisitionContext acquisitionContext
-
-
Constructor Detail
-
SequentialJobAcquisitionRunnable
public SequentialJobAcquisitionRunnable(JobExecutor jobExecutor)
-
-
Method Detail
-
run
public void run()
-
initializeAcquisitionContext
protected JobAcquisitionContext initializeAcquisitionContext()
-
configureNextAcquisitionCycle
protected void configureNextAcquisitionCycle(JobAcquisitionContext acquisitionContext, JobAcquisitionStrategy acquisitionStrategy)
Reconfigure the acquisition strategy based on the current cycle's acquisition context. A strategy implementation may update internal data structure to calculate a different wait time before the next cycle of acquisition is performed.
-
initializeAcquisitionStrategy
protected JobAcquisitionStrategy initializeAcquisitionStrategy()
-
getAcquisitionContext
public JobAcquisitionContext getAcquisitionContext()
-
executeJobs
protected void executeJobs(JobAcquisitionContext context, ProcessEngineImpl currentProcessEngine, AcquiredJobs acquiredJobs)
-
acquireJobs
protected AcquiredJobs acquireJobs(JobAcquisitionContext context, JobAcquisitionStrategy acquisitionStrategy, ProcessEngineImpl currentProcessEngine)
-
-