private ServiceLoader<GremlinScriptEngineFactory> getServiceLoader(final ClassLoader loader) {
        if (loader != null) {
            return ServiceLoader.load(GremlinScriptEngineFactory.class, loader);
        } else {
            return ServiceLoader.loadInstalled(GremlinScriptEngineFactory.class);
        }
    }
Registers a {@link GremlinScriptEngineFactory} to handle an extension. Overrides any such association found
using the discovery mechanism.

@param extension The extension type to be associated with the {@link GremlinScriptEngineFactory}
@param factory The class to associate with the given extension.
@throws NullPointerException if any of the parameters is null.
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/jsr223/DefaultGremlinScriptEngineManager.java