public class DefaultAsyncJobExecutor extends AbstractAsyncExecutor
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
allowCoreThreadTimeout
Whether or not core threads can time out (which is needed to scale down the threads)
|
protected Thread |
asyncJobAcquisitionThread
Thread responsible for async job acquisition.
|
protected int |
corePoolSize
The minimal number of threads that are kept alive in the threadpool for
job execution
|
protected ExecutorService |
executorService
The executor service used for job execution
|
protected boolean |
isAsyncJobAcquisitionEnabled
If true (default), the thread for acquiring async jobs will be started.
|
protected boolean |
isResetExpiredJobEnabled
If true (default), the thread for acquiring expired jobs will be started.
|
protected boolean |
isTimerJobAcquisitionEnabled
If true (default), the thread for acquiring timer jobs will be started.
|
protected long |
keepAliveTime
The time (in milliseconds) a thread used for job execution must be kept
alive before it is destroyed.
|
protected int |
maxPoolSize
The maximum number of threads that are kept alive in the threadpool for
job execution
|
protected int |
queueSize
The size of the queue on which jobs to be executed are placed
|
protected Thread |
resetExpiredJobThread
Thread responsible for resetting the expired jobs.
|
protected long |
secondsToWaitOnShutdown
The time (in seconds) that is waited to gracefully shut down the
threadpool used for job execution
|
protected String |
threadPoolNamingPattern |
protected BlockingQueue<Runnable> |
threadPoolQueue
The queue used for job execution work
|
protected Thread |
timerJobAcquisitionThread
Thread responsible for timer job acquisition.
|
protected boolean |
unlockOwnedJobs
Whether to unlock jobs that are owned by this executor (have the same
lockOwner) at startup
|
acquireRunnableThreadName, asyncJobLockTimeInMillis, asyncJobsDueRunnable, asyncRunnableExecutionExceptionHandler, defaultAsyncJobAcquireWaitTimeInMillis, defaultQueueSizeFullWaitTime, defaultTimerJobAcquireWaitTimeInMillis, executeAsyncRunnableFactory, isActive, isAutoActivate, isMessageQueueMode, jobEntityManager, jobServiceConfiguration, lockOwner, maxAsyncJobsDuePerAcquisition, maxTimerJobsPerAcquisition, resetExpiredJobsInterval, resetExpiredJobsPageSize, resetExpiredJobsRunnable, resetExpiredRunnableName, retryWaitTimeInMillis, temporaryJobQueue, timerJobRunnable, timerLockTimeInMillis, timerRunnableNeeded| Constructor and Description |
|---|
DefaultAsyncJobExecutor() |
createRunnableForJob, executeAsyncJob, executeTemporaryJobs, getAsyncJobLockTimeInMillis, getAsyncJobsDueRunnable, getAsyncRunnableExecutionExceptionHandler, getDefaultAsyncJobAcquireWaitTimeInMillis, getDefaultQueueSizeFullWaitTimeInMillis, getDefaultTimerJobAcquireWaitTimeInMillis, getExecuteAsyncRunnableFactory, getJobServiceConfiguration, getLockOwner, getMaxAsyncJobsDuePerAcquisition, getMaxTimerJobsPerAcquisition, getResetExpiredJobsInterval, getResetExpiredJobsPageSize, getResetExpiredJobsRunnable, getRetryWaitTimeInMillis, getTimerJobRunnable, getTimerLockTimeInMillis, initializeJobEntityManager, initializeRunnables, isActive, isAutoActivate, isMessageQueueMode, setAcquireRunnableThreadName, setAsyncJobLockTimeInMillis, setAsyncJobsDueRunnable, setAsyncRunnableExecutionExceptionHandler, setAutoActivate, setDefaultAsyncJobAcquireWaitTimeInMillis, setDefaultQueueSizeFullWaitTimeInMillis, setDefaultTimerJobAcquireWaitTimeInMillis, setExecuteAsyncRunnableFactory, setJobEntityManager, setJobServiceConfiguration, setLockOwner, setMaxAsyncJobsDuePerAcquisition, setMaxTimerJobsPerAcquisition, setMessageQueueMode, setResetExpiredJobsInterval, setResetExpiredJobsPageSize, setResetExpiredJobsRunnable, setResetExpiredRunnableName, setRetryWaitTimeInMillis, setTenantId, setTimerJobRunnable, setTimerLockTimeInMillis, setTimerRunnableNeeded, shutdown, start, stopRunnables, unlockOwnedJobsprotected boolean isAsyncJobAcquisitionEnabled
protected boolean isTimerJobAcquisitionEnabled
protected boolean isResetExpiredJobEnabled
protected Thread asyncJobAcquisitionThread
protected Thread timerJobAcquisitionThread
protected Thread resetExpiredJobThread
protected int corePoolSize
protected int maxPoolSize
protected long keepAliveTime
protected int queueSize
protected boolean allowCoreThreadTimeout
protected boolean unlockOwnedJobs
protected BlockingQueue<Runnable> threadPoolQueue
protected ExecutorService executorService
protected long secondsToWaitOnShutdown
protected String threadPoolNamingPattern
protected boolean executeAsyncJob(JobInfo job, Runnable runnable)
executeAsyncJob in class AbstractAsyncExecutorprotected void unacquireJobAfterRejection(JobInfo job)
protected void startAdditionalComponents()
startAdditionalComponents in class AbstractAsyncExecutorprotected void shutdownAdditionalComponents()
shutdownAdditionalComponents in class AbstractAsyncExecutorprotected void initAsyncJobExecutionThreadPool()
protected void stopExecutingAsyncJobs()
protected void startJobAcquisitionThread()
protected void startTimerAcquisitionThread()
protected void stopJobAcquisitionThread()
protected void stopTimerAcquisitionThread()
protected void startResetExpiredJobsThread()
protected void stopResetExpiredJobsThread()
public boolean isAsyncJobAcquisitionEnabled()
public void setAsyncJobAcquisitionEnabled(boolean isAsyncJobAcquisitionEnabled)
public boolean isTimerJobAcquisitionEnabled()
public void setTimerJobAcquisitionEnabled(boolean isTimerJobAcquisitionEnabled)
public boolean isResetExpiredJobEnabled()
public void setResetExpiredJobEnabled(boolean isResetExpiredJobEnabled)
public Thread getTimerJobAcquisitionThread()
public void setTimerJobAcquisitionThread(Thread timerJobAcquisitionThread)
public Thread getAsyncJobAcquisitionThread()
public void setAsyncJobAcquisitionThread(Thread asyncJobAcquisitionThread)
public Thread getResetExpiredJobThread()
public void setResetExpiredJobThread(Thread resetExpiredJobThread)
public int getQueueSize()
public boolean isAllowCoreThreadTimeout()
public void setAllowCoreThreadTimeout(boolean allowCoreThreadTimeout)
public int getRemainingCapacity()
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 boolean isUnlockOwnedJobs()
public void setUnlockOwnedJobs(boolean unlockOwnedJobs)
public BlockingQueue<Runnable> getThreadPoolQueue()
public void setThreadPoolQueue(BlockingQueue<Runnable> threadPoolQueue)
public ExecutorService getExecutorService()
public void setExecutorService(ExecutorService executorService)
public String getThreadPoolNamingPattern()
public void setThreadPoolNamingPattern(String threadPoolNamingPattern)
Copyright © 2020 Flowable. All rights reserved.