public class ClientCommandTask<C extends ClientContext> extends AbstractSwingTask<C> implements ClientObject<C>
childTaskRef, isTestMode, monitorController, resultRef, stateFlag
Constructor and Description |
---|
ClientCommandTask(C clientCtx,
ClientCommand cmd) |
Modifier and Type | Method and Description |
---|---|
void |
cancel()
This is special: Because the command may be queued but not running yet
it will never react after a cancel neither will it ever run.
|
protected void |
doneTaskFinished()
Ensure it is removed from the running commands list after execution
|
protected void |
doneTaskStarted(TaskEvent e)
Enforces a repaint of the list in order to render the just started command as running
|
void |
executeAsync()
Must be overridden to perform the async part.
|
ClientCommand |
getClientCommand() |
C |
getClientContext()
Returns the the client runtime environment
|
java.lang.String |
getCommandId() |
java.awt.Color |
getRenderColor()
Overridden to render queued commands in gray
|
javax.swing.Icon |
getRenderIcon() |
DumpString |
toDumpString(DumpString s)
This method allows subclasses to add values to the existing DumpString of the superclass.
|
ToString |
toString(ToString s)
This method allows subclasses to add values to the existing ToString of the superclass.
|
addMonitor, addTaskListener, awaitEventsDone, doneChildFinished, doneChildStarted, doneTaskCancelled, doneTaskFailed, doneTaskFinished, doneTaskProceeded, doneTaskStateChanged, doneTaskSucceeded, getActionCancel, getRenderText, getSwingTaskMonitor, isRegisterInTaskList, removeTaskListener, showError, showError, showError, showInfo, showInfo, showWarning, showWarning
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, wasSucceeded
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, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
checkCancelled, checkForErrorAndRethrow, executeSubTask, getName, getResult, getRunStateFlag, getTaskId, getType, handleCancellation, handleFailure, isCancellable, setCancellable, setName, setResult, setRunStateFlag, sleepChecked
getApplicationContext
execute
clearMonitors, getMonitorCount, getMonitors, hasMonitor, removeMonitor
getLogChannel, isLogDebug, isLogVerbose, logDebug, logDump, logError, logError, logFatal, logInfo, logVerbose, logWarning, setLogChannel
wasCancelled
getTaskId
toDumpString, toString
public ClientCommandTask(C clientCtx, ClientCommand cmd)
public final C getClientContext()
ClientObject
getClientContext
in interface ClientObject<C extends ClientContext>
public java.lang.String getCommandId()
public ClientCommand getClientCommand()
public 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 cancel()
cancel
in interface LocalCancellableTask
cancel
in class AbstractAsyncTask<C extends ClientContext>
protected void doneTaskStarted(TaskEvent e)
doneTaskStarted
in class AbstractSwingTask<C extends ClientContext>
protected void doneTaskFinished()
public javax.swing.Icon getRenderIcon()
getRenderIcon
in interface Renderable
getRenderIcon
in class AbstractSwingTask<C extends ClientContext>
public java.awt.Color getRenderColor()
getRenderColor
in interface Renderable
getRenderColor
in class AbstractSwingTask<C extends ClientContext>
public ToString toString(ToString s)
Dumpable
toString
in interface Dumpable
toString
in class AbstractAsyncTask<C extends ClientContext>
public DumpString toDumpString(DumpString s)
Dumpable
toDumpString
in interface Dumpable
toDumpString
in class DumpableObject
Copyright © 2014 EsprIT-Systems. All Rights Reserved.