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
FieldsModifier and TypeFieldDescriptionprotected UiReportRunContextprotected Messagesprotected Notificationsprotected ReportRunnerprotected Reportprotected UiReportRunnerSupport -
Constructor Summary
ConstructorsConstructorDescriptionRunSingleReportBackgroundTask(long timeout, TimeUnit timeUnit, View<?> view, Report targetReport, ReportRunner runner, UiReportRunContext context) -
Method Summary
Modifier and TypeMethodDescriptionvoidcanceled()Called by the execution environment in UI thread if the task is canceled byBackgroundTaskHandler.cancel()invocation.voiddone(ReportOutputDocument document) Called by the execution environment in UI thread when the task is completed.booleanCalled 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 booleanshowErrorNotification(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:BackgroundTaskMain 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:
runin 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:BackgroundTaskCalled by the execution environment in UI thread if the taskBackgroundTask.run(TaskLifeCycle)method raised an exception.- Overrides:
handleExceptionin 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:BackgroundTaskCalled by the execution environment in UI thread when the task is completed.- Overrides:
donein classBackgroundTask<Integer,ReportOutputDocument> - Parameters:
document- result of execution returned byBackgroundTask.run(TaskLifeCycle)method
-
canceled
public void canceled()Description copied from class:BackgroundTaskCalled 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:
canceledin classBackgroundTask<Integer,ReportOutputDocument>
-