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 simpleSession
implementation 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 SessionTask
onlySessionTask
-
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 aSingleTaskSession
that has the task to execute supplied on construction.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
isAcceptingTasks()
TheSingleWorker
can 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
.void
run()
void
sendTimeoutResponseForUncommencedTask()
Respond to the client with the specific timeout response for this Session implementation.boolean
submitTask(SessionTask sessionTask)
This implementation only take a singleSessionTask
on construction - no additional tasks can be submitted.String
toString()
-
Methods inherited from class org.apache.tinkerpop.gremlin.server.handler.AbstractSession
cancel, close, closeTransaction, closeTransaction, closeTransactionSafely, closeTransactionSafely, determineIfTemporaryException, 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 aSingleTaskSession
that has the task to execute supplied on construction.
-
-
Method Detail
-
isAcceptingTasks
public boolean isAcceptingTasks()
TheSingleWorker
can 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:AbstractSession
Respond 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:
sendTimeoutResponseForUncommencedTask
in classAbstractSession
-
submitTask
public boolean submitTask(SessionTask sessionTask) throws RejectedExecutionException
This implementation only take a singleSessionTask
on construction - no additional tasks can be submitted.- Throws:
RejectedExecutionException
- if the task cannot be queued
-
run
public void run()
-
-