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 configured JobExecutor
for the actual
execution of the job.
- Version:
- 2.0
- Author:
- nicklas
- Last modified
- $Date: 2010-10-19 13:02:17 +0200 (Tue, 19 Oct 2010) $
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
log
private static final 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
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
run
public void run()
- Find a free slot to use and then pass control to the
JobExecutor.executeJob(SessionControl, Agent, Job, JobAgentSettings, Job.ExecutionTime)
method.
- Specified by:
run
in interface Runnable