org.apache.tinkerpop.gremlin.groovy.plugin

## Class AbstractGremlinPlugin

- java.lang.Object
- - org.apache.tinkerpop.gremlin.groovy.plugin.AbstractGremlinPlugin

- All Implemented Interfaces:
    GremlinPlugin
  Direct Known Subclasses:
    CredentialGraphGremlinPlugin, GiraphGremlinPlugin, HadoopGremlinPlugin, Neo4jGremlinPlugin, SparkGremlinPlugin, SugarGremlinPlugin, TinkerGraphGremlinPlugin

  Deprecated.
  As of release 3.2.4, replaced by `AbstractGremlinPlugin`.

      @Deprecated
      public abstract class AbstractGremlinPlugin
      extends Object
      implements GremlinPlugin

  A base class for a plugin that provides access to the shell and io variables. This is a good class to extend from if the plugin needs to interact with the shell in some way, such as the case with those plugins that want to utilize the `RemoteAcceptor` and may need access to those shell and io objects.
  Author:
    Stephen Mallette (http://stephen.genoprime.com)

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected static String` | `DOT_STAR` Deprecated.
    `static String` | `ENV_CONSOLE_IO` Deprecated.
    `static String` | `ENV_CONSOLE_SHELL` Deprecated.
    `protected static String` | `IMPORT_SPACE` Deprecated.
    `protected static String` | `IMPORT_STATIC_SPACE` Deprecated.
    `protected IO` | `io` Deprecated.
    `protected boolean` | `requireConsoleEnvironment` Deprecated.
    `protected Groovysh` | `shell` Deprecated.

    - ### Fields inherited from interface org.apache.tinkerpop.gremlin.groovy.plugin.GremlinPlugin

      `ENVIRONMENT`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AbstractGremlinPlugin()` Deprecated. Creates a new instance that does not force the plugin to require the console.
    `AbstractGremlinPlugin(boolean requireConsoleEnvironment)` Deprecated. Creates a new instance that allows the plugin to specify whether the console is required or not.

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `abstract void` | `afterPluginTo(PluginAcceptor pluginAcceptor)` Deprecated. Called after the `pluginTo(PluginAcceptor)` method is executed which sets the `io` and `shell` member variables.
    `void` | `pluginTo(PluginAcceptor pluginAcceptor)` Deprecated. Implementers will typically execute imports of classes within their project that they want available in the console or they may use meta programming to introduce new extensions to the Gremlin.

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

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

    - ### Methods inherited from interface org.apache.tinkerpop.gremlin.groovy.plugin.GremlinPlugin

      `getName, remoteAcceptor, requireRestart`

- - ### Field Detail

    - #### ENV_CONSOLE_IO

          public static final String ENV_CONSOLE_IO

      Deprecated.
      See Also:
        Constant Field Values

    - #### ENV_CONSOLE_SHELL

          public static final String ENV_CONSOLE_SHELL

      Deprecated.
      See Also:
        Constant Field Values

    - #### IMPORT_SPACE

          protected static final String IMPORT_SPACE

      Deprecated.
      See Also:
        Constant Field Values

    - #### IMPORT_STATIC_SPACE

          protected static final String IMPORT_STATIC_SPACE

      Deprecated.
      See Also:
        Constant Field Values

    - #### DOT_STAR

          protected static final String DOT_STAR

      Deprecated.
      See Also:
        Constant Field Values

    - #### io

          protected IO io

      Deprecated.

    - #### shell

          protected Groovysh shell

      Deprecated.

    - #### requireConsoleEnvironment

          protected final boolean requireConsoleEnvironment

      Deprecated.

  - ### Constructor Detail

    - #### AbstractGremlinPlugin

          public AbstractGremlinPlugin()

      Deprecated.
      Creates a new instance that does not force the plugin to require the console. This will create a plugin that will work in Gremlin Console and Gremlin Server.

    - #### AbstractGremlinPlugin

          public AbstractGremlinPlugin(boolean requireConsoleEnvironment)

      Deprecated.
      Creates a new instance that allows the plugin to specify whether the console is required or not. It is only necessary to require the console if there are specific required calls to `IO` or to `Groovysh` methods in the plugin (as those classes are Gremlin Console related and cannot be provided outside of that environment). For a plugin to work in the Gremlin Console and in Gremlin Server this value must be set to `false`.

  - ### Method Detail

    - #### pluginTo

          public void pluginTo(PluginAcceptor pluginAcceptor)
                        throws IllegalEnvironmentException,
                               PluginInitializationException

      Deprecated.
      Implementers will typically execute imports of classes within their project that they want available in the console or they may use meta programming to introduce new extensions to the Gremlin.

      Provides a base implementation for plugins by grabbing the console environment variables and assigning them to the `io` and `shell` member variables.
      Specified by:
        `pluginTo` in interface `GremlinPlugin`
      Throws:
        `IllegalEnvironmentException` - if `requireConsoleEnvironment` is set to true and if either the `io` and `shell` member variables are null.
        `PluginInitializationException` - if there is a failure in the plugin iniitalization process

    - #### afterPluginTo

          public abstract void afterPluginTo(PluginAcceptor pluginAcceptor)
                                      throws IllegalEnvironmentException,
                                             PluginInitializationException

      Deprecated.
      Called after the `pluginTo(PluginAcceptor)` method is executed which sets the `io` and `shell` member variables.
      Throws:
        `IllegalEnvironmentException`
        `PluginInitializationException`

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