org.apache.tinkerpop.gremlin.groovy.engine

## Class GremlinExecutor.Builder

- java.lang.Object
- - org.apache.tinkerpop.gremlin.groovy.engine.GremlinExecutor.Builder

- Enclosing class:
    GremlinExecutor

      public static final class GremlinExecutor.Builder
      extends Object

- - ### Method Summary

    All Methods Instance Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `GremlinExecutor.Builder` | `addEngineSettings(String engineName, List<String> imports, List<String> staticImports, List<String> scripts, Map<String,Object> config)` Deprecated. As of release 3.2.4, replaced by `addPlugins(String, Map)`.
    `GremlinExecutor.Builder` | `addPlugins(String engineName, Map<String,Map<String,Object>> plugins)` Add a configuration for a `GremlinPlugin` to the executor.
    `GremlinExecutor.Builder` | `afterFailure(BiConsumer<Bindings,Throwable> afterFailure)` A `Consumer` to execute in the event of failure.
    `GremlinExecutor.Builder` | `afterSuccess(Consumer<Bindings> afterSuccess)` A `Consumer` to execute just after successful script evaluation.
    `GremlinExecutor.Builder` | `afterTimeout(Consumer<Bindings> afterTimeout)` A `Consumer` to execute if the script times out.
    `GremlinExecutor.Builder` | `beforeEval(Consumer<Bindings> beforeEval)` A `Consumer` to execute just before the script evaluation.
    `GremlinExecutor` | `create()`
    `GremlinExecutor.Builder` | `enabledPlugins(Set<String> enabledPlugins)` Deprecated. As of release 3.2.4, replaced by `addPlugins(String, Map)` though behavior is not quite the same.
    `GremlinExecutor.Builder` | `engineSettings(Map<String,org.apache.tinkerpop.gremlin.groovy.engine.GremlinExecutor.EngineSettings> settings)` Deprecated. As of release 3.2.4, replaced by `addPlugins(String, Map)`.
    `GremlinExecutor.Builder` | `executorService(ExecutorService executorService)` The thread pool used to evaluate scripts.
    `GremlinExecutor.Builder` | `globalBindings(Bindings bindings)` Bindings to apply to every script evaluated.
    `GremlinExecutor.Builder` | `scheduledExecutorService(ScheduledExecutorService scheduledExecutorService)` The thread pool used to schedule timeouts on scripts.
    `GremlinExecutor.Builder` | `scriptEvaluationTimeout(long scriptEvaluationTimeout)` Amount of time a script has before it times out.
    `GremlinExecutor.Builder` | `use(List<List<String>> use)` Deprecated. As of release 3.2.4, not replaced.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### addEngineSettings

          @Deprecated
          public GremlinExecutor.Builder addEngineSettings(String engineName,
                                                                       List<String> imports,
                                                                       List<String> staticImports,
                                                                       List<String> scripts,
                                                                       Map<String,Object> config)

      Deprecated. As of release 3.2.4, replaced by `addPlugins(String, Map)`.
      Add a particular script engine for the executor to instantiate.
      Parameters:
        `engineName` - The name of the engine as defined by the engine itself.
        `imports` - A list of imports for the engine.
        `staticImports` - A list of static imports for the engine.
        `scripts` - A list of scripts to execute in the engine to initialize it.
        `config` - Custom configuration map for the ScriptEngine

    - #### addPlugins

          public GremlinExecutor.Builder addPlugins(String engineName,
                                                    Map<String,Map<String,Object>> plugins)

      Add a configuration for a `GremlinPlugin` to the executor. The key is the fully qualified class name of the `GremlinPlugin` instance and the value is a map of configuration values. In that map, the key is the name of a builder method on the `GremlinPlugin` and the value is some argument to pass to that method.

    - #### globalBindings

          public GremlinExecutor.Builder globalBindings(Bindings bindings)

      Bindings to apply to every script evaluated. Note that the entries of the supplied `Bindings` object will be copied into a newly created `ConcurrentBindings` object at the call of this method.

    - #### scriptEvaluationTimeout

          public GremlinExecutor.Builder scriptEvaluationTimeout(long scriptEvaluationTimeout)

      Amount of time a script has before it times out. Note that the time required covers both script evaluation as well as any time needed for a post result transformation (if the transformation function is supplied to the `GremlinExecutor.eval(java.lang.String)`).
      Parameters:
        `scriptEvaluationTimeout` - Time in milliseconds that a script is allowed to run and its results potentially transformed. Set to zero to have no timeout set.

    - #### engineSettings

          @Deprecated
          public GremlinExecutor.Builder engineSettings(Map<String,org.apache.tinkerpop.gremlin.groovy.engine.GremlinExecutor.EngineSettings> settings)

      Deprecated. As of release 3.2.4, replaced by `addPlugins(String, Map)`.
      Replaces any settings provided.

    - #### executorService

          public GremlinExecutor.Builder executorService(ExecutorService executorService)

      The thread pool used to evaluate scripts.

    - #### scheduledExecutorService

          public GremlinExecutor.Builder scheduledExecutorService(ScheduledExecutorService scheduledExecutorService)

      The thread pool used to schedule timeouts on scripts.

    - #### beforeEval

          public GremlinExecutor.Builder beforeEval(Consumer<Bindings> beforeEval)

      A `Consumer` to execute just before the script evaluation.

    - #### afterSuccess

          public GremlinExecutor.Builder afterSuccess(Consumer<Bindings> afterSuccess)

      A `Consumer` to execute just after successful script evaluation. Note that success will be called after evaluation of the script in the engine and after the results have passed through transformation (if a transform function is passed to the `GremlinExecutor.eval(java.lang.String)`.

    - #### afterTimeout

          public GremlinExecutor.Builder afterTimeout(Consumer<Bindings> afterTimeout)

      A `Consumer` to execute if the script times out.

    - #### afterFailure

          public GremlinExecutor.Builder afterFailure(BiConsumer<Bindings,Throwable> afterFailure)

      A `Consumer` to execute in the event of failure.

    - #### use

          @Deprecated
          public GremlinExecutor.Builder use(List<List<String>> use)

      Deprecated. As of release 3.2.4, not replaced.
      A set of maven coordinates for dependencies to be applied for the script engine instances.

    - #### enabledPlugins

          @Deprecated
          public GremlinExecutor.Builder enabledPlugins(Set<String> enabledPlugins)

      Deprecated. As of release 3.2.4, replaced by `addPlugins(String, Map)` though behavior is not quite the same.
      Set of the names of plugins that should be enabled for the engine.

    - #### create

          public GremlinExecutor create()

Copyright © 2013–2018 Apache Software Foundation. All rights reserved.