RESULT - type of the result.public abstract class ResultLongOperation<RESULT> extends LongOperation
| Constructor and Description |
|---|
ResultLongOperation(CockpitThreadContextCreator cockpitThreadContextCreator) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
execute()
asynchronous callback for your long operation code
|
protected abstract RESULT |
getResult()
Background operation which returns a result.
|
protected void |
onFinish()
Callback method which is executed in Ui thread after long operation finishes.
|
protected abstract void |
onResult(RESULT result)
Foreground operation which is called with result from background operation
getResult() |
activate, cancel, checkCancelled, deactivate, isCancelled, onCancel, onCleanup, onException, run, startpublic ResultLongOperation(CockpitThreadContextCreator cockpitThreadContextCreator)
cockpitThreadContextCreator - util used to copy ctx from ui thread to background thread.protected abstract RESULT getResult() throws InterruptedException
InterruptedExceptionprotected abstract void onResult(RESULT result)
getResult()result - result of the operation.protected void execute()
throws InterruptedException
LongOperationexecute in class LongOperationInterruptedException - if operation has been Interruptedprotected final void onFinish()
LongOperationonFinish in class LongOperationCopyright © 2018. All rights reserved.