Class SharedExecutorServiceAsyncExecutor
- java.lang.Object
-
- org.activiti.engine.impl.asyncexecutor.DefaultAsyncJobExecutor
-
- org.activiti.engine.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.
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.Map<java.lang.String,TenantAwareAcquireAsyncJobsDueRunnable>asyncJobAcquisitionRunnablesprotected java.util.Map<java.lang.String,java.lang.Thread>asyncJobAcquisitionThreadsprotected java.util.Map<java.lang.String,TenantAwareResetExpiredJobsRunnable>resetExpiredJobsRunnablesprotected java.util.Map<java.lang.String,java.lang.Thread>resetExpiredJobsThreadsprotected TenantInfoHoldertenantInfoHolderprotected java.util.Map<java.lang.String,TenantAwareAcquireTimerJobsRunnable>timerJobAcquisitionRunnablesprotected java.util.Map<java.lang.String,java.lang.Thread>timerJobAcquisitionThreads-
Fields inherited from class org.activiti.engine.impl.asyncexecutor.DefaultAsyncJobExecutor
asyncJobAcquisitionThread, asyncJobLockTimeInMillis, asyncJobsDueRunnable, corePoolSize, defaultAsyncJobAcquireWaitTimeInMillis, defaultQueueSizeFullWaitTime, defaultTimerJobAcquireWaitTimeInMillis, executeAsyncRunnableFactory, executorService, isActive, isAutoActivate, isMessageQueueMode, keepAliveTime, lockOwner, maxAsyncJobsDuePerAcquisition, maxPoolSize, maxTimerJobsPerAcquisition, processEngineConfiguration, queueSize, resetExpiredJobsInterval, resetExpiredJobsPageSize, resetExpiredJobsRunnable, resetExpiredJobThread, retryWaitTimeInMillis, secondsToWaitOnShutdown, temporaryJobQueue, threadPoolQueue, timerJobAcquisitionThread, timerJobRunnable, timerLockTimeInMillis
-
-
Constructor Summary
Constructors Constructor Description SharedExecutorServiceAsyncExecutor(TenantInfoHolder tenantInfoHolder)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddTenantAsyncExecutor(java.lang.String tenantId, boolean startExecutor)java.util.Set<java.lang.String>getTenantIds()voidremoveTenantAsyncExecutor(java.lang.String tenantId)voidstart()Starts the async executorprotected voidstartAsyncJobAcquisitionForTenant(java.lang.String tenantId)protected voidstartResetExpiredJobsForTenant(java.lang.String tenantId)protected voidstartTimerJobAcquisitionForTenant(java.lang.String tenantId)protected voidstopJobAcquisitionThread()Stops the acquisition threadprotected voidstopThreadsForTenant(java.lang.String tenantId)-
Methods inherited from class org.activiti.engine.impl.asyncexecutor.DefaultAsyncJobExecutor
applyConfig, createRunnableForJob, executeAsyncJob, executeTemporaryJobs, getAsyncJobAcquisitionThread, getAsyncJobLockTimeInMillis, getCorePoolSize, getDefaultAsyncJobAcquireWaitTimeInMillis, getDefaultQueueSizeFullWaitTimeInMillis, getDefaultTimerJobAcquireWaitTimeInMillis, getExecuteAsyncRunnableFactory, getExecutorService, getKeepAliveTime, getLockOwner, getMaxAsyncJobsDuePerAcquisition, getMaxPoolSize, getMaxTimerJobsPerAcquisition, getProcessEngineConfiguration, getQueueSize, getResetExpiredJobsInterval, getResetExpiredJobsPageSize, getResetExpiredJobThread, getRetryWaitTimeInMillis, getSecondsToWaitOnShutdown, getThreadPoolQueue, getTimerJobAcquisitionThread, getTimerLockTimeInMillis, initAsyncJobExecutionThreadPool, isActive, isAutoActivate, isMessageQueueMode, setAsyncJobAcquisitionThread, setAsyncJobLockTimeInMillis, setAsyncJobsDueRunnable, setAutoActivate, setCorePoolSize, setDefaultAsyncJobAcquireWaitTimeInMillis, setDefaultQueueSizeFullWaitTimeInMillis, setDefaultTimerJobAcquireWaitTimeInMillis, setExecuteAsyncRunnableFactory, setExecutorService, setKeepAliveTime, setLockOwner, setMaxAsyncJobsDuePerAcquisition, setMaxPoolSize, setMaxTimerJobsPerAcquisition, setMessageQueueMode, setProcessEngineConfiguration, setQueueSize, setResetExpiredJobsInterval, setResetExpiredJobsPageSize, setResetExpiredJobsRunnable, setResetExpiredJobThread, setRetryWaitTimeInMillis, setSecondsToWaitOnShutdown, setThreadPoolQueue, setTimerJobAcquisitionThread, setTimerJobRunnable, setTimerLockTimeInMillis, shutdown, startJobAcquisitionThread, startResetExpiredJobsThread, startTimerAcquisitionThread, stopExecutingAsyncJobs, stopResetExpiredJobsThread, stopTimerAcquisitionThread
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.activiti.engine.impl.asyncexecutor.AsyncExecutor
executeAsyncJob, getAsyncJobLockTimeInMillis, getDefaultAsyncJobAcquireWaitTimeInMillis, getDefaultQueueSizeFullWaitTimeInMillis, getDefaultTimerJobAcquireWaitTimeInMillis, getLockOwner, getMaxAsyncJobsDuePerAcquisition, getMaxTimerJobsPerAcquisition, getProcessEngineConfiguration, getResetExpiredJobsInterval, getResetExpiredJobsPageSize, getRetryWaitTimeInMillis, getTimerLockTimeInMillis, isActive, isAutoActivate, setAsyncJobLockTimeInMillis, setAutoActivate, setDefaultAsyncJobAcquireWaitTimeInMillis, setDefaultQueueSizeFullWaitTimeInMillis, setDefaultTimerJobAcquireWaitTimeInMillis, setMaxAsyncJobsDuePerAcquisition, setMaxTimerJobsPerAcquisition, setProcessEngineConfiguration, setResetExpiredJobsInterval, setResetExpiredJobsPageSize, setRetryWaitTimeInMillis, setTimerLockTimeInMillis, shutdown
-
-
-
-
Field Detail
-
tenantInfoHolder
protected TenantInfoHolder tenantInfoHolder
-
timerJobAcquisitionThreads
protected java.util.Map<java.lang.String,java.lang.Thread> timerJobAcquisitionThreads
-
timerJobAcquisitionRunnables
protected java.util.Map<java.lang.String,TenantAwareAcquireTimerJobsRunnable> timerJobAcquisitionRunnables
-
asyncJobAcquisitionThreads
protected java.util.Map<java.lang.String,java.lang.Thread> asyncJobAcquisitionThreads
-
asyncJobAcquisitionRunnables
protected java.util.Map<java.lang.String,TenantAwareAcquireAsyncJobsDueRunnable> asyncJobAcquisitionRunnables
-
resetExpiredJobsThreads
protected java.util.Map<java.lang.String,java.lang.Thread> resetExpiredJobsThreads
-
resetExpiredJobsRunnables
protected java.util.Map<java.lang.String,TenantAwareResetExpiredJobsRunnable> resetExpiredJobsRunnables
-
-
Constructor Detail
-
SharedExecutorServiceAsyncExecutor
public SharedExecutorServiceAsyncExecutor(TenantInfoHolder tenantInfoHolder)
-
-
Method Detail
-
getTenantIds
public java.util.Set<java.lang.String> getTenantIds()
- Specified by:
getTenantIdsin interfaceTenantAwareAsyncExecutor
-
addTenantAsyncExecutor
public void addTenantAsyncExecutor(java.lang.String tenantId, boolean startExecutor)- Specified by:
addTenantAsyncExecutorin interfaceTenantAwareAsyncExecutor
-
removeTenantAsyncExecutor
public void removeTenantAsyncExecutor(java.lang.String tenantId)
- Specified by:
removeTenantAsyncExecutorin interfaceTenantAwareAsyncExecutor
-
start
public void start()
Description copied from class:DefaultAsyncJobExecutorStarts the async executor- Specified by:
startin interfaceAsyncExecutor- Overrides:
startin classDefaultAsyncJobExecutor
-
startTimerJobAcquisitionForTenant
protected void startTimerJobAcquisitionForTenant(java.lang.String tenantId)
-
startAsyncJobAcquisitionForTenant
protected void startAsyncJobAcquisitionForTenant(java.lang.String tenantId)
-
startResetExpiredJobsForTenant
protected void startResetExpiredJobsForTenant(java.lang.String tenantId)
-
stopJobAcquisitionThread
protected void stopJobAcquisitionThread()
Description copied from class:DefaultAsyncJobExecutorStops the acquisition thread- Overrides:
stopJobAcquisitionThreadin classDefaultAsyncJobExecutor
-
stopThreadsForTenant
protected void stopThreadsForTenant(java.lang.String tenantId)
-
-