Class SharedExecutorServiceAsyncExecutor
java.lang.Object
org.flowable.job.service.impl.asyncexecutor.AbstractAsyncExecutor
org.flowable.job.service.impl.asyncexecutor.DefaultAsyncJobExecutor
org.flowable.job.service.impl.asyncexecutor.multitenant.SharedExecutorServiceAsyncExecutor
- All Implemented Interfaces:
AsyncExecutor,TenantAwareAsyncExecutor
public class SharedExecutorServiceAsyncExecutor
extends DefaultAsyncJobExecutor
implements TenantAwareAsyncExecutor
Multi tenant
AsyncExecutor.
For each tenant, there will be acquire threads, but only one ExecutorService will be used once the jobs are acquired.- Author:
- Joram Barrez
-
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 Map<String,TenantAwareAcquireAsyncJobsDueRunnable> protected Map<String,TenantAwareResetExpiredJobsRunnable> protected TenantInfoHolderprotected Map<String,TenantAwareAcquireTimerJobsRunnable> Fields 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, jobServiceConfiguration, resetExpiredJobsRunnable, temporaryJobQueue, timerJobRunnable, timerLifecycleListener -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddTenantAsyncExecutor(String tenantId, boolean startExecutor) getTenantAsyncExecutor(String tenantId) voidremoveTenantAsyncExecutor(String tenantId) voidstart()Starts the async executorprotected voidstartAsyncJobAcquisitionForTenant(String tenantId) protected voidstartResetExpiredJobsForTenant(String tenantId) protected voidstartTimerJobAcquisitionForTenant(String tenantId) protected voidStops the acquisition threadprotected voidstopThreadsForTenant(String tenantId) protected voidMethods inherited from class org.flowable.job.service.impl.asyncexecutor.DefaultAsyncJobExecutor
createResetExpiredJobsRunnable, executeAsyncJob, getAsyncJobAcquisitionThread, getResetExpiredJobThread, getTaskExecutor, getTimerJobAcquisitionThread, initAsyncJobExecutionThreadPool, isAsyncJobAcquisitionEnabled, isResetExpiredJobEnabled, isTimerJobAcquisitionEnabled, isUnlockOwnedJobs, sendRejectedEvent, setAsyncJobAcquisitionEnabled, setAsyncJobAcquisitionThread, setResetExpiredJobEnabled, setResetExpiredJobThread, setTaskExecutor, setTimerJobAcquisitionEnabled, setTimerJobAcquisitionThread, setUnlockOwnedJobs, shutdownAdditionalComponents, startAdditionalComponents, startJobAcquisitionThread, startResetExpiredJobsThread, startTimerAcquisitionThread, stopExecutingAsyncJobs, stopResetExpiredJobsThread, stopTimerAcquisitionThread, unacquireJobAfterRejectionMethods 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, stopRunnablesMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.flowable.job.service.impl.asyncexecutor.AsyncExecutor
executeAsyncJob, getAsyncJobLockTimeInMillis, getDefaultAsyncJobAcquireWaitTimeInMillis, getDefaultQueueSizeFullWaitTimeInMillis, getDefaultTimerJobAcquireWaitTimeInMillis, getJobServiceConfiguration, getLockOwner, getMaxAsyncJobsDuePerAcquisition, getMaxTimerJobsPerAcquisition, getResetExpiredJobsInterval, getResetExpiredJobsPageSize, getTaskExecutor, getTimerLockTimeInMillis, isActive, isAutoActivate, setAsyncJobLockTimeInMillis, setAutoActivate, setDefaultAsyncJobAcquireWaitTimeInMillis, setDefaultQueueSizeFullWaitTimeInMillis, setDefaultTimerJobAcquireWaitTimeInMillis, setJobServiceConfiguration, setMaxAsyncJobsDuePerAcquisition, setMaxTimerJobsPerAcquisition, setResetExpiredJobsInterval, setResetExpiredJobsPageSize, setTaskExecutor, setTimerLockTimeInMillis, shutdown
-
Field Details
-
tenantInfoHolder
-
timerJobAcquisitionThreads
-
timerJobAcquisitionRunnables
-
asyncJobAcquisitionThreads
-
asyncJobAcquisitionRunnables
-
resetExpiredJobsThreads
-
resetExpiredJobsRunnables
-
-
Constructor Details
-
SharedExecutorServiceAsyncExecutor
-
-
Method Details
-
getTenantIds
- Specified by:
getTenantIdsin interfaceTenantAwareAsyncExecutor
-
addTenantAsyncExecutor
- Specified by:
addTenantAsyncExecutorin interfaceTenantAwareAsyncExecutor
-
getTenantAsyncExecutor
- Specified by:
getTenantAsyncExecutorin interfaceTenantAwareAsyncExecutor
-
removeTenantAsyncExecutor
- Specified by:
removeTenantAsyncExecutorin interfaceTenantAwareAsyncExecutor
-
unlockOwnedJobs
protected void unlockOwnedJobs()- Overrides:
unlockOwnedJobsin classAbstractAsyncExecutor
-
start
public void start()Description copied from class:AbstractAsyncExecutorStarts the async executor- Specified by:
startin interfaceAsyncExecutor- Overrides:
startin classAbstractAsyncExecutor
-
startTimerJobAcquisitionForTenant
-
startAsyncJobAcquisitionForTenant
-
startResetExpiredJobsForTenant
-
stopJobAcquisitionThread
protected void stopJobAcquisitionThread()Description copied from class:DefaultAsyncJobExecutorStops the acquisition thread- Overrides:
stopJobAcquisitionThreadin classDefaultAsyncJobExecutor
-
stopThreadsForTenant
-