public class DefaultAsyncJobExecutor extends Object implements AsyncExecutor
| Modifier and Type | Field and Description |
|---|---|
protected Thread |
asyncJobAcquisitionThread |
protected int |
asyncJobLockTimeInMillis |
protected AcquireAsyncJobsDueRunnable |
asyncJobsDueRunnable |
protected int |
corePoolSize
The minimal number of threads that are kept alive in the threadpool for job execution
|
protected int |
defaultAsyncJobAcquireWaitTimeInMillis |
protected int |
defaultQueueSizeFullWaitTime |
protected int |
defaultTimerJobAcquireWaitTimeInMillis |
protected ExecuteAsyncRunnableFactory |
executeAsyncRunnableFactory |
protected ExecutorService |
executorService
The executor service used for job execution
|
protected boolean |
isActive |
protected boolean |
isAutoActivate |
protected boolean |
isMessageQueueMode |
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 ProcessEngineConfigurationImpl |
processEngineConfiguration |
protected int |
queueSize
The size of the queue on which jobs to be executed are placed
|
protected int |
resetExpiredJobsInterval |
protected int |
resetExpiredJobsPageSize |
protected ResetExpiredJobsRunnable |
resetExpiredJobsRunnable |
protected Thread |
resetExpiredJobThread |
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<Job> |
temporaryJobQueue |
protected BlockingQueue<Runnable> |
threadPoolQueue
The queue used for job execution work
|
protected Thread |
timerJobAcquisitionThread |
protected AcquireTimerJobsRunnable |
timerJobRunnable |
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 Thread timerJobAcquisitionThread
protected Thread asyncJobAcquisitionThread
protected Thread resetExpiredJobThread
protected AcquireTimerJobsRunnable timerJobRunnable
protected AcquireAsyncJobsDueRunnable asyncJobsDueRunnable
protected ResetExpiredJobsRunnable resetExpiredJobsRunnable
protected ExecuteAsyncRunnableFactory executeAsyncRunnableFactory
protected boolean isAutoActivate
protected boolean isActive
protected boolean isMessageQueueMode
protected int maxTimerJobsPerAcquisition
protected int maxAsyncJobsDuePerAcquisition
protected int defaultTimerJobAcquireWaitTimeInMillis
protected int defaultAsyncJobAcquireWaitTimeInMillis
protected int defaultQueueSizeFullWaitTime
protected String lockOwner
protected int timerLockTimeInMillis
protected int asyncJobLockTimeInMillis
protected int retryWaitTimeInMillis
protected int resetExpiredJobsInterval
protected int resetExpiredJobsPageSize
protected LinkedList<Job> temporaryJobQueue
protected ProcessEngineConfigurationImpl processEngineConfiguration
public boolean executeAsyncJob(Job 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 start()
start in interface AsyncExecutorprotected void executeTemporaryJobs()
public void shutdown()
shutdown in interface AsyncExecutorprotected void initAsyncJobExecutionThreadPool()
protected void stopExecutingAsyncJobs()
protected void startJobAcquisitionThread()
protected void startTimerAcquisitionThread()
protected void stopJobAcquisitionThread()
protected void stopTimerAcquisitionThread()
protected void startResetExpiredJobsThread()
protected void stopResetExpiredJobsThread()
public ProcessEngineConfigurationImpl getProcessEngineConfiguration()
getProcessEngineConfiguration in interface AsyncExecutorpublic void setProcessEngineConfiguration(ProcessEngineConfigurationImpl processEngineConfiguration)
setProcessEngineConfiguration in interface AsyncExecutorpublic Thread getTimerJobAcquisitionThread()
public void setTimerJobAcquisitionThread(Thread timerJobAcquisitionThread)
public Thread getAsyncJobAcquisitionThread()
public void setAsyncJobAcquisitionThread(Thread asyncJobAcquisitionThread)
public Thread getResetExpiredJobThread()
public void setResetExpiredJobThread(Thread resetExpiredJobThread)
public boolean isAutoActivate()
isAutoActivate in interface AsyncExecutorpublic void setAutoActivate(boolean isAutoActivate)
setAutoActivate in interface AsyncExecutorpublic boolean isActive()
isActive in interface AsyncExecutorpublic boolean isMessageQueueMode()
public void setMessageQueueMode(boolean isMessageQueueMode)
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 AsyncExecutorpublic void setLockOwner(String lockOwner)
public int getTimerLockTimeInMillis()
getTimerLockTimeInMillis in interface AsyncExecutorpublic void setTimerLockTimeInMillis(int timerLockTimeInMillis)
setTimerLockTimeInMillis in interface AsyncExecutorpublic int getAsyncJobLockTimeInMillis()
getAsyncJobLockTimeInMillis in interface AsyncExecutorpublic void setAsyncJobLockTimeInMillis(int asyncJobLockTimeInMillis)
setAsyncJobLockTimeInMillis in interface AsyncExecutorpublic int getMaxTimerJobsPerAcquisition()
getMaxTimerJobsPerAcquisition in interface AsyncExecutorpublic void setMaxTimerJobsPerAcquisition(int maxTimerJobsPerAcquisition)
setMaxTimerJobsPerAcquisition in interface AsyncExecutorpublic int getMaxAsyncJobsDuePerAcquisition()
getMaxAsyncJobsDuePerAcquisition in interface AsyncExecutorpublic void setMaxAsyncJobsDuePerAcquisition(int maxAsyncJobsDuePerAcquisition)
setMaxAsyncJobsDuePerAcquisition in interface AsyncExecutorpublic int getDefaultTimerJobAcquireWaitTimeInMillis()
getDefaultTimerJobAcquireWaitTimeInMillis in interface AsyncExecutorpublic void setDefaultTimerJobAcquireWaitTimeInMillis(int defaultTimerJobAcquireWaitTimeInMillis)
setDefaultTimerJobAcquireWaitTimeInMillis in interface AsyncExecutorpublic int getDefaultAsyncJobAcquireWaitTimeInMillis()
getDefaultAsyncJobAcquireWaitTimeInMillis in interface AsyncExecutorpublic void setDefaultAsyncJobAcquireWaitTimeInMillis(int defaultAsyncJobAcquireWaitTimeInMillis)
setDefaultAsyncJobAcquireWaitTimeInMillis in interface AsyncExecutorpublic void setTimerJobRunnable(AcquireTimerJobsRunnable timerJobRunnable)
public int getDefaultQueueSizeFullWaitTimeInMillis()
getDefaultQueueSizeFullWaitTimeInMillis in interface AsyncExecutorpublic void setDefaultQueueSizeFullWaitTimeInMillis(int defaultQueueSizeFullWaitTime)
setDefaultQueueSizeFullWaitTimeInMillis in interface AsyncExecutorpublic void setAsyncJobsDueRunnable(AcquireAsyncJobsDueRunnable asyncJobsDueRunnable)
public void setResetExpiredJobsRunnable(ResetExpiredJobsRunnable resetExpiredJobsRunnable)
public int getRetryWaitTimeInMillis()
getRetryWaitTimeInMillis in interface AsyncExecutorpublic void setRetryWaitTimeInMillis(int retryWaitTimeInMillis)
setRetryWaitTimeInMillis in interface AsyncExecutorpublic int getResetExpiredJobsInterval()
getResetExpiredJobsInterval in interface AsyncExecutorpublic void setResetExpiredJobsInterval(int resetExpiredJobsInterval)
setResetExpiredJobsInterval in interface AsyncExecutorpublic int getResetExpiredJobsPageSize()
getResetExpiredJobsPageSize in interface AsyncExecutorpublic void setResetExpiredJobsPageSize(int resetExpiredJobsPageSize)
setResetExpiredJobsPageSize in interface AsyncExecutorpublic ExecuteAsyncRunnableFactory getExecuteAsyncRunnableFactory()
public void setExecuteAsyncRunnableFactory(ExecuteAsyncRunnableFactory executeAsyncRunnableFactory)
Copyright © 2010–2018 Alfresco. All rights reserved.