Class ResetExpiredJobsRunnable
- java.lang.Object
-
- org.flowable.job.service.impl.asyncexecutor.ResetExpiredJobsRunnable
-
- All Implemented Interfaces:
Runnable
- Direct Known Subclasses:
TenantAwareResetExpiredJobsRunnable
public class ResetExpiredJobsRunnable extends Object implements Runnable
Runnable that checks theJobentities 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
Fields Modifier and Type Field Description protected AsyncExecutorasyncExecutorprotected booleanisInterruptedprotected AtomicBooleanisWaitingprotected Collection<JobInfoEntityManager<? extends JobInfoEntity>>jobInfoEntityManagersprotected ObjectMONITORprotected Stringname
-
Constructor Summary
Constructors Constructor Description ResetExpiredJobsRunnable(String name, AsyncExecutor asyncExecutor, JobInfoEntityManager<? extends JobInfoEntity>... jobEntityManagers)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected StringgetEngineName()booleanisInterrupted()voidresetJobs()Resets jobs that were expired.protected voidresetJobs(JobInfoEntityManager<? extends JobInfoEntity> jobEntityManager)voidrun()voidsetInterrupted(boolean interrupted)voidstop()
-
-
-
Field Detail
-
name
protected final String name
-
asyncExecutor
protected final AsyncExecutor asyncExecutor
-
jobInfoEntityManagers
protected final Collection<JobInfoEntityManager<? extends JobInfoEntity>> jobInfoEntityManagers
-
isInterrupted
protected volatile boolean isInterrupted
-
MONITOR
protected final Object MONITOR
-
isWaiting
protected final AtomicBoolean isWaiting
-
-
Constructor Detail
-
ResetExpiredJobsRunnable
public ResetExpiredJobsRunnable(String name, AsyncExecutor asyncExecutor, JobInfoEntityManager<? extends JobInfoEntity>... jobEntityManagers)
-
-
Method Detail
-
resetJobs
public void resetJobs()
Resets jobs that were expired. Will continue to reset jobs until no more jobs are returned.
-
resetJobs
protected void resetJobs(JobInfoEntityManager<? extends JobInfoEntity> jobEntityManager)
-
stop
public void stop()
-
getEngineName
protected String getEngineName()
-
isInterrupted
public boolean isInterrupted()
-
setInterrupted
public void setInterrupted(boolean interrupted)
-
-