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 TenantAwareAsyncExecutor
public void addTenantAsyncExecutor(String tenantId, boolean startExecutor)
addTenantAsyncExecutor
in interface TenantAwareAsyncExecutor
public void removeTenantAsyncExecutor(String tenantId)
removeTenantAsyncExecutor
in interface TenantAwareAsyncExecutor
protected AsyncExecutor determineAsyncExecutor()
public boolean executeAsyncJob(JobEntity job)
AsyncExecutor
JobEntity
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 AsyncExecutor
public void setCommandExecutor(CommandExecutor commandExecutor)
setCommandExecutor
in interface AsyncExecutor
public CommandExecutor getCommandExecutor()
getCommandExecutor
in interface AsyncExecutor
public boolean isAutoActivate()
isAutoActivate
in interface AsyncExecutor
public void setAutoActivate(boolean isAutoActivate)
setAutoActivate
in interface AsyncExecutor
public boolean isActive()
isActive
in interface AsyncExecutor
public void start()
AsyncExecutor
start
in interface AsyncExecutor
public void shutdown()
AsyncExecutor
shutdown
in interface AsyncExecutor
protected void shutdownTenantExecutor(String tenantId)
public String getLockOwner()
getLockOwner
in interface AsyncExecutor
public int getTimerLockTimeInMillis()
getTimerLockTimeInMillis
in interface AsyncExecutor
public void setTimerLockTimeInMillis(int lockTimeInMillis)
setTimerLockTimeInMillis
in interface AsyncExecutor
public int getAsyncJobLockTimeInMillis()
getAsyncJobLockTimeInMillis
in interface AsyncExecutor
public void setAsyncJobLockTimeInMillis(int lockTimeInMillis)
setAsyncJobLockTimeInMillis
in interface AsyncExecutor
public int getDefaultTimerJobAcquireWaitTimeInMillis()
getDefaultTimerJobAcquireWaitTimeInMillis
in interface AsyncExecutor
public void setDefaultTimerJobAcquireWaitTimeInMillis(int waitTimeInMillis)
setDefaultTimerJobAcquireWaitTimeInMillis
in interface AsyncExecutor
public int getDefaultAsyncJobAcquireWaitTimeInMillis()
getDefaultAsyncJobAcquireWaitTimeInMillis
in interface AsyncExecutor
public void setDefaultAsyncJobAcquireWaitTimeInMillis(int waitTimeInMillis)
setDefaultAsyncJobAcquireWaitTimeInMillis
in interface AsyncExecutor
public int getDefaultQueueSizeFullWaitTimeInMillis()
getDefaultQueueSizeFullWaitTimeInMillis
in interface AsyncExecutor
public void setDefaultQueueSizeFullWaitTimeInMillis(int defaultQueueSizeFullWaitTime)
setDefaultQueueSizeFullWaitTimeInMillis
in interface AsyncExecutor
public int getMaxAsyncJobsDuePerAcquisition()
getMaxAsyncJobsDuePerAcquisition
in interface AsyncExecutor
public void setMaxAsyncJobsDuePerAcquisition(int maxJobs)
setMaxAsyncJobsDuePerAcquisition
in interface AsyncExecutor
public int getMaxTimerJobsPerAcquisition()
getMaxTimerJobsPerAcquisition
in interface AsyncExecutor
public void setMaxTimerJobsPerAcquisition(int maxJobs)
setMaxTimerJobsPerAcquisition
in interface AsyncExecutor
public int getRetryWaitTimeInMillis()
getRetryWaitTimeInMillis
in interface AsyncExecutor
public void setRetryWaitTimeInMillis(int retryWaitTimeInMillis)
setRetryWaitTimeInMillis
in interface AsyncExecutor
Copyright © 2016 Alfresco. All rights reserved.