groovy.util
Class GroovyScriptEngine

java.lang.Object
  extended by groovy.util.GroovyScriptEngine
All Implemented Interfaces:
ResourceConnector

public class GroovyScriptEngine
extends Object
implements ResourceConnector

Author:
sam To change the template for this generated type comment go to Window - Preferences - Java - Code Generation - Code and Comments

Constructor Summary
GroovyScriptEngine(ResourceConnector rc)
           
GroovyScriptEngine(String arg)
           
GroovyScriptEngine(String[] args)
           
GroovyScriptEngine(URL[] roots)
          The groovy script engine will run groovy scripts and reload them and their dependencies when they are modified.
 
Method Summary
 URLConnection getResourceConnection(String resourceName)
           
static void main(String[] args)
          Simple testing harness for the GSE.
 Object run(String script, Binding binding)
           
 String run(String script, String argument)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GroovyScriptEngine

public GroovyScriptEngine(URL[] roots)
The groovy script engine will run groovy scripts and reload them and their dependencies when they are modified. This is useful for embedding groovy in other containers like games and application servers.

Parameters:
roots - This an array of URLs where Groovy scripts will be stored. They should be layed out using their package structure like Java classes

GroovyScriptEngine

public GroovyScriptEngine(String[] args)
                   throws IOException
Throws:
IOException

GroovyScriptEngine

public GroovyScriptEngine(String arg)
                   throws IOException
Throws:
IOException

GroovyScriptEngine

public GroovyScriptEngine(ResourceConnector rc)
Method Detail

main

public static void main(String[] args)
                 throws Exception
Simple testing harness for the GSE. Enter script roots as arguments and then input script names to run them.

Parameters:
args -
Throws:
Exception

getResourceConnection

public URLConnection getResourceConnection(String resourceName)
                                    throws ResourceException
Specified by:
getResourceConnection in interface ResourceConnector
Throws:
ResourceException

run

public String run(String script,
                  String argument)
           throws ResourceException,
                  ScriptException
Throws:
ResourceException
ScriptException

run

public Object run(String script,
                  Binding binding)
           throws ResourceException,
                  ScriptException
Throws:
ResourceException
ScriptException


Copyright © 2003-2010 The Codehaus. All Rights Reserved.