| java.lang.Object groovy.util.GroovyScriptEngine
GroovyScriptEngine | public class GroovyScriptEngine implements ResourceConnector(Code) | | Specific script engine able to reload modified scripts as well as dealing properly with dependent scripts.
author: sam author: Marc Palmer author: Guillaume Laforge |
GroovyScriptEngine | public GroovyScriptEngine(URL[] roots)(Code) | | 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 shouldbe layed out using their package structure like Java classes |
getParentClassLoader | public ClassLoader getParentClassLoader()(Code) | | Get the ClassLoader that will serve as the parent ClassLoader of the
GroovyClassLoader in which scripts will be executed. By default, this is the
ClassLoader that loaded the GroovyScriptEngine class.
parent classloader used to load scripts |
getResourceConnection | public URLConnection getResourceConnection(String resourceName) throws ResourceException(Code) | | Get a resource connection as a URLConnection to retrieve a script
from the ResourceConnector
Parameters: resourceName - name of the resource to be retrieved a URLConnection to the resource throws: ResourceException - |
main | public static void main(String[] urls) throws Exception(Code) | | Simple testing harness for the GSE. Enter script roots as arguments and
then input script names to run them.
Parameters: urls - throws: Exception - |
setParentClassLoader | public void setParentClassLoader(ClassLoader parentClassLoader)(Code) | | Parameters: parentClassLoader - ClassLoader to be used as the parent ClassLoader for scripts executed by the engine |
|
|