Package net.sf.basedb.clients.jobagent
Class JobQueueChecker
java.lang.Object
java.util.TimerTask
net.sf.basedb.clients.jobagent.JobQueueChecker
- All Implemented Interfaces:
Runnable
public class JobQueueChecker extends TimerTask
This class is given the responsibility to check the job queue for
jobs that are awaiting execution. Each agent has one instance of this
class which is registered with the BASE core scheduler
Application.getScheduler()
.
This object should be thread-safe since the scheduler creates a new thread each
time the run()
method is called.
- Version:
- 2.0
- Author:
- nicklas
- Last modified
- $Date: 2021-06-04 12:40:45 +0200 (Fri, 04 Jun 2021) $
-
Field Summary
-
Constructor Summary
Constructors Constructor Description JobQueueChecker(Agent agent)
-
Method Summary
Modifier and Type Method Description boolean
cancel()
private void
checkForJobs()
void
run()
Methods inherited from class java.util.TimerTask
scheduledExecutionTime
-
Field Details
-
log
private static final org.slf4j.Logger logLog job agent events. -
agent
-
jobQuery
Cached query for waiting jobs. Reloaded only when the job agent's version has changed. We cache the query since loading all users that are allowed to use the job agent is an expensive operation. -
agentVersionForJobQuery
private int agentVersionForJobQueryThe job agent's version when the query was cached.
-
-
Constructor Details
-
JobQueueChecker
-
-
Method Details