Class JobExecutor
- java.lang.Object
- 
- org.camunda.bpm.engine.impl.jobexecutor.JobExecutor
 
- 
- Direct Known Subclasses:
- ManagedJobExecutor,- ManagedJobExecutor,- RuntimeContainerJobExecutor,- SpringJobExecutor,- ThreadPoolJobExecutor
 
 public abstract class JobExecutor extends Object Interface to the component responsible for performing background work ( Jobs).The JobExecutoris 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 SummaryFields Modifier and Type Field Description protected AcquireJobsCommandFactoryacquireJobsCmdFactoryprotected AcquireJobsRunnableacquireJobsRunnableprotected intbackoffDecreaseThresholdThe number of job acquisition cycles without locking failures until the backoff level is reduced.protected intbackoffTimeInMillisprotected booleanisActiveprotected booleanisAutoActivateprotected ThreadjobAcquisitionThreadprotected StringlockOwnerprotected intlockTimeInMillisprotected longmaxBackoffprotected intmaxJobsPerAcquisitionprotected longmaxWaitprotected Stringnameprotected List<ProcessEngineImpl>processEnginesprotected RejectedJobsHandlerrejectedJobsHandlerprotected floatwaitIncreaseFactorprotected intwaitTimeInMillis
 - 
Constructor SummaryConstructors Constructor Description JobExecutor()
 - 
Method Summary
 
- 
- 
- 
Field Detail- 
nameprotected String name 
 - 
processEnginesprotected List<ProcessEngineImpl> processEngines 
 - 
acquireJobsCmdFactoryprotected AcquireJobsCommandFactory acquireJobsCmdFactory 
 - 
acquireJobsRunnableprotected AcquireJobsRunnable acquireJobsRunnable 
 - 
rejectedJobsHandlerprotected RejectedJobsHandler rejectedJobsHandler 
 - 
jobAcquisitionThreadprotected Thread jobAcquisitionThread 
 - 
isAutoActivateprotected boolean isAutoActivate 
 - 
isActiveprotected boolean isActive 
 - 
maxJobsPerAcquisitionprotected int maxJobsPerAcquisition 
 - 
waitTimeInMillisprotected int waitTimeInMillis 
 - 
waitIncreaseFactorprotected float waitIncreaseFactor 
 - 
maxWaitprotected long maxWait 
 - 
backoffTimeInMillisprotected int backoffTimeInMillis 
 - 
maxBackoffprotected long maxBackoff 
 - 
backoffDecreaseThresholdprotected int backoffDecreaseThreshold The number of job acquisition cycles without locking failures until the backoff level is reduced.
 - 
lockOwnerprotected String lockOwner 
 - 
lockTimeInMillisprotected int lockTimeInMillis 
 
- 
 - 
Method Detail- 
startpublic void start() 
 - 
shutdownpublic void shutdown() 
 - 
ensureInitializationprotected void ensureInitialization() 
 - 
ensureCleanupprotected void ensureCleanup() 
 - 
jobWasAddedpublic void jobWasAdded() 
 - 
registerProcessEnginepublic void registerProcessEngine(ProcessEngineImpl processEngine) 
 - 
unregisterProcessEnginepublic void unregisterProcessEngine(ProcessEngineImpl processEngine) 
 - 
startExecutingJobsprotected abstract void startExecutingJobs() 
 - 
stopExecutingJobsprotected abstract void stopExecutingJobs() 
 - 
executeJobspublic abstract void executeJobs(List<String> jobIds, ProcessEngineImpl processEngine) 
 - 
executeJobs@Deprecated public void executeJobs(List<String> jobIds) Deprecated.Deprecated: useexecuteJobs(List, ProcessEngineImpl)instead- Parameters:
- jobIds-
 
 - 
logAcquisitionAttemptpublic void logAcquisitionAttempt(ProcessEngineImpl engine) 
 - 
logAcquiredJobspublic void logAcquiredJobs(ProcessEngineImpl engine, int numJobs) 
 - 
logAcquisitionFailureJobspublic void logAcquisitionFailureJobs(ProcessEngineImpl engine, int numJobs) 
 - 
