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 tenantAsyncExecutor. For each tenant, there will be acquire threads, but only oneExecutorServicewill 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
Fields Modifier and Type Field Description protected Map<String,TenantAwareAcquireAsyncJobsDueRunnable>asyncJobAcquisitionRunnablesprotected Map<String,Thread>asyncJobAcquisitionThreadsprotected Map<String,TenantAwareResetExpiredJobsRunnable>resetExpiredJobsRunnablesprotected Map<String,Thread>resetExpiredJobsThreadsprotected TenantInfoHoldertenantInfoHolderprotected Map<String,TenantAwareAcquireTimerJobsRunnable>timerJobAcquisitionRunnablesprotected Map<String,Thread>timerJobAcquisitionThreads-
Fields 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, isMessageQueueMode, jobEntityManager, jobServiceConfiguration, resetExpiredJobsRunnable, temporaryJobQueue, timerJobRunnable, timerLifecycleListener
-
-
Constructor Summary
Constructors Constructor Description SharedExecutorServiceAsyncExecutor(TenantInfoHolder tenantInfoHolder)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddTenantAsyncExecutor(String tenantId, boolean startExecutor)AsyncExecutorgetTenantAsyncExecutor(String tenantId)Set<String>getTenantIds()voidremoveTenantAsyncExecutor(String tenantId)voidstart()Starts the async executorprotected voidstartAsyncJobAcquisitionForTenant(String tenantId)protected voidstartResetExpiredJobsForTenant(String tenantId)protected voidstartTimerJobAcquisitionForTenant(String tenantId)protected voidstopJobAcquisitionThread()Stops the acquisition threadprotected voidstopThreadsForTenant(String tenantId)protected voidunlockOwnedJobs()-
Methods 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, unacquireJobAfterRejection
-
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, getRetryWaitTimeInMillis, getTenantId, getTimerJobRunnable, getTimerLifecycleListener, getTimerLockPollRate, getTimerLockTimeInMillis, getTimerLockWaitTime, initializeJobEntityManager, initializeRunnables, isActive, isAutoActivate, isGlobalAcquireLockEnabled, isMessageQueueMode, isTimerRunnableNeeded, setAcquireRunnableThreadName, setAsyncJobLockTimeInMillis, setAsyncJobsDueLifecycleListener, setAsyncJobsDueRunnable, setAsyncJobsGlobalLockPollRate, setAsyncJobsGlobalLockWaitTime, setAsyncRunnableExecutionExceptionHandler, setAutoActivate, setConfiguration, setDefaultAsyncJobAcquireWaitTimeInMillis, setDefaultQueueSizeFullWaitTimeInMillis, setDefaultTimerJobAcquireWaitTimeInMillis, setExecuteAsyncRunnableFactory, setGlobalAcquireLockEnabled, setGlobalAcquireLockPrefix, setJobEntityManager, setJobServiceConfiguration, setLockOwner, setMaxAsyncJobsDuePerAcquisition, setMaxTimerJobsPerAcquisition, setMessageQueueMode, setMoveTimerExecutorPoolSize, setResetExpiredJobsInterval, setResetExpiredJobsPageSize, setResetExpiredJobsRunnable, setResetExpiredRunnableName, setRetryWaitTimeInMillis, setTenantId, setTimerJobRunnable, setTimerLifecycleListener, setTimerLockPollRate, setTimerLockTimeInMillis, setTimerLockWaitTime, setTimerRunnableNeeded, shutdown, stopRunnables
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.flowable.job.service.impl.asyncexecutor.AsyncExecutor
executeAsyncJob, getAsyncJobLockTimeInMillis, getDefaultAsyncJobAcquireWaitTimeInMillis, getDefaultQueueSizeFullWaitTimeInMillis, getDefaultTimerJobAcquireWaitTimeInMillis, getJobServiceConfiguration, getLockOwner, getMaxAsyncJobsDuePerAcquisition, getMaxTimerJobsPerAcquisition, getResetExpiredJobsInterval, getResetExpiredJobsPageSize, getRetryWaitTimeInMillis, getTaskExecutor, getTimerLockTimeInMillis, isActive, isAutoActivate, setAsyncJobLockTimeInMillis, setAutoActivate, setDefaultAsyncJobAcquireWaitTimeInMillis, setDefaultQueueSizeFullWaitTimeInMillis, setDefaultTimerJobAcquireWaitTimeInMillis, setJobServiceConfiguration, setMaxAsyncJobsDuePerAcquisition, setMaxTimerJobsPerAcquisition, setResetExpiredJobsInterval, setResetExpiredJobsPageSize, setRetryWaitTimeInMillis, setTaskExecutor, setTimerLockTimeInMillis, shutdown
-
-
-
-
Field Detail
-
tenantInfoHolder
protected TenantInfoHolder tenantInfoHolder
-
timerJobAcquisitionRunnables
protected Map<String,TenantAwareAcquireTimerJobsRunnable> timerJobAcquisitionRunnables
-
asyncJobAcquisitionRunnables
protected Map<String,TenantAwareAcquireAsyncJobsDueRunnable> asyncJobAcquisitionRunnables
-
resetExpiredJobsRunnables
protected Map<String,TenantAwareResetExpiredJobsRunnable> resetExpiredJobsRunnables
-
-
Constructor Detail
-
SharedExecutorServiceAsyncExecutor
public SharedExecutorServiceAsyncExecutor(TenantInfoHolder tenantInfoHolder)
-
-
Method Detail
-
getTenantIds
public Set<String> getTenantIds()
- Specified by:
getTenantIdsin interfaceTenantAwareAsyncExecutor
-
addTenantAsyncExecutor
public void addTenantAsyncExecutor(String tenantId, boolean startExecutor)
- Specified by:
addTenantAsyncExecutorin interfaceTenantAwareAsyncExecutor
-
getTenantAsyncExecutor
public AsyncExecutor getTenantAsyncExecutor(String tenantId)
- Specified by:
getTenantAsyncExecutorin interfaceTenantAwareAsyncExecutor
-
removeTenantAsyncExecutor
public void removeTenantAsyncExecutor(String tenantId)
- 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
protected void startTimerJobAcquisitionForTenant(String tenantId)
-
startAsyncJobAcquisitionForTenant
protected void startAsyncJobAcquisitionForTenant(String tenantId)
-
startResetExpiredJobsForTenant
protected void startResetExpiredJobsForTenant(String tenantId)
-
stopJobAcquisitionThread
protected void stopJobAcquisitionThread()
Description copied from class:DefaultAsyncJobExecutorStops the acquisition thread- Overrides:
stopJobAcquisitionThreadin classDefaultAsyncJobExecutor
-
stopThreadsForTenant
protected void stopThreadsForTenant(String tenantId)
-
-