public abstract class AbstractClientEDT<C extends ClientContext> extends AbstractClientTask<C> implements RemoteTaskEventReceiver<C>
RemoteTaskEvent
s received from there. It
finishes, when the remote task has finished. If this task is cancelled, then in fact the remote counterpart task is
cancelled first.childTaskRef, isTestMode, monitorController, resultRef, stateFlag
Constructor and Description |
---|
AbstractClientEDT(C ctx) |
AbstractClientEDT(C ctx,
LogChannel logCh) |
AbstractClientEDT(C ctx,
LogChannel logCh,
java.lang.String taskName,
TaskType taskType) |
AbstractClientEDT(C ctx,
java.lang.String taskName) |
AbstractClientEDT(C ctx,
java.lang.String taskName,
TaskType taskType) |
AbstractClientEDT(C ctx,
TaskType taskType) |
Modifier and Type | Method and Description |
---|---|
void |
cancel()
Cancels the remote counterpart task running on the server using a
RemoteTaskCancelAgent . |
void |
executeAsync()
Must be overridden to perform the async part.
|
RemoteTaskEventForwarder |
getEventForwarder() |
RemoteRunStateFlag |
getLastReceivedRemoteRunStateFlag() |
SessionId |
getOwnerSessionId()
Returns the originator sessionId or the connection sessionId if owner is not set
|
protected abstract RemoteTaskCreator |
getRemoteTaskCreator()
Creates the agent that is responsible for starting the remote task.
|
RemoteTaskId |
getRemoteTaskId()
Returns the
RemoteTaskId of the remotely running task as received within the RemoteTaskStartAgent
. |
boolean |
isForwardingEvents() |
void |
receivedTaskEvent(RemoteTaskEvent event)
Is called whenever this task has received a
RemoteTaskEvent from the remotely running task. |
void |
setEventForwarder(RemoteTaskEventForwarder eventForwarder)
Sets the forwarder for
RemoteTaskEvent s |
void |
setOwnerSessionId(SessionId ownerSessId)
Sets the originator sessionId
|
executeSubTask, getClientContext, getSessionId
awaitFinished, awaitFinished, awaitStarted, createTaskId, 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, submit, submit, submitInternal, toString, wasSucceeded
addMonitor, checkCancelled, checkForErrorAndRethrow, clearMonitors, createRunStateFlag, doOnCancel, doOnFailure, execute, executeSubTask, getError, getMaxProgressSteps, getMonitorCount, getMonitors, getName, getProgressStepCount, getResult, getRunStateFlag, getTaskId, getType, handleCancellation, handleFailure, hasError, hasMonitor, isCancellable, registerTaskStateChange, removeMonitor, resetProgress, setCancellable, setLogLevel, setMaxProgressSteps, setMonitor, setName, setName, setResult, setRunStateFlag, setTaskId, setType, shouldFireMonitor, sleepChecked, wasCancelled
getApplicationContext, getLogChannel, isLogDebug, isLogVerbose, logDebug, logDump, logError, logError, logFatal, logInfo, logVerbose, logWarning, setLogChannel
configureDumpHeadlineLength, configureDumpMaxElementsPrinted, copyDumpStringValues, copyToStringValues, createDumpHeader, toDumpString, toDumpString, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
awaitFinished, awaitFinished, awaitStarted, executeChildTask, executeChildTask, getError, getProcessingDuration, hasError, isRegisterForCancel, isRunning, releaseStart, setName, setReleaseTimeout, submit, submit
checkCancelled, checkForErrorAndRethrow, executeSubTask, getName, getResult, getRunStateFlag, getTaskId, getType, handleCancellation, handleFailure, isCancellable, notifyProceeded, setCancellable, setName, setResult, setRunStateFlag, sleepChecked
getApplicationContext
execute
addMonitor, clearMonitors, getMonitorCount, getMonitors, hasMonitor, removeMonitor
getLogChannel, isLogDebug, isLogVerbose, logDebug, logDump, logError, logError, logFatal, logInfo, logVerbose, logWarning, setLogChannel
wasCancelled
getTaskId
toDumpString, toDumpString, toString, toString
getClientContext
public AbstractClientEDT(C ctx)
public AbstractClientEDT(C ctx, java.lang.String taskName)
public AbstractClientEDT(C ctx, LogChannel logCh)
public AbstractClientEDT(C ctx, LogChannel logCh, java.lang.String taskName, TaskType taskType)
public void setEventForwarder(RemoteTaskEventForwarder eventForwarder)
RemoteTaskEvent
spublic RemoteTaskEventForwarder getEventForwarder()
public boolean isForwardingEvents()
public final void executeAsync() throws java.lang.Exception
AbstractAsyncTask
AbstractAsyncTask.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<C extends ClientContext>
executeAsync
in class AbstractAsyncTask<C extends ClientContext>
java.lang.Exception
for synchronous execution
public void setOwnerSessionId(SessionId ownerSessId)
public SessionId getOwnerSessionId()
public RemoteTaskId getRemoteTaskId()
RemoteTaskId
of the remotely running task as received within the RemoteTaskStartAgent
.public void cancel()
RemoteTaskCancelAgent
.cancel
in interface LocalCancellableTask
cancel
in class AbstractAsyncTask<C extends ClientContext>
protected abstract RemoteTaskCreator getRemoteTaskCreator()
public void receivedTaskEvent(RemoteTaskEvent event)
RemoteTaskEvent
from the remotely running task. Within this
method we may investigate the event type and perform an appropriate reaction. Note that any RuntimeException
thrown here will not break the event iteration.receivedTaskEvent
in interface RemoteTaskEventReceiver<C extends ClientContext>
public RemoteRunStateFlag getLastReceivedRemoteRunStateFlag()
Copyright © 2014 EsprIT-Systems. All Rights Reserved.