Class AbstractScriptExecutor

java.lang.Object
org.springframework.integration.scripting.jsr223.AbstractScriptExecutor
All Implemented Interfaces:
ScriptExecutor
Direct Known Subclasses:
DefaultScriptExecutor, PythonScriptExecutor

public abstract class AbstractScriptExecutor extends Object implements ScriptExecutor
Base Class for ScriptExecutor.
Since:
2.1
Author:
David Turanski, Mark Fisher, Artem Bilan, Gary Russell, Ngoc Nhan
  • Field Details

    • logger

      protected final Log logger
  • Constructor Details

    • AbstractScriptExecutor

      protected AbstractScriptExecutor(String language)
    • AbstractScriptExecutor

      protected AbstractScriptExecutor(ScriptEngine scriptEngine)
  • Method Details

    • getScriptEngine

      public ScriptEngine getScriptEngine()
    • executeScript

      @Nullable public Object executeScript(ScriptSource scriptSource, Map<String,Object> variables)
      Description copied from interface: ScriptExecutor
      Execute a script from the provided ScriptSource with an optional binding variables.
      Specified by:
      executeScript in interface ScriptExecutor
      Parameters:
      scriptSource - The script source.
      variables - The variables.
      Returns:
      The result of the execution.
    • postProcess

      protected abstract Object postProcess(Object result, ScriptEngine scriptEngine, String script, Bindings bindings)
      Subclasses may implement this to provide any special handling required
      Parameters:
      result - the result.
      scriptEngine - the engine.
      script - the script.
      bindings - the bindings.
      Returns:
      modified result