logRejectedExecutionpublic void logRejectedExecution(ProcessEngineImpl engine, int numJobs) 
 - 
getProcessEnginespublic List<ProcessEngineImpl> getProcessEngines() 
 - 
engineIteratorpublic Iterator<ProcessEngineImpl> engineIterator() Must return an iterator of registered process engines that is independent of concurrent modifications to the underlying data structure of engines.
 - 
hasRegisteredEnginepublic boolean hasRegisteredEngine(ProcessEngineImpl engine) 
 - 
getCommandExecutor@Deprecated public CommandExecutor getCommandExecutor() Deprecated.Deprecated: usegetProcessEngines()instead
 - 
setCommandExecutor@Deprecated public void setCommandExecutor(CommandExecutor commandExecutorTxRequired) Deprecated.Deprecated: useregisterProcessEngine(ProcessEngineImpl)instead- Parameters:
- commandExecutorTxRequired-
 
 - 
getWaitTimeInMillispublic int getWaitTimeInMillis() 
 - 
setWaitTimeInMillispublic void setWaitTimeInMillis(int waitTimeInMillis) 
 - 
getBackoffTimeInMillispublic int getBackoffTimeInMillis() 
 - 
setBackoffTimeInMillispublic void setBackoffTimeInMillis(int backoffTimeInMillis) 
 - 
getLockTimeInMillispublic int getLockTimeInMillis() 
 - 
setLockTimeInMillispublic void setLockTimeInMillis(int lockTimeInMillis) 
 - 
getLockOwnerpublic String getLockOwner() 
 - 
setLockOwnerpublic void setLockOwner(String lockOwner) 
 - 
isAutoActivatepublic boolean isAutoActivate() 
 - 
setProcessEnginespublic void setProcessEngines(List<ProcessEngineImpl> processEngines) 
 - 
setAutoActivatepublic void setAutoActivate(boolean isAutoActivate) 
 - 
getMaxJobsPerAcquisitionpublic int getMaxJobsPerAcquisition() 
 - 
setMaxJobsPerAcquisitionpublic void setMaxJobsPerAcquisition(int maxJobsPerAcquisition) 
 - 
getWaitIncreaseFactorpublic float getWaitIncreaseFactor() 
 - 
setWaitIncreaseFactorpublic void setWaitIncreaseFactor(float waitIncreaseFactor) 
 - 
getMaxWaitpublic long getMaxWait() 
 - 
setMaxWaitpublic void setMaxWait(long maxWait) 
 - 
getMaxBackoffpublic long getMaxBackoff() 
 - 
setMaxBackoffpublic void setMaxBackoff(long maxBackoff) 
 - 
getBackoffDecreaseThresholdpublic int getBackoffDecreaseThreshold() 
 - 
setBackoffDecreaseThresholdpublic void setBackoffDecreaseThreshold(int backoffDecreaseThreshold) 
 - 
getNamepublic String getName() 
 - 
getAcquireJobsCmdpublic Command<AcquiredJobs> getAcquireJobsCmd(int numJobs) 
 - 
getAcquireJobsCmdFactorypublic AcquireJobsCommandFactory getAcquireJobsCmdFactory() 
 - 
setAcquireJobsCmdFactorypublic void setAcquireJobsCmdFactory(AcquireJobsCommandFactory acquireJobsCmdFactory) 
 - 
isActivepublic boolean isActive() 
 - 
getRejectedJobsHandlerpublic RejectedJobsHandler getRejectedJobsHandler() 
 - 
setRejectedJobsHandlerpublic void setRejectedJobsHandler(RejectedJobsHandler rejectedJobsHandler) 
 - 
startJobAcquisitionThreadprotected void startJobAcquisitionThread() 
 - 
stopJobAcquisitionThreadprotected void stopJobAcquisitionThread() 
 - 
getAcquireJobsRunnablepublic AcquireJobsRunnable getAcquireJobsRunnable() 
 - 
getExecuteJobsRunnablepublic Runnable getExecuteJobsRunnable(List<String> jobIds, ProcessEngineImpl processEngine) 
 
- 
 
-