org.figure8.join.services.scripting.groovy
Class GroovyScriptLauncher

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

public class GroovyScriptLauncher
extends ScriptLauncher

Extension of ScriptLauncher dedicated to the Groovy script language (see http://groovy.codehaus.org). This implementation lets you wrap the execution of a Groovy script within a ScriptLauncher.

Version:
$Revision: 1.2 $
Author:
Laurent Broudoux

Field Summary
 
Fields inherited from class org.figure8.join.services.scripting.ScriptLauncher
parameters, SCRIPT_PARAM, scriptParam
 
Constructor Summary
GroovyScriptLauncher()
          Creates a new instance of GroovyScriptLauncher.
GroovyScriptLauncher(java.lang.String scriptPath)
          Creates a new instance of GroovyScriptLauncher with script path.
 
Method Summary
 void runScript(java.util.Properties properties)
          Run the Groovy script file identified by scriptPath inner field.
 
Methods inherited from class org.figure8.join.services.scripting.ScriptLauncher
getLogOutputStream, getParameterDefinitions, getParameterDefinitionsAsList, getScript, getScriptPath, setLogOutputStream, setParameter, setParameter, setParameters, setScriptPath
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GroovyScriptLauncher

public GroovyScriptLauncher()
Creates a new instance of GroovyScriptLauncher.


GroovyScriptLauncher

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

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

runScript

public void runScript(java.util.Properties properties)
               throws ScriptException
Run the Groovy script file identified by scriptPath inner field. Properties passed as param are injected into the Groovy script as binding properties. Script can directly use them using the ${property_name} form. Warning: "." in properties keys passing in are modified into "_" before injected. This is necessary because "." as special meaning in Groovy (nested field) that we don't want to have here.

Specified by:
runScript in class ScriptLauncher
Parameters:
properties -
Throws:
ScriptException - if something wrong occurs during script parsing, evaluation, ...


Copyright © 2005-2008 Join. All Rights Reserved.