Class AbstractAsyncExecutor
java.lang.Object
org.flowable.job.service.impl.asyncexecutor.AbstractAsyncExecutor
- All Implemented Interfaces:
AsyncExecutor
- Direct Known Subclasses:
DefaultAsyncJobExecutor
- Author:
- Joram Barrez, Tijs Rademakers, Marcus Klimstra
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassclass -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected AcquireAsyncJobsDueLifecycleListenerprotected AcquireAsyncJobsDueRunnableprotected AsyncRunnableExecutionExceptionHandlerprotected AsyncJobExecutorConfigurationprotected ExecuteAsyncRunnableFactoryprotected booleanprotected booleanprotected JobInfoEntityManager<? extends JobInfoEntity>protected JobExecutionObservationProviderprotected JobServiceConfigurationprotected ResetExpiredJobsRunnableprotected LinkedList<JobInfo>protected AcquireTimerJobsRunnableprotected AcquireTimerLifecycleListener -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract ResetExpiredJobsRunnablecreateResetExpiredJobsRunnable(String resetRunnableName) protected RunnablebooleanexecuteAsyncJob(JobInfo job) Offers the providedJobInfoto thisAsyncExecutorinstance to execute.protected abstract booleanexecuteAsyncJob(JobInfo job, Runnable runnable) protected voidintintintintintintintintintintprotected voidprotected voidbooleanisActive()booleanbooleanbooleanvoidsetAcquireRunnableThreadName(String acquireRunnableThreadName) voidsetAsyncJobLockTimeInMillis(int asyncJobLockTimeInMillis) voidsetAsyncJobsDueLifecycleListener(AcquireAsyncJobsDueLifecycleListener asyncJobsDueLifecycleListener) voidsetAsyncJobsDueRunnable(AcquireAsyncJobsDueRunnable asyncJobsDueRunnable) voidsetAsyncJobsGlobalLockPollRate(Duration asyncJobsGlobalLockPollRate) voidsetAsyncJobsGlobalLockWaitTime(Duration asyncJobsGlobalLockWaitTime) voidsetAsyncRunnableExecutionExceptionHandler(AsyncRunnableExecutionExceptionHandler asyncRunnableExecutionExceptionHandler) voidsetAutoActivate(boolean isAutoActivate) voidsetConfiguration(AsyncJobExecutorConfiguration configuration) voidsetDefaultAsyncJobAcquireWaitTimeInMillis(int defaultAsyncJobAcquireWaitTimeInMillis) voidsetDefaultQueueSizeFullWaitTimeInMillis(int defaultQueueSizeFullWaitTime) voidsetDefaultTimerJobAcquireWaitTimeInMillis(int defaultTimerJobAcquireWaitTimeInMillis) voidsetExecuteAsyncRunnableFactory(ExecuteAsyncRunnableFactory executeAsyncRunnableFactory) voidsetGlobalAcquireLockEnabled(boolean globalAcquireLockEnabled) voidsetGlobalAcquireLockPrefix(String globalAcquireLockPrefix) voidsetJobEntityManager(JobInfoEntityManager<? extends JobInfoEntity> jobEntityManager) voidsetJobExecutionObservationProvider(JobExecutionObservationProvider jobExecutionObservationProvider) voidsetJobServiceConfiguration(JobServiceConfiguration jobServiceConfiguration) voidsetLockOwner(String lockOwner) voidsetMaxAsyncJobsDuePerAcquisition(int maxAsyncJobsDuePerAcquisition) voidsetMaxTimerJobsPerAcquisition(int maxTimerJobsPerAcquisition) voidsetMoveTimerExecutorPoolSize(int moveTimerExecutorPoolSize) voidsetResetExpiredJobsInterval(int resetExpiredJobsInterval) voidsetResetExpiredJobsPageSize(int resetExpiredJobsPageSize) voidsetResetExpiredJobsRunnable(ResetExpiredJobsRunnable resetExpiredJobsRunnable) voidsetResetExpiredRunnableName(String resetExpiredRunnableName) voidsetTenantId(String tenantId) voidsetTimerJobRunnable(AcquireTimerJobsRunnable timerJobRunnable) voidsetTimerLifecycleListener(AcquireTimerLifecycleListener timerLifecycleListener) voidsetTimerLockPollRate(Duration timerLockPollRate) voidsetTimerLockTimeInMillis(int timerLockTimeInMillis) voidsetTimerLockWaitTime(Duration timerLockWaitTime) voidsetTimerRunnableNeeded(boolean timerRunnableNeeded) voidshutdown()Shuts down the whole job executorprotected abstract voidvoidstart()Starts the async executorprotected abstract voidprotected voidprotected voidMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.flowable.job.service.impl.asyncexecutor.AsyncExecutor
getTaskExecutor, setTaskExecutor
-
Field Details
-
configuration
-
timerJobRunnable
-
timerLifecycleListener
-
jobEntityManager
-
asyncJobsDueRunnable
-
asyncJobsDueLifecycleListener
-
resetExpiredJobsRunnable
-
executeAsyncRunnableFactory
-
asyncRunnableExecutionExceptionHandler
-
jobExecutionObservationProvider
-
isAutoActivate
protected boolean isAutoActivate -
isActive
protected boolean isActive -
temporaryJobQueue
-
jobServiceConfiguration
-
-
Constructor Details
-
AbstractAsyncExecutor
public AbstractAsyncExecutor() -
AbstractAsyncExecutor
-
-
Method Details
-
executeAsyncJob
Description copied from interface:AsyncExecutorOffers the providedJobInfoto thisAsyncExecutorinstance to execute. If the offering does not work for some reason, false will be returned (For example when the job queue is full in theDefaultAsyncJobExecutor).- Specified by:
executeAsyncJobin interfaceAsyncExecutor
-
executeAsyncJob
-
unlockOwnedJobs
protected void unlockOwnedJobs() -
createRunnableForJob
-
start
public void start()Starts the async executor- Specified by:
startin interfaceAsyncExecutor
-
initializeJobEntityManager
protected void initializeJobEntityManager() -
initializeRunnables
protected void initializeRunnables() -
createResetExpiredJobsRunnable
protected abstract ResetExpiredJobsRunnable createResetExpiredJobsRunnable(String resetRunnableName) -
startAdditionalComponents
protected abstract void startAdditionalComponents() -
executeTemporaryJobs
protected void executeTemporaryJobs() -
shutdown
public void shutdown()Shuts down the whole job executor- Specified by:
shutdownin interfaceAsyncExecutor
-
stopRunnables
protected void stopRunnables() -
shutdownAdditionalComponents
protected abstract void shutdownAdditionalComponents() -
getJobServiceConfiguration
- Specified by:
getJobServiceConfigurationin interfaceAsyncExecutor
-
setJobServiceConfiguration
- Specified by:
setJobServiceConfigurationin interfaceAsyncExecutor
-
isAutoActivate
public boolean isAutoActivate()- Specified by:
isAutoActivatein interfaceAsyncExecutor
-
setAutoActivate
public void setAutoActivate(boolean isAutoActivate) - Specified by:
setAutoActivatein interfaceAsyncExecutor
-
isActive
public boolean isActive()- Specified by:
isActivein interfaceAsyncExecutor
-
getLockOwner
- Specified by:
getLockOwnerin interfaceAsyncExecutor
-
setLockOwner
-
getTimerLockTimeInMillis
public int getTimerLockTimeInMillis()- Specified by:
getTimerLockTimeInMillisin interfaceAsyncExecutor
-
setTimerLockTimeInMillis
public void setTimerLockTimeInMillis(int timerLockTimeInMillis) - Specified by:
setTimerLockTimeInMillisin interfaceAsyncExecutor
-
getAsyncJobLockTimeInMillis
public int getAsyncJobLockTimeInMillis()- Specified by:
getAsyncJobLockTimeInMillisin interfaceAsyncExecutor
-
setAsyncJobLockTimeInMillis
public void setAsyncJobLockTimeInMillis(int asyncJobLockTimeInMillis) - Specified by:
setAsyncJobLockTimeInMillisin interfaceAsyncExecutor
-
getMoveTimerExecutorPoolSize
public int getMoveTimerExecutorPoolSize() -
setMoveTimerExecutorPoolSize
public void setMoveTimerExecutorPoolSize(int moveTimerExecutorPoolSize) -
getMaxTimerJobsPerAcquisition
public int getMaxTimerJobsPerAcquisition()- Specified by:
getMaxTimerJobsPerAcquisitionin interfaceAsyncExecutor
-
setMaxTimerJobsPerAcquisition
public void setMaxTimerJobsPerAcquisition(int maxTimerJobsPerAcquisition) - Specified by:
setMaxTimerJobsPerAcquisitionin interfaceAsyncExecutor
-
getMaxAsyncJobsDuePerAcquisition
public int getMaxAsyncJobsDuePerAcquisition()- Specified by:
getMaxAsyncJobsDuePerAcquisitionin interfaceAsyncExecutor
-
setMaxAsyncJobsDuePerAcquisition
public void setMaxAsyncJobsDuePerAcquisition(int maxAsyncJobsDuePerAcquisition) - Specified by:
setMaxAsyncJobsDuePerAcquisitionin interfaceAsyncExecutor
-
getDefaultTimerJobAcquireWaitTimeInMillis
public int getDefaultTimerJobAcquireWaitTimeInMillis()- Specified by:
getDefaultTimerJobAcquireWaitTimeInMillisin interfaceAsyncExecutor
-
setDefaultTimerJobAcquireWaitTimeInMillis
public void setDefaultTimerJobAcquireWaitTimeInMillis(int defaultTimerJobAcquireWaitTimeInMillis) - Specified by:
setDefaultTimerJobAcquireWaitTimeInMillisin interfaceAsyncExecutor
-
getDefaultAsyncJobAcquireWaitTimeInMillis
public int getDefaultAsyncJobAcquireWaitTimeInMillis()- Specified by:
getDefaultAsyncJobAcquireWaitTimeInMillisin interfaceAsyncExecutor
-
setDefaultAsyncJobAcquireWaitTimeInMillis
public void setDefaultAsyncJobAcquireWaitTimeInMillis(int defaultAsyncJobAcquireWaitTimeInMillis) - Specified by:
setDefaultAsyncJobAcquireWaitTimeInMillisin interfaceAsyncExecutor
-
setTimerJobRunnable
-
getDefaultQueueSizeFullWaitTimeInMillis
public int getDefaultQueueSizeFullWaitTimeInMillis()- Specified by:
getDefaultQueueSizeFullWaitTimeInMillisin interfaceAsyncExecutor
-
setDefaultQueueSizeFullWaitTimeInMillis
public void setDefaultQueueSizeFullWaitTimeInMillis(int defaultQueueSizeFullWaitTime) - Specified by:
setDefaultQueueSizeFullWaitTimeInMillisin interfaceAsyncExecutor
-
setAsyncJobsDueRunnable
-
getAsyncJobsDueLifecycleListener
-
setAsyncJobsDueLifecycleListener
public void setAsyncJobsDueLifecycleListener(AcquireAsyncJobsDueLifecycleListener asyncJobsDueLifecycleListener) -
isTimerRunnableNeeded
public boolean isTimerRunnableNeeded() -
setTimerRunnableNeeded
public void setTimerRunnableNeeded(boolean timerRunnableNeeded) -
getTimerLifecycleListener
-
setTimerLifecycleListener
-
isGlobalAcquireLockEnabled
public boolean isGlobalAcquireLockEnabled() -
setGlobalAcquireLockEnabled
public void setGlobalAcquireLockEnabled(boolean globalAcquireLockEnabled) -
getGlobalAcquireLockPrefix
-
setGlobalAcquireLockPrefix
-
getAsyncJobsGlobalLockWaitTime
-
setAsyncJobsGlobalLockWaitTime
-
getAsyncJobsGlobalLockPollRate
-
setAsyncJobsGlobalLockPollRate
-
getTimerLockWaitTime
-
setTimerLockWaitTime
-
getTimerLockPollRate
-
setTimerLockPollRate
-
setAcquireRunnableThreadName
-
setJobEntityManager
-
setResetExpiredRunnableName
-
setResetExpiredJobsRunnable
-
getResetExpiredJobsInterval
public int getResetExpiredJobsInterval()- Specified by:
getResetExpiredJobsIntervalin interfaceAsyncExecutor
-
setResetExpiredJobsInterval
public void setResetExpiredJobsInterval(int resetExpiredJobsInterval) - Specified by:
setResetExpiredJobsIntervalin interfaceAsyncExecutor
-
getResetExpiredJobsPageSize
public int getResetExpiredJobsPageSize()- Specified by:
getResetExpiredJobsPageSizein interfaceAsyncExecutor
-
setResetExpiredJobsPageSize
public void setResetExpiredJobsPageSize(int resetExpiredJobsPageSize) - Specified by:
setResetExpiredJobsPageSizein interfaceAsyncExecutor
-
getExecuteAsyncRunnableFactory
-
setExecuteAsyncRunnableFactory
-
getAsyncRunnableExecutionExceptionHandler
-
setAsyncRunnableExecutionExceptionHandler
public void setAsyncRunnableExecutionExceptionHandler(AsyncRunnableExecutionExceptionHandler asyncRunnableExecutionExceptionHandler) -
getJobExecutionObservationProvider
-
setJobExecutionObservationProvider
public void setJobExecutionObservationProvider(JobExecutionObservationProvider jobExecutionObservationProvider) -
getTimerJobRunnable
-
getAsyncJobsDueRunnable
-
getResetExpiredJobsRunnable
-
getTenantId
-
setTenantId
-
getConfiguration
-
setConfiguration
-