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 TypeClassDescriptionclass
class
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected AcquireAsyncJobsDueLifecycleListener
protected AcquireAsyncJobsDueRunnable
protected AsyncRunnableExecutionExceptionHandler
protected AsyncJobExecutorConfiguration
protected ExecuteAsyncRunnableFactory
protected boolean
protected boolean
protected JobInfoEntityManager<? extends JobInfoEntity>
protected JobServiceConfiguration
protected ResetExpiredJobsRunnable
protected LinkedList<JobInfo>
protected AcquireTimerJobsRunnable
protected AcquireTimerLifecycleListener
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract ResetExpiredJobsRunnable
createResetExpiredJobsRunnable
(String resetRunnableName) protected Runnable
boolean
executeAsyncJob
(JobInfo job) Offers the providedJobInfo
to thisAsyncExecutor
instance to execute.protected abstract boolean
executeAsyncJob
(JobInfo job, Runnable runnable) protected void
int
int
int
int
int
int
int
int
int
int
protected void
protected void
boolean
isActive()
boolean
boolean
boolean
void
setAcquireRunnableThreadName
(String acquireRunnableThreadName) void
setAsyncJobLockTimeInMillis
(int asyncJobLockTimeInMillis) void
setAsyncJobsDueLifecycleListener
(AcquireAsyncJobsDueLifecycleListener asyncJobsDueLifecycleListener) void
setAsyncJobsDueRunnable
(AcquireAsyncJobsDueRunnable asyncJobsDueRunnable) void
setAsyncJobsGlobalLockPollRate
(Duration asyncJobsGlobalLockPollRate) void
setAsyncJobsGlobalLockWaitTime
(Duration asyncJobsGlobalLockWaitTime) void
setAsyncRunnableExecutionExceptionHandler
(AsyncRunnableExecutionExceptionHandler asyncRunnableExecutionExceptionHandler) void
setAutoActivate
(boolean isAutoActivate) void
setConfiguration
(AsyncJobExecutorConfiguration configuration) void
setDefaultAsyncJobAcquireWaitTimeInMillis
(int defaultAsyncJobAcquireWaitTimeInMillis) void
setDefaultQueueSizeFullWaitTimeInMillis
(int defaultQueueSizeFullWaitTime) void
setDefaultTimerJobAcquireWaitTimeInMillis
(int defaultTimerJobAcquireWaitTimeInMillis) void
setExecuteAsyncRunnableFactory
(ExecuteAsyncRunnableFactory executeAsyncRunnableFactory) void
setGlobalAcquireLockEnabled
(boolean globalAcquireLockEnabled) void
setGlobalAcquireLockPrefix
(String globalAcquireLockPrefix) void
setJobEntityManager
(JobInfoEntityManager<? extends JobInfoEntity> jobEntityManager) void
setJobServiceConfiguration
(JobServiceConfiguration jobServiceConfiguration) void
setLockOwner
(String lockOwner) void
setMaxAsyncJobsDuePerAcquisition
(int maxAsyncJobsDuePerAcquisition) void
setMaxTimerJobsPerAcquisition
(int maxTimerJobsPerAcquisition) void
setMoveTimerExecutorPoolSize
(int moveTimerExecutorPoolSize) void
setResetExpiredJobsInterval
(int resetExpiredJobsInterval) void
setResetExpiredJobsPageSize
(int resetExpiredJobsPageSize) void
setResetExpiredJobsRunnable
(ResetExpiredJobsRunnable resetExpiredJobsRunnable) void
setResetExpiredRunnableName
(String resetExpiredRunnableName) void
setTenantId
(String tenantId) void
setTimerJobRunnable
(AcquireTimerJobsRunnable timerJobRunnable) void
setTimerLifecycleListener
(AcquireTimerLifecycleListener timerLifecycleListener) void
setTimerLockPollRate
(Duration timerLockPollRate) void
setTimerLockTimeInMillis
(int timerLockTimeInMillis) void
setTimerLockWaitTime
(Duration timerLockWaitTime) void
setTimerRunnableNeeded
(boolean timerRunnableNeeded) void
shutdown()
Shuts down the whole job executorprotected abstract void
void
start()
Starts the async executorprotected abstract void
protected void
protected void
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.flowable.job.service.impl.asyncexecutor.AsyncExecutor
getTaskExecutor, setTaskExecutor
-
Field Details
-
configuration
-
timerJobRunnable
-
timerLifecycleListener
-
jobEntityManager
-
asyncJobsDueRunnable
-
asyncJobsDueLifecycleListener
-
resetExpiredJobsRunnable
-
executeAsyncRunnableFactory
-
asyncRunnableExecutionExceptionHandler
-
isAutoActivate
protected boolean isAutoActivate -
isActive
protected boolean isActive -
temporaryJobQueue
-
jobServiceConfiguration
-
-
Constructor Details
-
AbstractAsyncExecutor
public AbstractAsyncExecutor() -
AbstractAsyncExecutor
-
-
Method Details
-
executeAsyncJob
Description copied from interface:AsyncExecutor
Offers the providedJobInfo
to thisAsyncExecutor
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 theDefaultAsyncJobExecutor
).- Specified by:
executeAsyncJob
in interfaceAsyncExecutor
-
executeAsyncJob
-
unlockOwnedJobs
protected void unlockOwnedJobs() -
createRunnableForJob
-
start
public void start()Starts the async executor- Specified by:
start
in 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:
shutdown
in interfaceAsyncExecutor
-
stopRunnables
protected void stopRunnables() -
shutdownAdditionalComponents
protected abstract void shutdownAdditionalComponents() -
getJobServiceConfiguration
- Specified by:
getJobServiceConfiguration
in interfaceAsyncExecutor
-
setJobServiceConfiguration
- Specified by:
setJobServiceConfiguration
in interfaceAsyncExecutor
-
isAutoActivate
public boolean isAutoActivate()- Specified by:
isAutoActivate
in interfaceAsyncExecutor
-
setAutoActivate
public void setAutoActivate(boolean isAutoActivate) - Specified by:
setAutoActivate
in interfaceAsyncExecutor
-
isActive
public boolean isActive()- Specified by:
isActive
in interfaceAsyncExecutor
-
getLockOwner
- Specified by:
getLockOwner
in interfaceAsyncExecutor
-
setLockOwner
-
getTimerLockTimeInMillis
public int getTimerLockTimeInMillis()- Specified by:
getTimerLockTimeInMillis
in interfaceAsyncExecutor
-
setTimerLockTimeInMillis
public void setTimerLockTimeInMillis(int timerLockTimeInMillis) - Specified by:
setTimerLockTimeInMillis
in interfaceAsyncExecutor
-
getAsyncJobLockTimeInMillis
public int getAsyncJobLockTimeInMillis()- Specified by:
getAsyncJobLockTimeInMillis
in interfaceAsyncExecutor
-
setAsyncJobLockTimeInMillis
public void setAsyncJobLockTimeInMillis(int asyncJobLockTimeInMillis) - Specified by:
setAsyncJobLockTimeInMillis
in interfaceAsyncExecutor
-
getMoveTimerExecutorPoolSize
public int getMoveTimerExecutorPoolSize() -
setMoveTimerExecutorPoolSize
public void setMoveTimerExecutorPoolSize(int moveTimerExecutorPoolSize) -
getMaxTimerJobsPerAcquisition
public int getMaxTimerJobsPerAcquisition()- Specified by:
getMaxTimerJobsPerAcquisition
in interfaceAsyncExecutor
-
setMaxTimerJobsPerAcquisition
public void setMaxTimerJobsPerAcquisition(int maxTimerJobsPerAcquisition) - Specified by:
setMaxTimerJobsPerAcquisition
in interfaceAsyncExecutor
-
getMaxAsyncJobsDuePerAcquisition
public int getMaxAsyncJobsDuePerAcquisition()- Specified by:
getMaxAsyncJobsDuePerAcquisition
in interfaceAsyncExecutor
-
setMaxAsyncJobsDuePerAcquisition
public void setMaxAsyncJobsDuePerAcquisition(int maxAsyncJobsDuePerAcquisition) - Specified by:
setMaxAsyncJobsDuePerAcquisition
in interfaceAsyncExecutor
-
getDefaultTimerJobAcquireWaitTimeInMillis
public int getDefaultTimerJobAcquireWaitTimeInMillis()- Specified by:
getDefaultTimerJobAcquireWaitTimeInMillis
in interfaceAsyncExecutor
-
setDefaultTimerJobAcquireWaitTimeInMillis
public void setDefaultTimerJobAcquireWaitTimeInMillis(int defaultTimerJobAcquireWaitTimeInMillis) - Specified by:
setDefaultTimerJobAcquireWaitTimeInMillis
in interfaceAsyncExecutor
-
getDefaultAsyncJobAcquireWaitTimeInMillis
public int getDefaultAsyncJobAcquireWaitTimeInMillis()- Specified by:
getDefaultAsyncJobAcquireWaitTimeInMillis
in interfaceAsyncExecutor
-
setDefaultAsyncJobAcquireWaitTimeInMillis
public void setDefaultAsyncJobAcquireWaitTimeInMillis(int defaultAsyncJobAcquireWaitTimeInMillis) - Specified by:
setDefaultAsyncJobAcquireWaitTimeInMillis
in interfaceAsyncExecutor
-
setTimerJobRunnable
-
getDefaultQueueSizeFullWaitTimeInMillis
public int getDefaultQueueSizeFullWaitTimeInMillis()- Specified by:
getDefaultQueueSizeFullWaitTimeInMillis
in interfaceAsyncExecutor
-
setDefaultQueueSizeFullWaitTimeInMillis
public void setDefaultQueueSizeFullWaitTimeInMillis(int defaultQueueSizeFullWaitTime) - Specified by:
setDefaultQueueSizeFullWaitTimeInMillis
in 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:
getResetExpiredJobsInterval
in interfaceAsyncExecutor
-
setResetExpiredJobsInterval
public void setResetExpiredJobsInterval(int resetExpiredJobsInterval) - Specified by:
setResetExpiredJobsInterval
in interfaceAsyncExecutor
-
getResetExpiredJobsPageSize
public int getResetExpiredJobsPageSize()- Specified by:
getResetExpiredJobsPageSize
in interfaceAsyncExecutor
-
setResetExpiredJobsPageSize
public void setResetExpiredJobsPageSize(int resetExpiredJobsPageSize) - Specified by:
setResetExpiredJobsPageSize
in interfaceAsyncExecutor
-
getExecuteAsyncRunnableFactory
-
setExecuteAsyncRunnableFactory
-
getAsyncRunnableExecutionExceptionHandler
-
setAsyncRunnableExecutionExceptionHandler
public void setAsyncRunnableExecutionExceptionHandler(AsyncRunnableExecutionExceptionHandler asyncRunnableExecutionExceptionHandler) -
getTimerJobRunnable
-
getAsyncJobsDueRunnable
-
getResetExpiredJobsRunnable
-
getTenantId
-
setTenantId
-
getConfiguration
-
setConfiguration
-