org.apache.tinkerpop.gremlin.groovy.engine

## Class ScriptEngines

- java.lang.Object
- - org.apache.tinkerpop.gremlin.groovy.engine.ScriptEngines

- All Implemented Interfaces:
    AutoCloseable

  Deprecated.
  As of release 3.2.4, not directly replaced - see `GremlinScriptEngineManager`.

      @Deprecated
      public class ScriptEngines
      extends Object
      implements AutoCloseable

  Holds a batch of the configured `ScriptEngine` objects for the server.
  Author:
    Stephen Mallette (http://stephen.genoprime.com)

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ScriptEngines(Consumer<ScriptEngines> initializer)` Deprecated. Creates a new object.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addImports(Set<String> imports)` Deprecated. Perform append to the existing import list for all `ScriptEngine` instances that implement the `DependencyManager` interface.
    `void` | `close()` Deprecated. Iterate through all the `ScriptEngine` implementations and if they implement `AutoCloseable` then call the `AutoCloseable.close()` method.
    `CompiledScript` | `compile(Reader script, String language)` Deprecated. Compiles a script without executing it.
    `CompiledScript` | `compile(String script, String language)` Deprecated. Compiles a script without executing it.
    `Map<String,List<Map>>` | `dependencies()` Deprecated. List dependencies for those `ScriptEngine` objects that implement the `DependencyManager` interface.
    `Traversal.Admin` | `eval(Bytecode bytecode, Bindings bindings, String language)` Deprecated. As of release 3.2.7, replaced by `eval(Bytecode, Bindings, String, String)`.
    `Traversal.Admin` | `eval(Bytecode bytecode, Bindings bindings, String language, String traversalSource)` Deprecated.
    `Object` | `eval(Reader reader, Bindings bindings, String language)` Deprecated. Evaluate a script with `Bindings` for a particular language.
    `Object` | `eval(String script, Bindings bindings, String language)` Deprecated. Evaluate a script with `Bindings` for a particular language.
    `GremlinScriptEngine` | `getEngineByName(String engineName)` Deprecated. Gets an `GremlinScriptEngine` by its name.
    `Map<String,List<Map>>` | `imports()` Deprecated. List the imports for those `ScriptEngine` objects that implement the `DependencyManager` interface.
    `void` | `loadPlugins(List<GremlinPlugin> plugins)` Deprecated. For each `DependencyManager` try to load the specified plugins.
    `void` | `reload(String language, Set<String> imports, Set<String> staticImports, Map<String,Object> config)` Deprecated. Reload a `ScriptEngine` with fresh imports.
    `void` | `reset()` Deprecated. Resets the ScriptEngines and re-initializes them.
    `List<GremlinPlugin>` | `use(String group, String artifact, String version)` Deprecated. Pull in dependencies given some Maven coordinates.

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

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

- - ### Constructor Detail

    - #### ScriptEngines

          public ScriptEngines(Consumer<ScriptEngines> initializer)

      Deprecated.
      Creates a new object.
      Parameters:
        `initializer` - allows for external initialization of the newly created `ScriptEngines` object

  - ### Method Detail

    - #### eval

          public Traversal.Admin eval(Bytecode bytecode,
                                      Bindings bindings,
                                      String language)
                               throws ScriptException

      Deprecated. As of release 3.2.7, replaced by `eval(Bytecode, Bindings, String, String)`.
      Throws:
        `ScriptException`

    - #### eval

          public Traversal.Admin eval(Bytecode bytecode,
                                      Bindings bindings,
                                      String language,
                                      String traversalSource)
                               throws ScriptException

      Deprecated.
      Throws:
        `ScriptException`

    - #### eval

          public Object eval(String script,
                             Bindings bindings,
                             String language)
                      throws ScriptException

      Deprecated.
      Evaluate a script with `Bindings` for a particular language.
      Throws:
        `ScriptException`

    - #### eval

          public Object eval(Reader reader,
                             Bindings bindings,
                             String language)
                      throws ScriptException

      Deprecated.
      Evaluate a script with `Bindings` for a particular language.
      Throws:
        `ScriptException`

    - #### compile

          public CompiledScript compile(String script,
                                        String language)
                                 throws ScriptException

      Deprecated.
      Compiles a script without executing it.
      Throws:
        `UnsupportedOperationException` - if the `ScriptEngine` implementation does not implement the `Compilable` interface.
        `ScriptException`

    - #### compile

          public CompiledScript compile(Reader script,
                                        String language)
                                 throws ScriptException

      Deprecated.
      Compiles a script without executing it.
      Throws:
        `UnsupportedOperationException` - if the `ScriptEngine` implementation does not implement the `Compilable` interface.
        `ScriptException`

    - #### reload

          public void reload(String language,
                             Set<String> imports,
                             Set<String> staticImports,
                             Map<String,Object> config)

      Deprecated.
      Reload a `ScriptEngine` with fresh imports. Waits for any existing script evaluations to complete but then blocks other operations until complete.

    - #### addImports

          public void addImports(Set<String> imports)

      Deprecated.
      Perform append to the existing import list for all `ScriptEngine` instances that implement the `DependencyManager` interface. Waits for any existing script evaluations to complete but then blocks other operations until complete.

    - #### use

          public List<GremlinPlugin> use(String group,
                                         String artifact,
                                         String version)

      Deprecated.
      Pull in dependencies given some Maven coordinates. Cycle through each `ScriptEngine` and determine if it implements `DependencyManager`. For those that do call the @{link DependencyManager#use} method to fire it up. Waits for any existing script evaluations to complete but then blocks other operations until complete.

    - #### loadPlugins

          public void loadPlugins(List<GremlinPlugin> plugins)

      Deprecated.
      For each `DependencyManager` try to load the specified plugins.

    - #### close

          public void close()
                     throws Exception

      Deprecated.
      Iterate through all the `ScriptEngine` implementations and if they implement `AutoCloseable` then call the `AutoCloseable.close()` method. After that is complete, the script engine cache will be cleared.
      Specified by:
        `close` in interface `AutoCloseable`
      Throws:
        `Exception`

    - #### reset

          public void reset()

      Deprecated.
      Resets the ScriptEngines and re-initializes them. Waits for any existing script evaluations to complete but then blocks other operations until complete.

    - #### dependencies

          public Map<String,List<Map>> dependencies()

      Deprecated.
      List dependencies for those `ScriptEngine` objects that implement the `DependencyManager` interface.

    - #### imports

          public Map<String,List<Map>> imports()

      Deprecated.
      List the imports for those `ScriptEngine` objects that implement the `DependencyManager` interface.

    - #### getEngineByName

          public GremlinScriptEngine getEngineByName(String engineName)

      Deprecated.
      Gets an `GremlinScriptEngine` by its name.

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