Class JobExecutor
java.lang.Object
org.camunda.bpm.engine.impl.jobexecutor.JobExecutor
- Direct Known Subclasses:
ManagedJobExecutor
,ManagedJobExecutor
,RuntimeContainerJobExecutor
,SpringJobExecutor
,ThreadPoolJobExecutor
Interface to the component responsible for performing
background work (Jobs
).
The JobExecutor
is capable of dispatching to multiple process engines,
ie. multiple process engines can share a single Thread Pool for performing Background
Work.
In clustered situations, you can have multiple Job Executors running against the same queue + pending job list.
- Author:
- Daniel Meyer
-
Field Summary
Modifier and TypeFieldDescriptionprotected AcquireJobsCommandFactory
protected AcquireJobsRunnable
protected int
The number of job acquisition cycles without locking failures until the backoff level is reduced.protected int
protected boolean
protected boolean
protected Thread
protected String
protected int
protected long
protected int
protected long
protected String
protected List<ProcessEngineImpl>
protected RejectedJobsHandler
protected float
protected int
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionMust return an iterator of registered process engines that is independent of concurrent modifications to the underlying data structure of engines.protected void
protected void
void
executeJobs
(List<String> jobIds) Deprecated.abstract void
executeJobs
(List<String> jobIds, ProcessEngineImpl processEngine) getAcquireJobsCmd
(int numJobs) int
int
Deprecated.getExecuteJobsRunnable
(List<String> jobIds, ProcessEngineImpl processEngine) int
long
int
long
getName()
float
int
boolean
hasRegisteredEngine
(ProcessEngineImpl engine) boolean
isActive()
boolean
void
void
logAcquiredJobs
(ProcessEngineImpl engine, int numJobs) void
void
logAcquisitionFailureJobs
(ProcessEngineImpl engine, int numJobs) void
logRejectedExecution
(ProcessEngineImpl engine, int numJobs) void
registerProcessEngine
(ProcessEngineImpl processEngine) void
setAcquireJobsCmdFactory
(AcquireJobsCommandFactory acquireJobsCmdFactory) void
setAutoActivate
(boolean isAutoActivate) void
setBackoffDecreaseThreshold
(int backoffDecreaseThreshold) void
setBackoffTimeInMillis
(int backoffTimeInMillis) void
setCommandExecutor
(CommandExecutor commandExecutorTxRequired) Deprecated.void
setLockOwner
(String lockOwner) void
setLockTimeInMillis
(int lockTimeInMillis) void
setMaxBackoff
(long maxBackoff) void
setMaxJobsPerAcquisition
(int maxJobsPerAcquisition) void
setMaxWait
(long maxWait) void
setProcessEngines
(List<ProcessEngineImpl> processEngines) void
setRejectedJobsHandler
(RejectedJobsHandler rejectedJobsHandler) void
setWaitIncreaseFactor
(float waitIncreaseFactor) void
setWaitTimeInMillis
(int waitTimeInMillis) void
shutdown()
void
start()
protected abstract void
protected void
protected abstract void
protected void
void
unregisterProcessEngine
(ProcessEngineImpl processEngine)
-
Field Details
-
name
-
processEngines
-
acquireJobsCmdFactory
-
acquireJobsRunnable
-
rejectedJobsHandler
-
jobAcquisitionThread
-
isAutoActivate
protected boolean isAutoActivate -
isActive
protected boolean isActive -
maxJobsPerAcquisition
protected int maxJobsPerAcquisition -
waitTimeInMillis
protected int waitTimeInMillis -
waitIncreaseFactor
protected float waitIncreaseFactor -
maxWait
protected long maxWait -
backoffTimeInMillis
protected int backoffTimeInMillis -
maxBackoff
protected long maxBackoff -
backoffDecreaseThreshold
protected int backoffDecreaseThresholdThe number of job acquisition cycles without locking failures until the backoff level is reduced. -
lockOwner
-
lockTimeInMillis
protected int lockTimeInMillis
-
-
Constructor Details
-
JobExecutor
public JobExecutor()
-
-
Method Details
-
start
public void start() -
shutdown
public void shutdown() -
ensureInitialization
protected void ensureInitialization() -
ensureCleanup
protected void ensureCleanup() -
jobWasAdded
public void jobWasAdded() -
registerProcessEngine
-
unregisterProcessEngine
-
startExecutingJobs
protected abstract void startExecutingJobs() -
stopExecutingJobs
protected abstract void stopExecutingJobs() -
executeJobs
-
executeJobs
Deprecated.Deprecated: useexecuteJobs(List, ProcessEngineImpl)
instead- Parameters:
jobIds
-
-
logAcquisitionAttempt
-
logAcquiredJobs
-
logAcquisitionFailureJobs
-
logRejectedExecution
-
getProcessEngines
-
engineIterator
Must return an iterator of registered process engines that is independent of concurrent modifications to the underlying data structure of engines. -
hasRegisteredEngine
-
getCommandExecutor
Deprecated.Deprecated: usegetProcessEngines()
instead -
setCommandExecutor
Deprecated.Deprecated: useregisterProcessEngine(ProcessEngineImpl)
instead- Parameters:
commandExecutorTxRequired
-
-
getWaitTimeInMillis
public int getWaitTimeInMillis() -
setWaitTimeInMillis
public void setWaitTimeInMillis(int waitTimeInMillis) -
getBackoffTimeInMillis
public int getBackoffTimeInMillis() -
setBackoffTimeInMillis
public void setBackoffTimeInMillis(int backoffTimeInMillis) -
getLockTimeInMillis
public int getLockTimeInMillis() -
setLockTimeInMillis
public void setLockTimeInMillis(int lockTimeInMillis) -
getLockOwner
-
setLockOwner
-
isAutoActivate
public boolean isAutoActivate() -
setProcessEngines
-
setAutoActivate
public void setAutoActivate(boolean isAutoActivate) -
getMaxJobsPerAcquisition
public int getMaxJobsPerAcquisition() -
setMaxJobsPerAcquisition
public void setMaxJobsPerAcquisition(int maxJobsPerAcquisition) -
getWaitIncreaseFactor
public float getWaitIncreaseFactor() -
setWaitIncreaseFactor
public void setWaitIncreaseFactor(float waitIncreaseFactor) -
getMaxWait
public long getMaxWait() -
setMaxWait
public void setMaxWait(long maxWait) -
getMaxBackoff
public long getMaxBackoff() -
setMaxBackoff
public void setMaxBackoff(long maxBackoff) -
getBackoffDecreaseThreshold
public int getBackoffDecreaseThreshold() -
setBackoffDecreaseThreshold
public void setBackoffDecreaseThreshold(int backoffDecreaseThreshold) -
getName
-
getAcquireJobsCmd
-
getAcquireJobsCmdFactory
-
setAcquireJobsCmdFactory
-
isActive
public boolean isActive() -
getRejectedJobsHandler
-
setRejectedJobsHandler
-
startJobAcquisitionThread
protected void startJobAcquisitionThread() -
stopJobAcquisitionThread
protected void stopJobAcquisitionThread() -
getAcquireJobsRunnable
-
getExecuteJobsRunnable
-