Class ResetExpiredJobsRunnable
java.lang.Object
org.flowable.job.service.impl.asyncexecutor.ResetExpiredJobsRunnable
- All Implemented Interfaces:
Runnable
- Direct Known Subclasses:
TenantAwareResetExpiredJobsRunnable
Runnable that checks the
Job
entities periodically for 'expired' jobs.
When a job is executed, it is first locked (lock owner and lock time is set).
A job is expired when this lock time is exceeded (this can for example happen when an executor goes down before completing a task)
This runnable will find such jobs and reset them, so they can be picked up again.- Author:
- Joram Barrez
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final AsyncExecutor
protected boolean
protected final AtomicBoolean
protected final Collection<JobInfoEntityManager<? extends JobInfoEntity>>
protected final Object
protected final String
-
Constructor Summary
ConstructorsConstructorDescriptionResetExpiredJobsRunnable
(String name, AsyncExecutor asyncExecutor, JobInfoEntityManager<? extends JobInfoEntity>... jobEntityManagers) -
Method Summary
Modifier and TypeMethodDescriptionprotected String
boolean
void
Resets jobs that were expired.protected void
resetJobs
(JobInfoEntityManager<? extends JobInfoEntity> jobEntityManager) void
run()
void
setInterrupted
(boolean interrupted) void
stop()
-
Field Details
-
name
-
asyncExecutor
-
jobInfoEntityManagers
-
isInterrupted
protected volatile boolean isInterrupted -
MONITOR
-
isWaiting
-
-
Constructor Details
-
ResetExpiredJobsRunnable
public ResetExpiredJobsRunnable(String name, AsyncExecutor asyncExecutor, JobInfoEntityManager<? extends JobInfoEntity>... jobEntityManagers)
-
-
Method Details
-
run
public void run() -
resetJobs
public void resetJobs()Resets jobs that were expired. Will continue to reset jobs until no more jobs are returned. -
resetJobs
-
stop
public void stop() -
getEngineName
-
isInterrupted
public boolean isInterrupted() -
setInterrupted
public void setInterrupted(boolean interrupted)
-