public class ExecutorPerTenantAsyncExecutor extends Object implements TenantAwareAsyncExecutor
AsyncExecutor that has one AsyncExecutor per tenant.
So each tenant has its own acquiring threads and it's own threadpool for executing jobs.| Modifier and Type | Field and Description |
|---|---|
protected boolean |
active |
protected boolean |
autoActivate |
protected CommandExecutor |
commandExecutor |
protected TenantAwareAsyncExecutorFactory |
tenantAwareAyncExecutorFactory |
protected Map<String,AsyncExecutor> |
tenantExecutors |
protected TenantInfoHolder |
tenantInfoHolder |
| Constructor and Description |
|---|
ExecutorPerTenantAsyncExecutor(TenantInfoHolder tenantInfoHolder) |
ExecutorPerTenantAsyncExecutor(TenantInfoHolder tenantInfoHolder,
TenantAwareAsyncExecutorFactory tenantAwareAyncExecutorFactory) |
protected TenantInfoHolder tenantInfoHolder
protected TenantAwareAsyncExecutorFactory tenantAwareAyncExecutorFactory
protected Map<String,AsyncExecutor> tenantExecutors
protected CommandExecutor commandExecutor
protected boolean active
protected boolean autoActivate
public ExecutorPerTenantAsyncExecutor(TenantInfoHolder tenantInfoHolder)
public ExecutorPerTenantAsyncExecutor(TenantInfoHolder tenantInfoHolder, TenantAwareAsyncExecutorFactory tenantAwareAyncExecutorFactory)
public Set<String> getTenantIds()
getTenantIds in interface TenantAwareAsyncExecutorpublic void addTenantAsyncExecutor(String tenantId, boolean startExecutor)
addTenantAsyncExecutor in interface TenantAwareAsyncExecutorpublic void removeTenantAsyncExecutor(String tenantId)
removeTenantAsyncExecutor in interface TenantAwareAsyncExecutorprotected AsyncExecutor determineAsyncExecutor()
public boolean executeAsyncJob(JobEntity job)
AsyncExecutorJobEntity to this AsyncExecutor instance
to execute. If the offering does not work for some reason, false
will be returned (For example when the job queue is full in the DefaultAsyncJobExecutor).executeAsyncJob in interface AsyncExecutorpublic void setCommandExecutor(CommandExecutor commandExecutor)
setCommandExecutor in interface AsyncExecutorpublic CommandExecutor getCommandExecutor()
getCommandExecutor in interface AsyncExecutorpublic boolean isAutoActivate()
isAutoActivate in interface AsyncExecutorpublic void setAutoActivate(boolean isAutoActivate)
setAutoActivate in interface AsyncExecutorpublic boolean isActive()
isActive in interface AsyncExecutorpublic void start()
AsyncExecutorstart in interface AsyncExecutorpublic void shutdown()
AsyncExecutorshutdown in interface AsyncExecutorprotected void shutdownTenantExecutor(String tenantId)
public String getLockOwner()
getLockOwner in interface AsyncExecutorpublic int getTimerLockTimeInMillis()
getTimerLockTimeInMillis in interface AsyncExecutorpublic void setTimerLockTimeInMillis(int lockTimeInMillis)
setTimerLockTimeInMillis in interface AsyncExecutorpublic int getAsyncJobLockTimeInMillis()
getAsyncJobLockTimeInMillis in interface AsyncExecutorpublic void setAsyncJobLockTimeInMillis(int lockTimeInMillis)
setAsyncJobLockTimeInMillis in interface AsyncExecutorpublic int getDefaultTimerJobAcquireWaitTimeInMillis()
getDefaultTimerJobAcquireWaitTimeInMillis in interface AsyncExecutorpublic void setDefaultTimerJobAcquireWaitTimeInMillis(int waitTimeInMillis)
setDefaultTimerJobAcquireWaitTimeInMillis in interface AsyncExecutorpublic int getDefaultAsyncJobAcquireWaitTimeInMillis()
getDefaultAsyncJobAcquireWaitTimeInMillis in interface AsyncExecutorpublic void setDefaultAsyncJobAcquireWaitTimeInMillis(int waitTimeInMillis)
setDefaultAsyncJobAcquireWaitTimeInMillis in interface AsyncExecutorpublic int getDefaultQueueSizeFullWaitTimeInMillis()
getDefaultQueueSizeFullWaitTimeInMillis in interface AsyncExecutorpublic void setDefaultQueueSizeFullWaitTimeInMillis(int defaultQueueSizeFullWaitTime)
setDefaultQueueSizeFullWaitTimeInMillis in interface AsyncExecutorpublic int getMaxAsyncJobsDuePerAcquisition()
getMaxAsyncJobsDuePerAcquisition in interface AsyncExecutorpublic void setMaxAsyncJobsDuePerAcquisition(int maxJobs)
setMaxAsyncJobsDuePerAcquisition in interface AsyncExecutorpublic int getMaxTimerJobsPerAcquisition()
getMaxTimerJobsPerAcquisition in interface AsyncExecutorpublic void setMaxTimerJobsPerAcquisition(int maxJobs)
setMaxTimerJobsPerAcquisition in interface AsyncExecutorpublic int getRetryWaitTimeInMillis()
getRetryWaitTimeInMillis in interface AsyncExecutorpublic void setRetryWaitTimeInMillis(int retryWaitTimeInMillis)
setRetryWaitTimeInMillis in interface AsyncExecutorCopyright © 2016 Alfresco. All rights reserved.