Class GroovyScriptExecutorFactory


  • public class GroovyScriptExecutorFactory
    extends ScriptExecutorFactory
    Creates a new ScriptExecutorFactory for executing Groovy scripts. Scripts are compiled at the creation of a new instance of ScriptExecutor.
    • Constructor Detail

      • GroovyScriptExecutorFactory

        public GroovyScriptExecutorFactory()
        Make sure we blow up if Groovy does not exist.
    • Method Detail

      • newScriptExecutor

        public ScriptExecutor newScriptExecutor​(ClassLoader loader,
                                                String script,
                                                boolean compile)
        Creates a script executor for the given script.

        Always compile the script.

        Specified by:
        newScriptExecutor in class ScriptExecutorFactory
        Parameters:
        loader - The classloader that contains the java classes that the script should have access to.
        script - The script text.
        compile - A hint to tell the script executor whether or not to compile the given script. This need not be implemented by all script executors. If true, the caller is saying that they intend to call the script multiple times with different arguments, so compile if possible.
        Returns:
        A script executor.