Class ExecutorPerTenantAsyncExecutor
java.lang.Object
org.flowable.job.service.impl.asyncexecutor.multitenant.ExecutorPerTenantAsyncExecutor
- All Implemented Interfaces:
AsyncExecutor,TenantAwareAsyncExecutor
An
AsyncExecutor that has one AsyncExecutor per tenant. So each tenant has its own acquiring threads and it's own threadpool for executing jobs.- Author:
- Joram Barrez
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanprotected booleanprotected JobServiceConfigurationprotected AsyncExecutorprotected TenantAwareAsyncExecutorFactoryprotected Map<String,AsyncExecutor> protected TenantInfoHolder -
Constructor Summary
ConstructorsConstructorDescriptionExecutorPerTenantAsyncExecutor(TenantInfoHolder tenantInfoHolder) ExecutorPerTenantAsyncExecutor(TenantInfoHolder tenantInfoHolder, TenantAwareAsyncExecutorFactory tenantAwareAyncExecutorFactory) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddTenantAsyncExecutor(String tenantId, boolean startExecutor) protected AsyncExecutorbooleanexecuteAsyncJob(JobInfo job) Offers the providedJobInfoto thisAsyncExecutorinstance to execute.intintintintintintintintintDeprecated.The optional task executor for the async executorgetTenantAsyncExecutor(String tenantId) intbooleanisActive()booleanvoidremoveTenantAsyncExecutor(String tenantId) voidsetAsyncJobLockTimeInMillis(int lockTimeInMillis) voidsetAutoActivate(boolean isAutoActivate) voidsetDefaultAsyncJobAcquireWaitTimeInMillis(int waitTimeInMillis) voidsetDefaultQueueSizeFullWaitTimeInMillis(int defaultQueueSizeFullWaitTimeInMillis) voidsetDefaultTimerJobAcquireWaitTimeInMillis(int waitTimeInMillis) voidsetJobServiceConfiguration(JobServiceConfiguration jobServiceConfiguration) voidsetMaxAsyncJobsDuePerAcquisition(int maxJobs) voidsetMaxTimerJobsPerAcquisition(int maxJobs) voidsetResetExpiredJobsInterval(int resetExpiredJobsInterval) voidsetResetExpiredJobsPageSize(int resetExpiredJobsPageSize) voidsetRetryWaitTimeInMillis(int retryWaitTimeInMillis) Deprecated.voidsetTaskExecutor(AsyncTaskExecutor taskExecutor) Set the task executor for this async executor.voidsetTimerLockTimeInMillis(int lockTimeInMillis) voidshutdown()Stops executing jobs.protected voidshutdownTenantExecutor(String tenantId) voidstart()Starts the Async Executor: jobs will be acquired and executed.protected voidstartTenantExecutor(String tenantId)
-
Field Details
-
tenantInfoHolder
-
tenantAwareAyncExecutorFactory
-
nullTenantIdAsyncExecutor
-
tenantExecutors
-
jobServiceConfiguration
-
active
protected boolean active -
autoActivate
protected boolean autoActivate
-
-
Constructor Details
-
ExecutorPerTenantAsyncExecutor
-
ExecutorPerTenantAsyncExecutor
public ExecutorPerTenantAsyncExecutor(TenantInfoHolder tenantInfoHolder, TenantAwareAsyncExecutorFactory tenantAwareAyncExecutorFactory)
-
-
Method Details
-
getTenantIds
- Specified by:
getTenantIdsin interfaceTenantAwareAsyncExecutor
-
addTenantAsyncExecutor
- Specified by:
addTenantAsyncExecutorin interfaceTenantAwareAsyncExecutor
-
getTenantAsyncExecutor
- Specified by:
getTenantAsyncExecutorin interfaceTenantAwareAsyncExecutor
-
removeTenantAsyncExecutor
- Specified by:
removeTenantAsyncExecutorin interfaceTenantAwareAsyncExecutor
-
determineAsyncExecutor
-
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
-
setJobServiceConfiguration
- Specified by:
setJobServiceConfigurationin interfaceAsyncExecutor
-
getJobServiceConfiguration
- Specified by:
getJobServiceConfigurationin interfaceAsyncExecutor
-
isAutoActivate
public boolean isAutoActivate()- Specified by:
isAutoActivatein interfaceAsyncExecutor
-
setAutoActivate
public void setAutoActivate(boolean isAutoActivate) - Specified by:
setAutoActivatein interfaceAsyncExecutor
-
isActive
public boolean isActive()- Specified by:
isActivein interfaceAsyncExecutor
-
start
public void start()Description copied from interface:AsyncExecutorStarts the Async Executor: jobs will be acquired and executed.- Specified by:
startin interfaceAsyncExecutor
-
startTenantExecutor
-
shutdown
public void shutdown()Description copied from interface:AsyncExecutorStops executing jobs.- Specified by:
shutdownin interfaceAsyncExecutor
-
shutdownTenantExecutor
-
getLockOwner
- Specified by:
getLockOwnerin interfaceAsyncExecutor
-
getTimerLockTimeInMillis
public int getTimerLockTimeInMillis()- Specified by:
getTimerLockTimeInMillisin interfaceAsyncExecutor
-
setTimerLockTimeInMillis
public void setTimerLockTimeInMillis(int lockTimeInMillis) - Specified by:
setTimerLockTimeInMillisin interfaceAsyncExecutor
-
getAsyncJobLockTimeInMillis
public int getAsyncJobLockTimeInMillis()- Specified by:
getAsyncJobLockTimeInMillisin interfaceAsyncExecutor
-
setAsyncJobLockTimeInMillis
public void setAsyncJobLockTimeInMillis(int lockTimeInMillis) - Specified by:
setAsyncJobLockTimeInMillisin interfaceAsyncExecutor
-
getDefaultTimerJobAcquireWaitTimeInMillis
public int getDefaultTimerJobAcquireWaitTimeInMillis()- Specified by:
getDefaultTimerJobAcquireWaitTimeInMillisin interfaceAsyncExecutor
-
setDefaultTimerJobAcquireWaitTimeInMillis
public void setDefaultTimerJobAcquireWaitTimeInMillis(int waitTimeInMillis) - Specified by:
setDefaultTimerJobAcquireWaitTimeInMillisin interfaceAsyncExecutor
-
getDefaultAsyncJobAcquireWaitTimeInMillis
public int getDefaultAsyncJobAcquireWaitTimeInMillis()- Specified by:
getDefaultAsyncJobAcquireWaitTimeInMillisin interfaceAsyncExecutor
-
setDefaultAsyncJobAcquireWaitTimeInMillis
public void setDefaultAsyncJobAcquireWaitTimeInMillis(int waitTimeInMillis) - Specified by:
setDefaultAsyncJobAcquireWaitTimeInMillisin interfaceAsyncExecutor
-
getDefaultQueueSizeFullWaitTimeInMillis
public int getDefaultQueueSizeFullWaitTimeInMillis()- Specified by:
getDefaultQueueSizeFullWaitTimeInMillisin interfaceAsyncExecutor
-
setDefaultQueueSizeFullWaitTimeInMillis
public void setDefaultQueueSizeFullWaitTimeInMillis(int defaultQueueSizeFullWaitTimeInMillis) - Specified by:
setDefaultQueueSizeFullWaitTimeInMillisin interfaceAsyncExecutor
-
getMaxAsyncJobsDuePerAcquisition
public int getMaxAsyncJobsDuePerAcquisition()- Specified by:
getMaxAsyncJobsDuePerAcquisitionin interfaceAsyncExecutor
-
setMaxAsyncJobsDuePerAcquisition
public void setMaxAsyncJobsDuePerAcquisition(int maxJobs) - Specified by:
setMaxAsyncJobsDuePerAcquisitionin interfaceAsyncExecutor
-
getMaxTimerJobsPerAcquisition
public int getMaxTimerJobsPerAcquisition()- Specified by:
getMaxTimerJobsPerAcquisitionin interfaceAsyncExecutor
-
setMaxTimerJobsPerAcquisition
public void setMaxTimerJobsPerAcquisition(int maxJobs) - Specified by:
setMaxTimerJobsPerAcquisitionin interfaceAsyncExecutor
-
getRetryWaitTimeInMillis
Deprecated.- Specified by:
getRetryWaitTimeInMillisin interfaceAsyncExecutor
-
setRetryWaitTimeInMillis
Deprecated.- Specified by:
setRetryWaitTimeInMillisin interfaceAsyncExecutor
-
getResetExpiredJobsInterval
public int getResetExpiredJobsInterval()- Specified by:
getResetExpiredJobsIntervalin interfaceAsyncExecutor
-
setResetExpiredJobsInterval
public void setResetExpiredJobsInterval(int resetExpiredJobsInterval) - Specified by:
setResetExpiredJobsIntervalin interfaceAsyncExecutor
-
getResetExpiredJobsPageSize
public int getResetExpiredJobsPageSize()- Specified by:
getResetExpiredJobsPageSizein interfaceAsyncExecutor
-
setResetExpiredJobsPageSize
public void setResetExpiredJobsPageSize(int resetExpiredJobsPageSize) - Specified by:
setResetExpiredJobsPageSizein interfaceAsyncExecutor
-
getTaskExecutor
Description copied from interface:AsyncExecutorThe optional task executor for the async executor- Specified by:
getTaskExecutorin interfaceAsyncExecutor- Returns:
- the task executor used by this async executor
-
setTaskExecutor
Description copied from interface:AsyncExecutorSet the task executor for this async executor.- Specified by:
setTaskExecutorin interfaceAsyncExecutor
-