Package org.flowable.spring.job.service
Class SpringAsyncExecutor
java.lang.Object
org.flowable.job.service.impl.asyncexecutor.AbstractAsyncExecutor
org.flowable.job.service.impl.asyncexecutor.DefaultAsyncJobExecutor
org.flowable.spring.job.service.SpringAsyncExecutor
- All Implemented Interfaces:
AsyncExecutor
- Direct Known Subclasses:
SpringAsyncHistoryExecutor
This is an AsyncExecutor implementation which allows invoking a custom job rejected jobs handler.
The idea behind this implementation is to externalize the configuration of the task executor, so it can leverage to Application servers controller thread pools, for example using the commonj API. The use of unmanaged thread in application servers is discouraged by the Java EE spec.
- Author:
- Pablo Ganga, Joram Barrez
-
Nested Class Summary
Nested classes/interfaces inherited from class org.flowable.job.service.impl.asyncexecutor.AbstractAsyncExecutor
AbstractAsyncExecutor.AcquireAsyncJobsDueRunnableConfiguration, AbstractAsyncExecutor.AcquireTimerRunnableConfiguration -
Field Summary
FieldsFields inherited from class org.flowable.job.service.impl.asyncexecutor.DefaultAsyncJobExecutor
asyncJobAcquisitionThread, resetExpiredJobThread, shutdownTaskExecutor, taskExecutor, timerJobAcquisitionThreadFields inherited from class org.flowable.job.service.impl.asyncexecutor.AbstractAsyncExecutor
asyncJobsDueLifecycleListener, asyncJobsDueRunnable, asyncRunnableExecutionExceptionHandler, configuration, executeAsyncRunnableFactory, isActive, isAutoActivate, jobEntityManager, jobExecutionObservationProvider, jobServiceConfiguration, resetExpiredJobsRunnable, temporaryJobQueue, timerJobRunnable, timerLifecycleListener -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanexecuteAsyncJob(JobInfo job) Offers the providedJobInfoto thisAsyncExecutorinstance to execute.protected voidvoidsetRejectedJobsHandler(SpringRejectedJobsHandler rejectedJobsHandler) SpringRejectedJobsHandlerimplementation that will be used when jobs were rejected by the task executor.Methods inherited from class org.flowable.job.service.impl.asyncexecutor.DefaultAsyncJobExecutor
createResetExpiredJobsRunnable, executeAsyncJob, getAsyncJobAcquisitionThread, getResetExpiredJobThread, getTaskExecutor, getTimerJobAcquisitionThread, isAsyncJobAcquisitionEnabled, isResetExpiredJobEnabled, isTimerJobAcquisitionEnabled, isUnlockOwnedJobs, sendRejectedEvent, setAsyncJobAcquisitionEnabled, setAsyncJobAcquisitionThread, setResetExpiredJobEnabled, setResetExpiredJobThread, setTaskExecutor, setTimerJobAcquisitionEnabled, setTimerJobAcquisitionThread, setUnlockOwnedJobs, shutdownAdditionalComponents, startAdditionalComponents, startJobAcquisitionThread, startResetExpiredJobsThread, startTimerAcquisitionThread, stopExecutingAsyncJobs, stopJobAcquisitionThread, stopResetExpiredJobsThread, stopTimerAcquisitionThread, unacquireJobAfterRejectionMethods inherited from class org.flowable.job.service.impl.asyncexecutor.AbstractAsyncExecutor
createRunnableForJob, executeTemporaryJobs, getAsyncJobLockTimeInMillis, getAsyncJobsDueLifecycleListener, getAsyncJobsDueRunnable, getAsyncJobsGlobalLockPollRate, getAsyncJobsGlobalLockWaitTime, getAsyncRunnableExecutionExceptionHandler, getConfiguration, getDefaultAsyncJobAcquireWaitTimeInMillis, getDefaultQueueSizeFullWaitTimeInMillis, getDefaultTimerJobAcquireWaitTimeInMillis, getExecuteAsyncRunnableFactory, getGlobalAcquireLockPrefix, getJobExecutionObservationProvider, 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, setJobExecutionObservationProvider, setJobServiceConfiguration, setLockOwner, setMaxAsyncJobsDuePerAcquisition, setMaxTimerJobsPerAcquisition, setMoveTimerExecutorPoolSize, setResetExpiredJobsInterval, setResetExpiredJobsPageSize, setResetExpiredJobsRunnable, setResetExpiredRunnableName, setTenantId, setTimerJobRunnable, setTimerLifecycleListener, setTimerLockPollRate, setTimerLockTimeInMillis, setTimerLockWaitTime, setTimerRunnableNeeded, shutdown, start, stopRunnables, unlockOwnedJobs
-
Field Details
-
rejectedJobsHandler
-
-
Constructor Details
-
SpringAsyncExecutor
public SpringAsyncExecutor() -
SpringAsyncExecutor
-
-
Method Details
-
getRejectedJobsHandler
-
setRejectedJobsHandler
SpringRejectedJobsHandlerimplementation that will be used when jobs were rejected by the task executor.- Parameters:
rejectedJobsHandler-
-
executeAsyncJob
Description copied from interface:AsyncExecutorOffers the providedJobInfoto thisAsyncExecutorinstance to execute. If the offering does not work for some reason, false will be returned (For example when the job queue is full in theDefaultAsyncJobExecutor).- Specified by:
executeAsyncJobin interfaceAsyncExecutor- Overrides:
executeAsyncJobin classAbstractAsyncExecutor
-
initAsyncJobExecutionThreadPool
protected void initAsyncJobExecutionThreadPool()- Overrides:
initAsyncJobExecutionThreadPoolin classDefaultAsyncJobExecutor
-