Class RunSingleReportBackgroundTask
java.lang.Object
io.jmix.flowui.backgroundtask.BackgroundTask<Integer,ReportOutputDocument>
io.jmix.reportsflowui.runner.impl.RunSingleReportBackgroundTask
-
Nested Class Summary
Nested classes/interfaces inherited from class io.jmix.flowui.backgroundtask.BackgroundTask
BackgroundTask.ProgressListener<T,
V>, BackgroundTask.ProgressListenerAdapter<T, V> -
Field Summary
Modifier and TypeFieldDescriptionprotected UiReportRunContext
protected Messages
protected Notifications
protected ReportRunner
protected Report
protected UiReportRunnerSupport
-
Constructor Summary
ConstructorDescriptionRunSingleReportBackgroundTask
(long timeout, TimeUnit timeUnit, View<?> view, Report targetReport, ReportRunner runner, UiReportRunContext context) -
Method Summary
Modifier and TypeMethodDescriptionvoid
canceled()
Called by the execution environment in UI thread if the task is canceled byBackgroundTaskHandler.cancel()
invocation.void
done
(ReportOutputDocument document) Called by the execution environment in UI thread when the task is completed.boolean
Called by the execution environment in UI thread if the taskBackgroundTask.run(TaskLifeCycle)
method raised an exception.run
(TaskLifeCycle<Integer> taskLifeCycle) Main method that performs a task.protected boolean
showErrorNotification
(String text) Methods inherited from class io.jmix.flowui.backgroundtask.BackgroundTask
addProgressListener, getOwnerView, getParams, getProgressListeners, getTimeoutMilliseconds, getTimeoutSeconds, handleTimeoutException, progress, removeProgressListener
-
Field Details
-
reportRunner
-
messages
-
notifications
-
uiReportRunnerSupport
-
targetReport
-
context
-
-
Constructor Details
-
RunSingleReportBackgroundTask
public RunSingleReportBackgroundTask(long timeout, TimeUnit timeUnit, View<?> view, Report targetReport, ReportRunner runner, UiReportRunContext context)
-
-
Method Details
-
run
Description copied from class:BackgroundTask
Main method that performs a task.
Called by the execution environment in a separate working thread.
Implementation of this method should support interruption:- In long loops check
TaskLifeCycle.isInterrupted()
and return if it is true - Don't swallow
InterruptedException
- return from the method or don't catch it at all
- Specified by:
run
in classBackgroundTask<Integer,
ReportOutputDocument> - Parameters:
taskLifeCycle
- lifecycle object that allows the main method to interact with the execution environment- Returns:
- task result
- In long loops check
-
handleException
Description copied from class:BackgroundTask
Called by the execution environment in UI thread if the taskBackgroundTask.run(TaskLifeCycle)
method raised an exception.- Overrides:
handleException
in classBackgroundTask<Integer,
ReportOutputDocument> - Parameters:
ex
- exception- Returns:
- true if this method implementation actually handles the exception. Used for chaining handlers.
-
showErrorNotification
-
done
Description copied from class:BackgroundTask
Called by the execution environment in UI thread when the task is completed.- Overrides:
done
in classBackgroundTask<Integer,
ReportOutputDocument> - Parameters:
document
- result of execution returned byBackgroundTask.run(TaskLifeCycle)
method
-
canceled
public void canceled()Description copied from class:BackgroundTask
Called by the execution environment in UI thread if the task is canceled byBackgroundTaskHandler.cancel()
invocation.
This method is not called in case of timeout expiration or owner view closing.- Overrides:
canceled
in classBackgroundTask<Integer,
ReportOutputDocument>
-