Package net.sf.basedb.clients.jobagent
Class JobRunner
java.lang.Object
net.sf.basedb.clients.jobagent.JobRunner
- All Implemented Interfaces:
Runnable
A runnable class that makes it possible to execute each job in it's own thread.
When the agent has found a job to execute it creates one instance of this class
and creates a new thread for it to run in. This class checks that there is a free
slot available and then uses the configured
JobExecutor
for the actual
execution of the job.- Version:
- 2.0
- Author:
- nicklas
- Last modified
- $Date: 2021-06-04 12:40:45 +0200 (Fri, 04 Jun 2021) $
-
Field Summary
Modifier and TypeFieldDescriptionprivate final Agent
private final Job
private final JobExecutor
private static final Logger
Log job agent events.private final JobAgentSettings
-
Constructor Summary
ConstructorDescriptionJobRunner
(Agent agent, Job job, JobAgentSettings settings, JobExecutor jobExecutor) Create a new job execution thread. -
Method Summary
Modifier and TypeMethodDescriptionvoid
run()
Find a free slot to use and then pass control to theJobExecutor.executeJob(SessionControl, Agent, Job, JobAgentSettings, Job.ExecutionTime)
method.
-
Field Details
-
log
Log job agent events. -
job
-
settings
-
jobExecutor
-
agent
-
-
Constructor Details
-
JobRunner
JobRunner(Agent agent, Job job, JobAgentSettings settings, JobExecutor jobExecutor) Create a new job execution thread.- Parameters:
agent
- The agent that created this objectjob
- The job to be executedsettings
- The settigns for the plugin that is executing the jobjobExecutor
- The job executor that should execute the job
-
-
Method Details
-
run
public void run()Find a free slot to use and then pass control to theJobExecutor.executeJob(SessionControl, Agent, Job, JobAgentSettings, Job.ExecutionTime)
method.
-