com.exoftware.exactor
Class Runner

java.lang.Object
  extended bycom.exoftware.exactor.Runner

public class Runner
extends java.lang.Object

Class to run scripts from a file or directory. Script files are plain text files with the extension .act. The format of the script files is as follows;


    # a comment line
    CommandName [param 1] [param 2] ... [param n]
    AnotherCommand
 
Command names are mapped to instances of the Command class by looking for a class with the same name on the classpath.

Author:
Brian Swan

Constructor Summary
Runner(java.lang.String fileName)
          Create a new Runner.
 
Method Summary
 void addListener(ExecutionSetListener listener)
          Add a listener for execution events.
 java.lang.String getBaseDir()
          Returns the base directory of the runner.
static void main(java.lang.String[] args)
          Main entry point.
 void run()
          Run the script, or all the scripts if the runner was created with a directory name.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Runner

public Runner(java.lang.String fileName)
       throws java.io.FileNotFoundException
Create a new Runner.

Parameters:
fileName - the name of the file or directory to run.
Throws:
java.io.FileNotFoundException - if the specified filename is not a file or directory name.
Method Detail

main

public static void main(java.lang.String[] args)
Main entry point. Expected argument is the name of a script file or a directory containing script files.

Parameters:
args - the command line arguments.

addListener

public void addListener(ExecutionSetListener listener)
Add a listener for execution events.

Parameters:
listener - the listener to add.

run

public void run()
Run the script, or all the scripts if the runner was created with a directory name.


getBaseDir

public java.lang.String getBaseDir()
Returns the base directory of the runner. The base directory is the directory passed the constructor, or if a file was supplied, the parent directory of the file.

Returns:
the base directory of the runner.