Interface ScriptExecutor

All Known Implementing Classes:
PolyglotExecutor

public interface ScriptExecutor
  • Method Details

    • createSingleThreadExecutorService

      static ExecutorService createSingleThreadExecutorService()
    • createSingleThreadExecutor

      static Consumer<Runnable> createSingleThreadExecutor()
    • getLanguage

      Language getLanguage()
    • getLanguageId

      default String getLanguageId()
    • getExecutor

      Consumer<Runnable> getExecutor()
    • evalSafe

      default <T> T evalSafe(String pSource, Map<String,Object> pVarMap)
      Evaluates the specified code thread-safely.
    • evalSafe

      default <T> T evalSafe(String pSource, Map<String,Object> pVarMap, Class<T> pResultType)
      Evaluates the specified code thread-safely.
    • eval

      <T> T eval(String pSource, Map<String,Object> pVarMap, Class<T> pResultType)
      Evaluates the specified code.
    • eval

      default <T> void eval(String pSource, Map<String,Object> pVarMap, Class<T> pResultType, BiConsumer<T,Exception> pResultConsumer)
      Evaluates the specified code.
      Parameters:
      pVarMap - A map containing variables with values to pass to guest code execution. The map should be thread-safe.
    • eval

      <T> void eval(String pSource, Map<String,Object> pVarMap, Class<T> pResultType, BiConsumer<T,Exception> pResultConsumer, long pTimeoutMs)
      Evaluates the specified code.
      Parameters:
      pVarMap - A map containing variables with values to pass to guest code execution. The map should be thread-safe.