You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by sp...@apache.org on 2017/01/24 20:13:47 UTC
[2/3] tinkerpop git commit: Sessions were not constucting
GremlinExecutor with new plugin system CTR
Sessions were not constucting GremlinExecutor with new plugin system CTR
Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/d08a68f3
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/d08a68f3
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/d08a68f3
Branch: refs/heads/master
Commit: d08a68f32c4ad497b6dbbdad5ae916cb659ff019
Parents: 470c656
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Tue Jan 24 15:11:50 2017 -0500
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Tue Jan 24 15:11:50 2017 -0500
----------------------------------------------------------------------
.../gremlin/server/op/session/Session.java | 17 ++++++++++++-----
1 file changed, 12 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/d08a68f3/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/op/session/Session.java
----------------------------------------------------------------------
diff --git a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/op/session/Session.java b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/op/session/Session.java
index 8f4da66..9b16a3b 100644
--- a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/op/session/Session.java
+++ b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/op/session/Session.java
@@ -228,11 +228,18 @@ public class Session {
.scheduledExecutorService(scheduledExecutorService);
settings.scriptEngines.forEach((k, v) -> {
- // make sure that server related classes are available at init - not really necessary here because
- // lifecycle hooks are not executed per session, but there should be some consistency .... i guess
- v.imports.add(LifeCycleHook.class.getCanonicalName());
- v.imports.add(LifeCycleHook.Context.class.getCanonicalName());
- gremlinExecutorBuilder.addEngineSettings(k, v.imports, v.staticImports, v.scripts, v.config);
+ // use plugins if they are present and the old approach if not
+ if (v.plugins.isEmpty()) {
+ // make sure that server related classes are available at init - ultimately this body of code will be
+ // deleted when deprecation is removed
+ v.imports.add(LifeCycleHook.class.getCanonicalName());
+ v.imports.add(LifeCycleHook.Context.class.getCanonicalName());
+ gremlinExecutorBuilder.addEngineSettings(k, v.imports, v.staticImports, v.scripts, v.config);
+ } else {
+ // make sure that server related classes are available at init - new approach. the LifeCycleHook stuff
+ // will be added explicitly via configuration using GremlinServerGremlinModule in the yaml
+ gremlinExecutorBuilder.addPlugins(k, v.plugins);
+ }
});
return gremlinExecutorBuilder;