Class ExecutorPerTenantAsyncExecutor
- java.lang.Object
-
- org.flowable.job.service.impl.asyncexecutor.multitenant.ExecutorPerTenantAsyncExecutor
-
- All Implemented Interfaces:
AsyncExecutor,TenantAwareAsyncExecutor
public class ExecutorPerTenantAsyncExecutor extends Object implements TenantAwareAsyncExecutor
AnAsyncExecutorthat has oneAsyncExecutorper tenant. So each tenant has its own acquiring threads and it's own threadpool for executing jobs.- Author:
- Joram Barrez
-
-
Field Summary
Fields Modifier and Type Field Description protected booleanactiveprotected booleanautoActivateprotected JobServiceConfigurationjobServiceConfigurationprotected AsyncExecutornullTenantIdAsyncExecutorprotected TenantAwareAsyncExecutorFactorytenantAwareAyncExecutorFactoryprotected Map<String,AsyncExecutor>tenantExecutorsprotected TenantInfoHoldertenantInfoHolder
-
Constructor Summary
Constructors Constructor Description ExecutorPerTenantAsyncExecutor(TenantInfoHolder tenantInfoHolder)ExecutorPerTenantAsyncExecutor(TenantInfoHolder tenantInfoHolder, TenantAwareAsyncExecutorFactory tenantAwareAyncExecutorFactory)
-
Method Summary
-
-
-
Field Detail
-
tenantInfoHolder
protected TenantInfoHolder tenantInfoHolder
-
tenantAwareAyncExecutorFactory
protected TenantAwareAsyncExecutorFactory tenantAwareAyncExecutorFactory
-
nullTenantIdAsyncExecutor
protected AsyncExecutor nullTenantIdAsyncExecutor
-
tenantExecutors
protected Map<String,AsyncExecutor> tenantExecutors
-
jobServiceConfiguration
protected JobServiceConfiguration jobServiceConfiguration
-
active
protected boolean active
-
autoActivate
protected boolean autoActivate
-
-
Constructor Detail
-
ExecutorPerTenantAsyncExecutor
public ExecutorPerTenantAsyncExecutor(TenantInfoHolder tenantInfoHolder)
-
ExecutorPerTenantAsyncExecutor
public ExecutorPerTenantAsyncExecutor(TenantInfoHolder tenantInfoHolder, TenantAwareAsyncExecutorFactory tenantAwareAyncExecutorFactory)
-
-
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
-
determineAsyncExecutor
protected AsyncExecutor determineAsyncExecutor()
-
executeAsyncJob
public boolean executeAsyncJob(JobInfo job)
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
public void setJobServiceConfiguration(JobServiceConfiguration jobServiceConfiguration)
- Specified by:
setJobServiceConfigurationin interfaceAsyncExecutor
-
getJobServiceConfiguration
public JobServiceConfiguration 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
protected void startTenantExecutor(String tenantId)
-
shutdown
public void shutdown()
Description copied from interface:AsyncExecutorStops executing jobs.- Specified by:
shutdownin interfaceAsyncExecutor
-
shutdownTenantExecutor
protected void shutdownTenantExecutor(String tenantId)
-
getLockOwner
public String 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 public int getRetryWaitTimeInMillis()
Deprecated.- Specified by:
getRetryWaitTimeInMillisin interfaceAsyncExecutor
-
setRetryWaitTimeInMillis
@Deprecated public void setRetryWaitTimeInMillis(int retryWaitTimeInMillis)
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
public AsyncTaskExecutor 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
public void setTaskExecutor(AsyncTaskExecutor taskExecutor)
Description copied from interface:AsyncExecutorSet the task executor for this async executor.- Specified by:
setTaskExecutorin interfaceAsyncExecutor
-
-