Class PolyglotScriptExecutor

java.lang.Object
org.springframework.integration.scripting.PolyglotScriptExecutor
All Implemented Interfaces:
ScriptExecutor

public class PolyglotScriptExecutor extends Object implements ScriptExecutor
GraalVM Polyglot ScriptExecutor implementation.
Since:
6.0
  • Constructor Details

    • PolyglotScriptExecutor

      public PolyglotScriptExecutor(String language)
      Construct an executor based on the provided language id.
      Parameters:
      language - the supported by GraalVM language id.
    • PolyglotScriptExecutor

      public PolyglotScriptExecutor(String language, org.graalvm.polyglot.Context.Builder contextBuilder)
      Construct an executor based on the provided language id.
      Parameters:
      language - the supported by GraalVM language id.
  • Method Details

    • executeScript

      public Object executeScript(org.springframework.scripting.ScriptSource scriptSource, @Nullable 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.