scripting
Class InterpreterDriverManager

java.lang.Object
  extended by scripting.InterpreterDriverManager

public class InterpreterDriverManager
extends java.lang.Object

Class for managing interpreter drivers. This manager is responsible for keeping track of loaded drivers. Interpreter drivers are required to register an instance of themselves with this manager when they are loaded.


Method Summary
static void executeScript(java.lang.String script, java.lang.String language, java.lang.String[] argNames, java.lang.String[] argValues)
          Execute a script string Execute the string supplied according to the langauge specified
static void executeScriptFile(java.lang.String scriptFile, java.lang.String[] argNames, java.lang.String[] argValues)
          Exceute a script file.
static void registerDriver(InterpreterDriver driver)
          Register a driver.
static void setVariable(java.lang.String name, java.lang.String value)
          Sets a variable/member to the specified value for all registered drivers
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

registerDriver

public static void registerDriver(InterpreterDriver driver)
Register a driver. Interpreter drivers call this method when they are loaded.

Parameters:
driver - the driver to be registered

executeScript

public static void executeScript(java.lang.String script,
                                 java.lang.String language,
                                 java.lang.String[] argNames,
                                 java.lang.String[] argValues)
                          throws InterpreterDriver.InterpreterException
Execute a script string Execute the string supplied according to the langauge specified

Parameters:
script - script to be executed
language - language for interpreting the script string
argNames - an array containing the names of arguments to be passed to the evaluation
argValues - an array containing the values of the arguments to be passed to the evaluation
Throws:
InterpreterDriver.InterpreterException

executeScriptFile

public static void executeScriptFile(java.lang.String scriptFile,
                                     java.lang.String[] argNames,
                                     java.lang.String[] argValues)
                              throws InterpreterDriver.InterpreterException
Exceute a script file. The interpreter driver supporting the language for this file is deduced from file name extension

Parameters:
scriptFile - file name containing script
argNames - an array containing the names of arguments to be passed to the evaluation
argValues - an array containing the values of the arguments to be passed to the evaluation
Throws:
InterpreterDriver.InterpreterException

setVariable

public static void setVariable(java.lang.String name,
                               java.lang.String value)
Sets a variable/member to the specified value for all registered drivers

Parameters:
name - the name of the variable to set
value - the value to assign the variable