Class ExecutorPerTenantAsyncExecutor
- java.lang.Object
-
- org.activiti.engine.impl.asyncexecutor.multitenant.ExecutorPerTenantAsyncExecutor
-
- All Implemented Interfaces:
AsyncExecutor,TenantAwareAsyncExecutor
public class ExecutorPerTenantAsyncExecutor extends java.lang.Object implements TenantAwareAsyncExecutor
AnAsyncExecutorthat has oneAsyncExecutorper tenant. So each tenant has its own acquiring threads and it's own threadpool for executing jobs.
-
-
Field Summary
Fields Modifier and Type Field Description protected booleanactiveprotected booleanautoActivateprotected ProcessEngineConfigurationImplprocessEngineConfigurationprotected TenantAwareAsyncExecutorFactorytenantAwareAyncExecutorFactoryprotected java.util.Map<java.lang.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
-
tenantExecutors
protected java.util.Map<java.lang.String,AsyncExecutor> tenantExecutors
-
processEngineConfiguration
protected ProcessEngineConfigurationImpl processEngineConfiguration
-
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 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
-
determineAsyncExecutor
protected AsyncExecutor determineAsyncExecutor()
-
executeAsyncJob
public boolean executeAsyncJob(Job job)
Description copied from interface:AsyncExecutorOffers the providedJobEntityto 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
-
getJobManager
public JobManager getJobManager()
-
setProcessEngineConfiguration
public void setProcessEngineConfiguration(ProcessEngineConfigurationImpl processEngineConfiguration)
- Specified by:
setProcessEngineConfigurationin interfaceAsyncExecutor
-
getProcessEngineConfiguration
public ProcessEngineConfigurationImpl getProcessEngineConfiguration()
- Specified by:
getProcessEngineConfigurationin 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
-
shutdown
public void shutdown()
Description copied from interface:AsyncExecutorStops executing jobs.- Specified by:
shutdownin interfaceAsyncExecutor
-
shutdownTenantExecutor
protected void shutdownTenantExecutor(java.lang.String tenantId)
-
getLockOwner
public java.lang.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
public int getRetryWaitTimeInMillis()
- Specified by:
getRetryWaitTimeInMillisin interfaceAsyncExecutor
-
setRetryWaitTimeInMillis
public void setRetryWaitTimeInMillis(int retryWaitTimeInMillis)
- 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
-
-