xsmeral.semnet.manager
Class JobRunner

java.lang.Object
  extended by xsmeral.semnet.manager.JobRunner

public class JobRunner
extends Object

Executor of processing jobs.

See Also:
ProcessingJob

Constructor Summary
JobRunner(ProcessingJob job, String workingDir)
          Creates an instance for the specified job and working directory.
 
Method Summary
 ProcessingJob getJob()
          Returns the supplied processing job.
 xsmeral.pipe.Pipe getPipe()
          Returns the Pipe created from processors in the supplied job.
static void main(String[] args)
          Executes the supplied job.
 void run()
          Starts the Pipe and waits for it to stop.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JobRunner

public JobRunner(ProcessingJob job,
                 String workingDir)
          throws ConfigurationException
Creates an instance for the specified job and working directory. Instantiates and initializes processors in the supplied processing job's chain, creates a pipe, assigns supplied working directory.
Registers a shutdown hook that stops the pipe.

Parameters:
job - The processing job to execute
workingDir - The working directory for the processors. All files are resolved against it.
Throws:
ConfigurationException
See Also:
Runtime.addShutdownHook(java.lang.Thread)
Method Detail

run

public void run()
         throws xsmeral.pipe.ObjectProcessorException
Starts the Pipe and waits for it to stop.

Throws:
xsmeral.pipe.ObjectProcessorException - If the pipe can't start.

getJob

public ProcessingJob getJob()
Returns the supplied processing job.


getPipe

public xsmeral.pipe.Pipe getPipe()
Returns the Pipe created from processors in the supplied job.


main

public static void main(String[] args)
Executes the supplied job. The first command line argument should be a path to a job file or a name of a directory that contains the job file with default name.