protected class MBeanOperationResultScreen.OperationBackgroundTask extends BackgroundTask<java.lang.Long,java.lang.Object>
BackgroundTask.ProgressListener<T,V>, BackgroundTask.ProgressListenerAdapter<T,V>
Modifier and Type | Field and Description |
---|---|
protected Label<java.lang.String> |
label |
protected java.lang.String |
resultMessage |
Modifier | Constructor and Description |
---|---|
protected |
OperationBackgroundTask(long timeoutSeconds,
Screen screen) |
Modifier and Type | Method and Description |
---|---|
void |
done(java.lang.Object res)
Called by the execution environment in UI thread when the task is completed.
|
boolean |
handleException(java.lang.Exception ex)
Called by the execution environment in UI thread if the task
BackgroundTask.run(TaskLifeCycle) method raised an
exception. |
boolean |
handleTimeoutException()
Called by the execution environment in UI thread if the task timeout is exceeded.
|
java.lang.Object |
run(TaskLifeCycle<java.lang.Long> taskLifeCycle)
Main method that performs a task.
|
protected void |
showResult() |
addProgressListener, canceled, getOwnerFrame, getOwnerScreen, getParams, getProgressListeners, getTimeoutMilliseconds, getTimeoutSeconds, progress, removeProgressListener
protected Label<java.lang.String> label
protected java.lang.String resultMessage
protected OperationBackgroundTask(long timeoutSeconds, Screen screen)
public java.lang.Object run(TaskLifeCycle<java.lang.Long> taskLifeCycle) throws java.lang.Exception
BackgroundTask
TaskLifeCycle.isInterrupted()
and return if it is trueInterruptedException
- return from the method or don't catch it at allrun
in class BackgroundTask<java.lang.Long,java.lang.Object>
taskLifeCycle
- lifecycle object that allows the main method to interact with the execution environmentjava.lang.Exception
- exception in working threadpublic void done(java.lang.Object res)
BackgroundTask
done
in class BackgroundTask<java.lang.Long,java.lang.Object>
res
- result of execution returned by BackgroundTask.run(TaskLifeCycle)
methodpublic boolean handleException(java.lang.Exception ex)
BackgroundTask
BackgroundTask.run(TaskLifeCycle)
method raised an
exception.handleException
in class BackgroundTask<java.lang.Long,java.lang.Object>
ex
- exceptionpublic boolean handleTimeoutException()
BackgroundTask
handleTimeoutException
in class BackgroundTask<java.lang.Long,java.lang.Object>
protected void showResult()