public abstract class AbstractScripting extends java.lang.Object implements Scripting
Constructor and Description |
---|
AbstractScripting(JavaClassLoader javaClassLoader,
Configuration configuration,
SpringBeanLoader springBeanLoader) |
Modifier and Type | Method and Description |
---|---|
void |
clearCache()
Clears compiled classes cache
|
<T> T |
evaluateGroovy(java.lang.String text,
groovy.lang.Binding binding)
Evaluates Groovy expression.
|
<T> T |
evaluateGroovy(java.lang.String text,
groovy.lang.Binding binding,
ScriptExecutionPolicy... policies)
Evaluates Groovy expression.
|
<T> T |
evaluateGroovy(java.lang.String text,
java.util.Map<java.lang.String,java.lang.Object> context)
Evaluates Groovy expression.
|
java.lang.ClassLoader |
getClassLoader()
Returns the dynamic classloader.
|
java.lang.Class<?> |
loadClass(java.lang.String name)
Loads class by name using the following sequence:
Search for a Groovy source in the conf directory.
|
java.lang.Class<?> |
loadClassNN(java.lang.String name)
Loads a class by name using the sequence described in
Scripting.loadClass(String) . |
boolean |
removeClass(java.lang.String name)
Remove compiled class from cache
|
<T> T |
runGroovyScript(java.lang.String name,
groovy.lang.Binding binding)
Runs Groovy script.
|
<T> T |
runGroovyScript(java.lang.String name,
java.util.Map<java.lang.String,java.lang.Object> context)
Runs Groovy script.
|
public AbstractScripting(JavaClassLoader javaClassLoader, Configuration configuration, SpringBeanLoader springBeanLoader)
public <T> T evaluateGroovy(java.lang.String text, groovy.lang.Binding binding, ScriptExecutionPolicy... policies)
Scripting
evaluateGroovy
in interface Scripting
T
- result typetext
- expression textbinding
- Groovy bindingpolicies
- policies for script execution ScriptExecutionPolicy
public <T> T evaluateGroovy(java.lang.String text, groovy.lang.Binding binding)
Scripting
evaluateGroovy
in interface Scripting
T
- result typetext
- expression textbinding
- Groovy bindingpublic <T> T evaluateGroovy(java.lang.String text, java.util.Map<java.lang.String,java.lang.Object> context)
Scripting
evaluateGroovy
in interface Scripting
T
- result typetext
- expression textcontext
- map of parameters to pass to the expression, same as Bindingpublic <T> T runGroovyScript(java.lang.String name, groovy.lang.Binding binding)
Scripting
runGroovyScript
in interface Scripting
T
- result typename
- path to the script relative to conf dir or to the classpath rootbinding
- Groovy bindingpublic <T> T runGroovyScript(java.lang.String name, java.util.Map<java.lang.String,java.lang.Object> context)
Scripting
runGroovyScript
in interface Scripting
T
- result typename
- path to the script relative to conf dir or to the classpath rootcontext
- map of parameters to pass to the script, same as Bindingpublic java.lang.ClassLoader getClassLoader()
Scripting
Actually it is the GroovyClassLoader which parent is JavaClassLoader
.
For explanation on class loading sequence see Scripting.loadClass(String)
getClassLoader
in interface Scripting
public java.lang.Class<?> loadClass(java.lang.String name)
Scripting
Scripting.clearCache()
method, e.g. through JMX interface
CachingFacadeMBean.public java.lang.Class<?> loadClassNN(java.lang.String name)
Scripting
Scripting.loadClass(String)
.loadClassNN
in interface Scripting
name
- fully qualified class namepublic boolean removeClass(java.lang.String name)
Scripting
removeClass
in interface Scripting
public void clearCache()
Scripting
clearCache
in interface Scripting