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, timerJobAcquisitionThread
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 TypeMethodDescriptionboolean
executeAsyncJob
(JobInfo job) Offers the providedJobInfo
to thisAsyncExecutor
instance to execute.protected void
void
setRejectedJobsHandler
(SpringRejectedJobsHandler rejectedJobsHandler) SpringRejectedJobsHandler
implementation 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, unacquireJobAfterRejection
Methods inherited from class org.flowable.job.service.impl.asyncexecutor.AbstractAsyncExecutor
createRunnableForJob, 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
-
rejectedJobsHandler
-
-
Constructor Details
-
SpringAsyncExecutor
public SpringAsyncExecutor() -
SpringAsyncExecutor
-
-
Method Details
-
getRejectedJobsHandler
-
setRejectedJobsHandler
SpringRejectedJobsHandler
implementation that will be used when jobs were rejected by the task executor.- Parameters:
rejectedJobsHandler
-
-
executeAsyncJob
Description copied from interface:AsyncExecutor
Offers the providedJobInfo
to thisAsyncExecutor
instance 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:
executeAsyncJob
in interfaceAsyncExecutor
- Overrides:
executeAsyncJob
in classAbstractAsyncExecutor
-
initAsyncJobExecutionThreadPool
protected void initAsyncJobExecutionThreadPool()- Overrides:
initAsyncJobExecutionThreadPool
in classDefaultAsyncJobExecutor
-