Package net.sf.basedb.clients.jobagent
Class JobRunner
- java.lang.Object
-
- net.sf.basedb.clients.jobagent.JobRunner
-
- All Implemented Interfaces:
Runnable
public class JobRunner extends Object implements 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 configuredJobExecutor
for the actual execution of the job.- Version:
- 2.0
- Author:
- nicklas
- Last modified
- $Date: 2014-04-09 14:21:20 +0200 (on, 09 apr 2014) $
-
-
Field Summary
Fields Modifier and Type Field Description private Agent
agent
private Job
job
private JobExecutor
jobExecutor
private static org.slf4j.Logger
log
Log job agent events.private JobAgentSettings
settings
-
Constructor Summary
Constructors Constructor Description JobRunner(Agent agent, Job job, JobAgentSettings settings, JobExecutor jobExecutor)
Create a new job execution thread.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
run()
Find a free slot to use and then pass control to theJobExecutor.executeJob(SessionControl, Agent, Job, JobAgentSettings, Job.ExecutionTime)
method.
-
-
-
Field Detail
-
log
private static final org.slf4j.Logger log
Log job agent events.
-
job
private final Job job
-
settings
private final JobAgentSettings settings
-
jobExecutor
private final JobExecutor jobExecutor
-
agent
private final Agent agent
-
-
Constructor Detail
-
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 Detail
-
run
public void run()
Find a free slot to use and then pass control to theJobExecutor.executeJob(SessionControl, Agent, Job, JobAgentSettings, Job.ExecutionTime)
method.
-
-