org.figure8.join.services.scripting.ruby
Class RubyScriptLauncher

java.lang.Object
  extended by org.figure8.join.services.scripting.ScriptLauncher
      extended by org.figure8.join.services.scripting.ruby.RubyScriptLauncher
All Implemented Interfaces:
Configurable

public class RubyScriptLauncher
extends ScriptLauncher

Version:
$Revision$
Author:
Laurent Broudoux

Field Summary
static java.lang.String LIBRARY_PATH_PARAM
          Name of configurable parameter denoting the path to Ruby libraries
protected static java.util.List parameters
          List of ParameterDefinitions supported by this launcher
protected static ParameterDefinition targetParam
          ParameterDefinition representation of parameter denoting the target to execute.
 
Fields inherited from class org.figure8.join.services.scripting.ScriptLauncher
SCRIPT_PARAM, scriptParam
 
Constructor Summary
RubyScriptLauncher()
          Creates a new instance of RubyScriptLauncher
RubyScriptLauncher(java.lang.String scriptPath)
          Creates a new instance of RubyScriptLauncher with script path
 
Method Summary
 java.lang.String getLibraryPath()
           
 java.util.List getParameterDefinitionsAsList()
          Get this object parameters definitions as a list
 void runScript(java.util.Properties properties)
          Run the Ruby script file identified by scriptPath inner field.
 void setLibraryPath(java.lang.String libraryPath)
           
 void setParameter(java.lang.String parameterName, java.lang.String parameterValue)
          Set the value of a parameter using its nama
 
Methods inherited from class org.figure8.join.services.scripting.ScriptLauncher
getLogOutputStream, getParameterDefinitions, getScript, getScriptPath, setLogOutputStream, setParameter, setParameters, setScriptPath
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LIBRARY_PATH_PARAM

public static final java.lang.String LIBRARY_PATH_PARAM
Name of configurable parameter denoting the path to Ruby libraries

See Also:
Constant Field Values

parameters

protected static java.util.List parameters
List of ParameterDefinitions supported by this launcher


targetParam

protected static final ParameterDefinition targetParam
ParameterDefinition representation of parameter denoting the target to execute.

Constructor Detail

RubyScriptLauncher

public RubyScriptLauncher()
Creates a new instance of RubyScriptLauncher


RubyScriptLauncher

public RubyScriptLauncher(java.lang.String scriptPath)
                   throws InvalidParameterException
Creates a new instance of RubyScriptLauncher with script path

Parameters:
scriptPath - the path of script to later execute
Throws:
InvalidParameterException - if path cannot be accessed
Method Detail

getLibraryPath

public java.lang.String getLibraryPath()
Returns:
The path of Ruby libraries to load

setLibraryPath

public void setLibraryPath(java.lang.String libraryPath)
Parameters:
libraryPath - The path of Ruby libraries to load

runScript

public void runScript(java.util.Properties properties)
               throws ScriptException
Run the Ruby script file identified by scriptPath inner field. Properties passed as param are injected into the Ruby runtime as arguments. Script can directly use them using the $property form.

Specified by:
runScript in class ScriptLauncher
Parameters:
properties - The runtime properties to inject into execution environment
Throws:
ScriptException - if something wrong occurs during script parsing, evaluation, ...

getParameterDefinitionsAsList

public java.util.List getParameterDefinitionsAsList()
Get this object parameters definitions as a list

Specified by:
getParameterDefinitionsAsList in interface Configurable
Overrides:
getParameterDefinitionsAsList in class ScriptLauncher
Returns:
A list of ParameterDefinition objects

setParameter

public void setParameter(java.lang.String parameterName,
                         java.lang.String parameterValue)
                  throws InvalidParameterException
Set the value of a parameter using its nama

Specified by:
setParameter in interface Configurable
Overrides:
setParameter in class ScriptLauncher
Parameters:
parameterName - The name of parameter so set value for
parameterValue - The value of the paramater
Throws:
InvalidParameterException - if this parameter is not supported by this object


Copyright © 2005-2008 Join. All Rights Reserved.