public class SingleTaskSession extends AbstractSession
Session
implementation that accepts one request, processes it and exits.AbstractSession.CloseReason
Modifier and Type | Field and Description |
---|---|
protected SessionTask |
onlySessionTask |
aliasesUsedBySession, closeReason, graphManager, maintainStateAfterException, sessions, sessionThread
evalOpTimer, traversalOpTimer
Constructor and Description |
---|
SingleTaskSession(SessionTask onlySessionTask,
String sessionId,
ConcurrentMap<String,Session> sessions)
Constructs a
SingleTaskSession that has the task to execute supplied on construction. |
Modifier and Type | Method and Description |
---|---|
boolean |
isAcceptingTasks()
The
SingleWorker 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 return false . |
void |
run() |
boolean |
submitTask(SessionTask sessionTask)
This implementation only take a single
SessionTask on construction - no additional tasks can be
submitted. |
String |
toString() |
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
protected final SessionTask onlySessionTask
public SingleTaskSession(SessionTask onlySessionTask, String sessionId, ConcurrentMap<String,Session> sessions)
SingleTaskSession
that has the task to execute supplied on construction.public boolean isAcceptingTasks()
SingleWorker
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 return false
.public boolean submitTask(SessionTask sessionTask) throws RejectedExecutionException
SessionTask
on construction - no additional tasks can be
submitted.RejectedExecutionException
- if the task cannot be queuedpublic void run()
Copyright © 2013–2021 Apache Software Foundation. All rights reserved.