@Override
    public GremlinScriptEngine getEngineByName(final String shortName) {
        if (null == shortName) throw new NullPointerException();
        //look for registered name first
        Object obj;
        if (null != (obj = nameAssociations.get(shortName))) {
            final GremlinScriptEngineFactory spi = (GremlinScriptEngineFactory) obj;
            try {
                return createGremlinScriptEngine(spi);
            } catch (Exception exp) {
                logger.error(String.format("Could not create GremlinScriptEngine for %s", shortName), exp);
            }
        }

        for (GremlinScriptEngineFactory spi : engineSpis) {
            List<String> names = null;
            try {
                names = spi.getNames();
            } catch (Exception exp) {
                logger.error("Could not get GremlinScriptEngine names", exp);
            }

            if (names != null) {
                for (String name : names) {
                    if (shortName.equals(name)) {
                        try {
                            return createGremlinScriptEngine(spi);
                        } catch (Exception exp) {
                            logger.error(String.format("Could not create GremlinScriptEngine for %s", shortName), exp);
                        }
                    }
                }
            }
        }

        return null;
    }
Looks up and creates a {@link GremlinScriptEngine} for a given name. The algorithm first searches for a
{@link GremlinScriptEngineFactory} that has been registered as a handler for the specified name using the
{@link #registerEngineExtension(String, GremlinScriptEngineFactory)} method. If one is not found, it searches
the set of {@code GremlinScriptEngineFactory} instances stored by the constructor for one with the specified
name.  If a {@code ScriptEngineFactory} is found by either method, it is used to create instance of
{@link GremlinScriptEngine}.

@param shortName The short name of the {@link GremlinScriptEngine} implementation returned by the
{@link GremlinScriptEngineFactory#getNames} method.
@return A {@link GremlinScriptEngine} created by the factory located in the search.  Returns {@code null}
if no such factory was found.  The global scope of this manager is applied to the newly created
{@link GremlinScriptEngine}
@throws NullPointerException if shortName is {@code null}.
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/jsr223/DefaultGremlinScriptEngineManager.java