2.17.2: 2011-06-17

net.sf.basedb.clients.jobagent
Class JobRunner

java.lang.Object
  extended by 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) $

Field Summary
private  Agent agent
           
private  Job job
           
private  JobExecutor jobExecutor
           
private static Logger log
          Log job agent events.
private  JobAgentSettings settings
           
 
Constructor Summary
JobRunner(Agent agent, Job job, JobAgentSettings settings, JobExecutor jobExecutor)
          Create a new job execution thread.
 
Method Summary
 void run()
          Find a free slot to use and then pass control to the JobExecutor.executeJob(SessionControl, Agent, Job, JobAgentSettings, Job.ExecutionTime) method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

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
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 object
job - The job to be executed
settings - The settigns for the plugin that is executing the job
jobExecutor - 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 the JobExecutor.executeJob(SessionControl, Agent, Job, JobAgentSettings, Job.ExecutionTime) method.

Specified by:
run in interface Runnable

2.17.2: 2011-06-17