public abstract class JobExecutor extends Object
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.
Modifier and Type | Field and Description |
---|---|
protected AcquireJobsCommandFactory |
acquireJobsCmdFactory |
protected AcquireJobsRunnable |
acquireJobsRunnable |
protected int |
backoffDecreaseThreshold
The number of job acquisition cycles without locking failures
until the backoff level is reduced.
|
protected int |
backoffTimeInMillis |
protected boolean |
isActive |
protected boolean |
isAutoActivate |
protected Thread |
jobAcquisitionThread |
protected String |
lockOwner |
protected int |
lockTimeInMillis |
protected long |
maxBackoff |
protected int |
maxJobsPerAcquisition |
protected long |
maxWait |
protected String |
name |
protected List<ProcessEngineImpl> |
processEngines |
protected RejectedJobsHandler |
rejectedJobsHandler |
protected float |
waitIncreaseFactor |
protected int |
waitTimeInMillis |
Constructor and Description |
---|
JobExecutor() |
protected String name
protected List<ProcessEngineImpl> processEngines
protected AcquireJobsCommandFactory acquireJobsCmdFactory
protected AcquireJobsRunnable acquireJobsRunnable
protected RejectedJobsHandler rejectedJobsHandler
protected Thread jobAcquisitionThread
protected boolean isAutoActivate
protected boolean isActive
protected int maxJobsPerAcquisition
protected int waitTimeInMillis
protected float waitIncreaseFactor
protected long maxWait
protected int backoffTimeInMillis
protected long maxBackoff
protected int backoffDecreaseThreshold
protected String lockOwner
protected int lockTimeInMillis
public void start()
public void shutdown()
protected void ensureInitialization()
protected void ensureCleanup()
public void jobWasAdded()
public void registerProcessEngine(ProcessEngineImpl processEngine)
public void unregisterProcessEngine(ProcessEngineImpl processEngine)
protected abstract void startExecutingJobs()
protected abstract void stopExecutingJobs()
public abstract void executeJobs(List<String> jobIds, ProcessEngineImpl processEngine)
@Deprecated public void executeJobs(List<String> jobIds)
executeJobs(List, ProcessEngineImpl)
insteadjobIds
- public void logAcquisitionAttempt(ProcessEngineImpl engine)
public void logAcquiredJobs(ProcessEngineImpl engine, int numJobs)
public void logAcquisitionFailureJobs(ProcessEngineImpl engine, int numJobs)
public void logRejectedExecution(ProcessEngineImpl engine, int numJobs)
public List<ProcessEngineImpl> getProcessEngines()
public Iterator<ProcessEngineImpl> engineIterator()
public boolean hasRegisteredEngine(ProcessEngineImpl engine)
@Deprecated public CommandExecutor getCommandExecutor()
getProcessEngines()
instead@Deprecated public void setCommandExecutor(CommandExecutor commandExecutorTxRequired)
registerProcessEngine(ProcessEngineImpl)
insteadcommandExecutorTxRequired
- public int getWaitTimeInMillis()
public void setWaitTimeInMillis(int waitTimeInMillis)
public int getBackoffTimeInMillis()
public void setBackoffTimeInMillis(int backoffTimeInMillis)
public int getLockTimeInMillis()
public void setLockTimeInMillis(int lockTimeInMillis)
public String getLockOwner()
public void setLockOwner(String lockOwner)
public boolean isAutoActivate()
public void setProcessEngines(List<ProcessEngineImpl> processEngines)
public void setAutoActivate(boolean isAutoActivate)
public int getMaxJobsPerAcquisition()
public void setMaxJobsPerAcquisition(int maxJobsPerAcquisition)
public float getWaitIncreaseFactor()
public void setWaitIncreaseFactor(float waitIncreaseFactor)
public long getMaxWait()
public void setMaxWait(long maxWait)
public long getMaxBackoff()
public void setMaxBackoff(long maxBackoff)
public int getBackoffDecreaseThreshold()
public void setBackoffDecreaseThreshold(int backoffDecreaseThreshold)
public String getName()
public Command<AcquiredJobs> getAcquireJobsCmd(int numJobs)
public AcquireJobsCommandFactory getAcquireJobsCmdFactory()
public void setAcquireJobsCmdFactory(AcquireJobsCommandFactory acquireJobsCmdFactory)
public boolean isActive()
public RejectedJobsHandler getRejectedJobsHandler()
public void setRejectedJobsHandler(RejectedJobsHandler rejectedJobsHandler)
protected void startJobAcquisitionThread()
protected void stopJobAcquisitionThread()
public AcquireJobsRunnable getAcquireJobsRunnable()
public Runnable getExecuteJobsRunnable(List<String> jobIds, ProcessEngineImpl processEngine)
Copyright © 2020. All rights reserved.