public final class AgentExecutorTask extends AbstractRemoteTask<ServerContext>
AgentWatchDogTask in order to detect an execution timeout.
The latter task is responsible for finalization of the agent.childTaskRef, isTestMode, monitorController, resultRef, stateFlag| Constructor and Description |
|---|
AgentExecutorTask(ServerContext serverCtx,
AsyncAgent<ClientContext,ServerContext> agent) |
| Modifier and Type | Method and Description |
|---|---|
void |
cancel(SessionId killerSessId)
Cancels the running task and stores the
SessionId of the killer. |
protected RemoteTaskId |
createTaskId()
Overridden to 'abuse' the AgentId as TaskId.
|
protected TaskMonitor |
createTaskMonitor()
Has got a special Monitor that only reports the main task events.
|
protected void |
doOnCancel()
This method is called after having detected cancellation.
|
protected void |
doOnFailure(java.lang.Exception error)
Is called when the task failed.
|
boolean |
equals(java.lang.Object obj) |
void |
executeAsync()
Must be overridden to perform the async part.
|
AsyncAgent |
getAgent() |
AgentId |
getAgentId() |
int |
hashCode() |
ToString |
toString(ToString s)
This method allows subclasses to add values to the existing ToString of the superclass.
|
addMonitor, createRunStateFlag, getKillerSessionId, getOwnerSessionId, getRunStateFlag, getSessionId, getTaskId, setSessionId, submit, submitexecuteSubTask, getServerContextawaitFinished, awaitFinished, awaitStarted, cancel, deregisterTask, doOnFinish, doOnStart, doOnSuccess, executeChildTask, executeChildTask, getCurrentFuture, getMaxChildTasks, getPriority, getProcessingDuration, getStartTime, getStopWatch, handleFinish, handleStart, handleSuccess, isRegisterForCancel, isRunning, notifyProceeded, registerTask, releaseStart, run, setCurrentFuture, setMaxChildTasks, setPriority, setRegisterForCancel, setReleaseTimeout, submitInternal, wasSucceededcheckCancelled, checkForErrorAndRethrow, clearMonitors, execute, executeSubTask, getError, getMaxProgressSteps, getMonitorCount, getMonitors, getName, getProgressStepCount, getResult, getType, handleCancellation, handleFailure, hasError, hasMonitor, isCancellable, registerTaskStateChange, removeMonitor, resetProgress, setCancellable, setLogLevel, setMaxProgressSteps, setMonitor, setName, setName, setResult, setRunStateFlag, setTaskId, setType, shouldFireMonitor, sleepChecked, wasCancelledgetApplicationContext, getLogChannel, isLogDebug, isLogVerbose, logDebug, logDump, logError, logError, logFatal, logInfo, logVerbose, logWarning, setLogChannelconfigureDumpHeadlineLength, configureDumpMaxElementsPrinted, copyDumpStringValues, copyToStringValues, createDumpHeader, toDumpString, toDumpString, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitawaitFinished, awaitFinished, awaitStarted, executeChildTask, executeChildTask, getError, getProcessingDuration, hasError, isRegisterForCancel, isRunning, releaseStart, setName, setReleaseTimeoutcheckCancelled, checkForErrorAndRethrow, executeSubTask, getName, getResult, getType, handleCancellation, handleFailure, isCancellable, notifyProceeded, setCancellable, setName, setResult, setRunStateFlag, sleepCheckedgetApplicationContextexecuteclearMonitors, getMonitorCount, getMonitors, hasMonitor, removeMonitorgetLogChannel, isLogDebug, isLogVerbose, logDebug, logDump, logError, logError, logFatal, logInfo, logVerbose, logWarning, setLogChannelcancelwasCancelledtoDumpString, toDumpString, toStringgetServerContextpublic AgentExecutorTask(ServerContext serverCtx, AsyncAgent<ClientContext,ServerContext> agent)
protected final TaskMonitor createTaskMonitor()
createTaskMonitor in class AbstractRemoteTask<ServerContext>protected final RemoteTaskId createTaskId()
createTaskId in class AbstractRemoteTask<ServerContext>public final AsyncAgent getAgent()
public final AgentId getAgentId()
public final void executeAsync()
throws java.lang.Exception
AbstractAsyncTaskAbstractAsyncTask.notifyProceeded(Object, int, int, String) in order to notify
about task progress. Note: the running task should periodically call
AbstractAsyncExecutable.checkCancelled() in order to detect cancellation.executeAsync in interface AsyncExecutable<ServerContext>executeAsync in class AbstractAsyncTask<ServerContext>java.lang.Exceptionfor synchronous executionprotected final void doOnCancel()
AbstractAsyncExecutabledoOnCancel in class AbstractAsyncExecutable<ServerContext>protected final void doOnFailure(java.lang.Exception error)
AbstractAsyncExecutabledoOnFailure in class AbstractAsyncExecutable<ServerContext>public final void cancel(SessionId killerSessId)
RemoteCancellableTaskSessionId of the killer. Note that this call puts the
task in a CANCEL_REQUESTED state. The task itself needs to detect this and perform any action
needed for canceling itself - after all it puts itself in the cancelled state and
terminates. The method CancellableTask.wasCancelled() returns true once a cancel was requested.cancel in interface RemoteCancellableTaskcancel in class AbstractRemoteTask<ServerContext>public final boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic final int hashCode()
hashCode in class java.lang.Objectpublic ToString toString(ToString s)
DumpabletoString in interface DumpabletoString in class AbstractAsyncTask<ServerContext>Copyright © 2014 EsprIT-Systems. All Rights Reserved.