Package io.jmix.flowui.backgroundtask
Interface TaskExecutor<T,V>
public interface TaskExecutor<T,V>
-
Method Summary
Modifier and TypeMethodDescriptionbooleanCancels the execution and removes task formBackgroundTaskWatchDogand fromBackgroundTaskManager.Joins task thread to current and waits if task is not finished.getTask()voidhandleProgress(T... changes) Handles changes from working thread.booleanbooleanbooleanisDone()voidsetFinalizer(Runnable finalizer) Sets done handler for clear resources.voidExecutes background task.
-
Method Details
-
startExecution
void startExecution()Executes background task. -
cancelExecution
boolean cancelExecution()Cancels the execution and removes task formBackgroundTaskWatchDogand fromBackgroundTaskManager.- Returns:
trueif the canceling was successful
-
getResult
Joins task thread to current and waits if task is not finished.- Returns:
- result of the task
-
getTask
BackgroundTask<T,V> getTask()- Returns:
- the task
-
isCancelled
boolean isCancelled() -
isDone
boolean isDone() -
inProgress
boolean inProgress() -
setFinalizer
Sets done handler for clear resources.- Parameters:
finalizer- Runnable handler
-
getFinalizer
Runnable getFinalizer() -
handleProgress
Handles changes from working thread.- Parameters:
changes- Changes
-