public class DefaultAsyncJobExecutor extends Object implements AsyncExecutor
Modifier and Type | Field and Description |
---|---|
protected int |
asyncJobLockTimeInMillis |
protected CommandExecutor |
commandExecutor |
protected int |
corePoolSize
The minimal number of threads that are kept alive in the threadpool for job execution
|
protected int |
defaultAsyncJobAcquireWaitTimeInMillis |
protected int |
defaultTimerJobAcquireWaitTimeInMillis |
protected ExecutorService |
executorService
The executor service used for job execution
|
protected boolean |
isActive |
protected boolean |
isAutoActivate |
protected long |
keepAliveTime
The time (in milliseconds) a thread used for job execution must be kept alive before it is
destroyed.
|
protected String |
lockOwner |
protected int |
maxAsyncJobsDuePerAcquisition |
protected int |
maxPoolSize
The maximum number of threads that are kept alive in the threadpool for job execution
|
protected int |
maxTimerJobsPerAcquisition |
protected int |
queueSize
The size of the queue on which jobs to be executed are placed
|
protected int |
retryWaitTimeInMillis |
protected long |
secondsToWaitOnShutdown
The time (in seconds) that is waited to gracefully shut down the threadpool used for job execution
|
protected LinkedList<JobEntity> |
temporaryJobQueue |
protected BlockingQueue<Runnable> |
threadPoolQueue
The queue used for job execution work
|
protected int |
timerLockTimeInMillis |
Constructor and Description |
---|
DefaultAsyncJobExecutor() |
protected int corePoolSize
protected int maxPoolSize
protected long keepAliveTime
protected int queueSize
protected BlockingQueue<Runnable> threadPoolQueue
protected ExecutorService executorService
protected long secondsToWaitOnShutdown
protected boolean isAutoActivate
protected boolean isActive
protected int maxTimerJobsPerAcquisition
protected int maxAsyncJobsDuePerAcquisition
protected int defaultTimerJobAcquireWaitTimeInMillis
protected int defaultAsyncJobAcquireWaitTimeInMillis
protected String lockOwner
protected int timerLockTimeInMillis
protected int asyncJobLockTimeInMillis
protected int retryWaitTimeInMillis
protected LinkedList<JobEntity> temporaryJobQueue
protected CommandExecutor commandExecutor
public void executeAsyncJob(JobEntity job)
executeAsyncJob
in interface AsyncExecutor
public void start()
start
in interface AsyncExecutor
public void shutdown()
shutdown
in interface AsyncExecutor
protected void startExecutingAsyncJobs()
protected void stopExecutingAsyncJobs()
public CommandExecutor getCommandExecutor()
getCommandExecutor
in interface AsyncExecutor
public void setCommandExecutor(CommandExecutor commandExecutor)
setCommandExecutor
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 int getQueueSize()
public void setQueueSize(int queueSize)
public int getCorePoolSize()
public void setCorePoolSize(int corePoolSize)
public int getMaxPoolSize()
public void setMaxPoolSize(int maxPoolSize)
public long getKeepAliveTime()
public void setKeepAliveTime(long keepAliveTime)
public long getSecondsToWaitOnShutdown()
public void setSecondsToWaitOnShutdown(long secondsToWaitOnShutdown)
public BlockingQueue<Runnable> getThreadPoolQueue()
public void setThreadPoolQueue(BlockingQueue<Runnable> threadPoolQueue)
public ExecutorService getExecutorService()
public void setExecutorService(ExecutorService executorService)
public String getLockOwner()
getLockOwner
in interface AsyncExecutor
public void setLockOwner(String lockOwner)
public int getTimerLockTimeInMillis()
getTimerLockTimeInMillis
in interface AsyncExecutor
public void setTimerLockTimeInMillis(int timerLockTimeInMillis)
setTimerLockTimeInMillis
in interface AsyncExecutor
public int getAsyncJobLockTimeInMillis()
getAsyncJobLockTimeInMillis
in interface AsyncExecutor
public void setAsyncJobLockTimeInMillis(int asyncJobLockTimeInMillis)
setAsyncJobLockTimeInMillis
in interface AsyncExecutor
public int getMaxTimerJobsPerAcquisition()
getMaxTimerJobsPerAcquisition
in interface AsyncExecutor
public void setMaxTimerJobsPerAcquisition(int maxTimerJobsPerAcquisition)
setMaxTimerJobsPerAcquisition
in interface AsyncExecutor
public int getMaxAsyncJobsDuePerAcquisition()
getMaxAsyncJobsDuePerAcquisition
in interface AsyncExecutor
public void setMaxAsyncJobsDuePerAcquisition(int maxAsyncJobsDuePerAcquisition)
setMaxAsyncJobsDuePerAcquisition
in interface AsyncExecutor
public int getDefaultTimerJobAcquireWaitTimeInMillis()
getDefaultTimerJobAcquireWaitTimeInMillis
in interface AsyncExecutor
public void setDefaultTimerJobAcquireWaitTimeInMillis(int defaultTimerJobAcquireWaitTimeInMillis)
setDefaultTimerJobAcquireWaitTimeInMillis
in interface AsyncExecutor
public int getDefaultAsyncJobAcquireWaitTimeInMillis()
getDefaultAsyncJobAcquireWaitTimeInMillis
in interface AsyncExecutor
public void setDefaultAsyncJobAcquireWaitTimeInMillis(int defaultAsyncJobAcquireWaitTimeInMillis)
setDefaultAsyncJobAcquireWaitTimeInMillis
in interface AsyncExecutor
public int getRetryWaitTimeInMillis()
getRetryWaitTimeInMillis
in interface AsyncExecutor
public void setRetryWaitTimeInMillis(int retryWaitTimeInMillis)
setRetryWaitTimeInMillis
in interface AsyncExecutor
Copyright © 2015 Alfresco. All rights reserved.