Class DefaultAsyncJobExecutor
java.lang.Object
org.flowable.job.service.impl.asyncexecutor.AbstractAsyncExecutor
org.flowable.job.service.impl.asyncexecutor.DefaultAsyncJobExecutor
- All Implemented Interfaces:
AsyncExecutor
- Direct Known Subclasses:
DefaultAsyncHistoryJobExecutor
,SharedExecutorServiceAsyncExecutor
,SpringAsyncExecutor
- Author:
- Joram Barrez, Tijs Rademakers
-
Nested Class Summary
Nested classes/interfaces inherited from class org.flowable.job.service.impl.asyncexecutor.AbstractAsyncExecutor
AbstractAsyncExecutor.AcquireAsyncJobsDueRunnableConfiguration, AbstractAsyncExecutor.AcquireTimerRunnableConfiguration
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Thread
Thread responsible for async job acquisition.protected Thread
Thread responsible for resetting the expired jobs.protected boolean
protected AsyncTaskExecutor
The async task executor used for job execution.protected Thread
Thread responsible for timer job acquisition.Fields inherited from class org.flowable.job.service.impl.asyncexecutor.AbstractAsyncExecutor
asyncJobsDueLifecycleListener, asyncJobsDueRunnable, asyncRunnableExecutionExceptionHandler, configuration, executeAsyncRunnableFactory, isActive, isAutoActivate, jobEntityManager, jobServiceConfiguration, resetExpiredJobsRunnable, temporaryJobQueue, timerJobRunnable, timerLifecycleListener
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected ResetExpiredJobsRunnable
createResetExpiredJobsRunnable
(String resetRunnableName) protected boolean
executeAsyncJob
(JobInfo job, Runnable runnable) The optional task executor for the async executorprotected void
boolean
boolean
boolean
boolean
protected void
sendRejectedEvent
(JobInfo job) void
setAsyncJobAcquisitionEnabled
(boolean isAsyncJobAcquisitionEnabled) void
setAsyncJobAcquisitionThread
(Thread asyncJobAcquisitionThread) void
setResetExpiredJobEnabled
(boolean isResetExpiredJobEnabled) void
setResetExpiredJobThread
(Thread resetExpiredJobThread) void
setTaskExecutor
(AsyncTaskExecutor taskExecutor) Set the task executor for this async executor.void
setTimerJobAcquisitionEnabled
(boolean isTimerJobAcquisitionEnabled) void
setTimerJobAcquisitionThread
(Thread timerJobAcquisitionThread) void
setUnlockOwnedJobs
(boolean unlockOwnedJobs) protected void
protected void
protected void
Starts the acquisition threadprotected void
Starts the reset expired jobs threadprotected void
protected void
protected void
Stops the acquisition threadprotected void
Stops the reset expired jobs threadprotected void
protected void
Methods inherited from class org.flowable.job.service.impl.asyncexecutor.AbstractAsyncExecutor
createRunnableForJob, executeAsyncJob, executeTemporaryJobs, getAsyncJobLockTimeInMillis, getAsyncJobsDueLifecycleListener, getAsyncJobsDueRunnable, getAsyncJobsGlobalLockPollRate, getAsyncJobsGlobalLockWaitTime, getAsyncRunnableExecutionExceptionHandler, getConfiguration, getDefaultAsyncJobAcquireWaitTimeInMillis, getDefaultQueueSizeFullWaitTimeInMillis, getDefaultTimerJobAcquireWaitTimeInMillis, getExecuteAsyncRunnableFactory, getGlobalAcquireLockPrefix, getJobServiceConfiguration, getLockOwner, getMaxAsyncJobsDuePerAcquisition, getMaxTimerJobsPerAcquisition, getMoveTimerExecutorPoolSize, getResetExpiredJobsInterval, getResetExpiredJobsPageSize, getResetExpiredJobsRunnable, getTenantId, getTimerJobRunnable, getTimerLifecycleListener, getTimerLockPollRate, getTimerLockTimeInMillis, getTimerLockWaitTime, initializeJobEntityManager, initializeRunnables, isActive, isAutoActivate, isGlobalAcquireLockEnabled, isTimerRunnableNeeded, setAcquireRunnableThreadName, setAsyncJobLockTimeInMillis, setAsyncJobsDueLifecycleListener, setAsyncJobsDueRunnable, setAsyncJobsGlobalLockPollRate, setAsyncJobsGlobalLockWaitTime, setAsyncRunnableExecutionExceptionHandler, setAutoActivate, setConfiguration, setDefaultAsyncJobAcquireWaitTimeInMillis, setDefaultQueueSizeFullWaitTimeInMillis, setDefaultTimerJobAcquireWaitTimeInMillis, setExecuteAsyncRunnableFactory, setGlobalAcquireLockEnabled, setGlobalAcquireLockPrefix, setJobEntityManager, setJobServiceConfiguration, setLockOwner, setMaxAsyncJobsDuePerAcquisition, setMaxTimerJobsPerAcquisition, setMoveTimerExecutorPoolSize, setResetExpiredJobsInterval, setResetExpiredJobsPageSize, setResetExpiredJobsRunnable, setResetExpiredRunnableName, setTenantId, setTimerJobRunnable, setTimerLifecycleListener, setTimerLockPollRate, setTimerLockTimeInMillis, setTimerLockWaitTime, setTimerRunnableNeeded, shutdown, start, stopRunnables, unlockOwnedJobs
-
Field Details
-
asyncJobAcquisitionThread
Thread responsible for async job acquisition. -
timerJobAcquisitionThread
Thread responsible for timer job acquisition. -
resetExpiredJobThread
Thread responsible for resetting the expired jobs. -
taskExecutor
The async task executor used for job execution. -
shutdownTaskExecutor
protected boolean shutdownTaskExecutor
-
-
Constructor Details
-
DefaultAsyncJobExecutor
public DefaultAsyncJobExecutor() -
DefaultAsyncJobExecutor
-
-
Method Details
-
executeAsyncJob
- Specified by:
executeAsyncJob
in classAbstractAsyncExecutor
-
sendRejectedEvent
-
unacquireJobAfterRejection
-
startAdditionalComponents
protected void startAdditionalComponents()- Specified by:
startAdditionalComponents
in classAbstractAsyncExecutor
-
shutdownAdditionalComponents
protected void shutdownAdditionalComponents()- Specified by:
shutdownAdditionalComponents
in classAbstractAsyncExecutor
-
createResetExpiredJobsRunnable
- Specified by:
createResetExpiredJobsRunnable
in classAbstractAsyncExecutor
-
initAsyncJobExecutionThreadPool
protected void initAsyncJobExecutionThreadPool() -
stopExecutingAsyncJobs
protected void stopExecutingAsyncJobs() -
startJobAcquisitionThread
protected void startJobAcquisitionThread()Starts the acquisition thread -
startTimerAcquisitionThread
protected void startTimerAcquisitionThread() -
stopJobAcquisitionThread
protected void stopJobAcquisitionThread()Stops the acquisition thread -
stopTimerAcquisitionThread
protected void stopTimerAcquisitionThread() -
startResetExpiredJobsThread
protected void startResetExpiredJobsThread()Starts the reset expired jobs thread -
stopResetExpiredJobsThread
protected void stopResetExpiredJobsThread()Stops the reset expired jobs thread -
isAsyncJobAcquisitionEnabled
public boolean isAsyncJobAcquisitionEnabled() -
setAsyncJobAcquisitionEnabled
public void setAsyncJobAcquisitionEnabled(boolean isAsyncJobAcquisitionEnabled) -
isTimerJobAcquisitionEnabled
public boolean isTimerJobAcquisitionEnabled() -
setTimerJobAcquisitionEnabled
public void setTimerJobAcquisitionEnabled(boolean isTimerJobAcquisitionEnabled) -
isResetExpiredJobEnabled
public boolean isResetExpiredJobEnabled() -
setResetExpiredJobEnabled
public void setResetExpiredJobEnabled(boolean isResetExpiredJobEnabled) -
getTimerJobAcquisitionThread
-
setTimerJobAcquisitionThread
-
getAsyncJobAcquisitionThread
-
setAsyncJobAcquisitionThread
-
getResetExpiredJobThread
-
setResetExpiredJobThread
-
isUnlockOwnedJobs
public boolean isUnlockOwnedJobs() -
setUnlockOwnedJobs
public void setUnlockOwnedJobs(boolean unlockOwnedJobs) -
getTaskExecutor
Description copied from interface:AsyncExecutor
The optional task executor for the async executor- Returns:
- the task executor used by this async executor
-
setTaskExecutor
Description copied from interface:AsyncExecutor
Set the task executor for this async executor.
-