|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.tinkerpop.rexster.gremlin.GremlinSession
public class GremlinSession
A wrapper thread for a given gremlin instance. Webadmin spawns one of these threads for each client that uses the gremlin console.
Credit to Neo Technology (http://neotechnology.com/) for most of the code related to the Gremlin in Rexster. Specifically, this code was borrowed from https://github.com/neo4j/webadmin and re-purposed for Rexster's needs. Original author Jacob Hansson
Field Summary | |
---|---|
protected BlockingQueue<GremlinEvaluationJob> |
jobQueue
Commands waiting to be executed. |
protected Date |
lastTimeUsed
Keep track of the last time this was used. |
static int |
MAX_COMMANDS_WAITING
|
protected Thread |
runner
Mama thread. |
protected ScriptEngine |
scriptEngine
The gremlin evaluator instance beeing wrapped. |
protected boolean |
sepukko
Should I shut down? |
Constructor Summary | |
---|---|
GremlinSession(String graphName,
RexsterApplication ra)
|
Method Summary | |
---|---|
void |
die()
|
GremlinEvaluationJob |
evaluate(String script)
Take some gremlin script, evaluate it in the context of this gremlin session, and return the result. |
long |
getIdleTime()
Get the number of milliseconds this worker has been idle. |
protected Object |
performEvaluation(GremlinEvaluationJob job)
Internal evaluate implementation. |
void |
reset()
Destroy the internal gremlin evaluator and replace it with a clean slate. |
void |
run()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int MAX_COMMANDS_WAITING
protected Date lastTimeUsed
protected ScriptEngine scriptEngine
protected BlockingQueue<GremlinEvaluationJob> jobQueue
protected boolean sepukko
protected Thread runner
Constructor Detail |
---|
public GremlinSession(String graphName, RexsterApplication ra)
Method Detail |
---|
public void run()
run
in interface Runnable
public GremlinEvaluationJob evaluate(String script)
script
-
public void reset()
public long getIdleTime()
public void die()
protected Object performEvaluation(GremlinEvaluationJob job)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |