Class SingleTaskSession
- java.lang.Object
-
- org.apache.tinkerpop.gremlin.server.handler.AbstractSession
-
- org.apache.tinkerpop.gremlin.server.handler.SingleTaskSession
-
- All Implemented Interfaces:
AutoCloseable,Runnable,Session
public class SingleTaskSession extends AbstractSession
A simpleSessionimplementation that accepts one request, processes it and exits.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.tinkerpop.gremlin.server.handler.AbstractSession
AbstractSession.CloseReason
-
-
Field Summary
Fields Modifier and Type Field Description protected SessionTaskonlySessionTask-
Fields inherited from class org.apache.tinkerpop.gremlin.server.handler.AbstractSession
aliasesUsedBySession, closeReason, graphManager, maintainStateAfterException, sessions, sessionTaskStarted, sessionThread
-
Fields inherited from interface org.apache.tinkerpop.gremlin.server.handler.Session
evalOpTimer, traversalOpTimer
-
-
Constructor Summary
Constructors Constructor Description SingleTaskSession(SessionTask onlySessionTask, String sessionId, ConcurrentMap<String,Session> sessions)Constructs aSingleTaskSessionthat has the task to execute supplied on construction.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanisAcceptingTasks()TheSingleWorkercan only process one request so the initial construction of it already has the request in it and no more can be added, therefore this method always returnfalse.voidrun()voidsendTimeoutResponseForUncommencedTask()Respond to the client with the specific timeout response for this Session implementation.booleansubmitTask(SessionTask sessionTask)This implementation only take a singleSessionTaskon construction - no additional tasks can be submitted.StringtoString()-
Methods inherited from class org.apache.tinkerpop.gremlin.server.handler.AbstractSession
cancel, close, closeTransaction, closeTransaction, closeTransactionSafely, closeTransactionSafely, determineIfSpecialException, fromBytecode, fromScript, generateResponseMetaData, generateStatusAttributes, getActualTimeoutLengthWhenClosed, getCloseReason, getScriptEngine, getSessionId, getWorkerBindings, handleException, handleGraphOperation, handleIterator, isBoundTo, isTransactionManaged, iterateComplete, makeFrame, mergeBindingsFromRequest, process, setSessionCancelFuture, setSessionFuture, startTransaction, triggerTimeout
-
-
-
-
Field Detail
-
onlySessionTask
protected final SessionTask onlySessionTask
-
-
Constructor Detail
-
SingleTaskSession
public SingleTaskSession(SessionTask onlySessionTask, String sessionId, ConcurrentMap<String,Session> sessions)
Constructs aSingleTaskSessionthat has the task to execute supplied on construction.
-
-
Method Detail
-
isAcceptingTasks
public boolean isAcceptingTasks()
TheSingleWorkercan only process one request so the initial construction of it already has the request in it and no more can be added, therefore this method always returnfalse.
-
sendTimeoutResponseForUncommencedTask
public void sendTimeoutResponseForUncommencedTask()
Description copied from class:AbstractSessionRespond to the client with the specific timeout response for this Session implementation. This is for situations where the Session hasn't started running.- Specified by:
sendTimeoutResponseForUncommencedTaskin classAbstractSession
-
submitTask
public boolean submitTask(SessionTask sessionTask) throws RejectedExecutionException
This implementation only take a singleSessionTaskon construction - no additional tasks can be submitted.- Throws:
RejectedExecutionException- if the task cannot be queued
-
run
public void run()
-
-