Interface UiReporter
BackgroundTask or
execute other task on the AWT Event Dispatch Thread.
Thread safety
Implementations of this interface are required to be safe to be used by multiple threads concurrently. Note however, that they can only be meaningfully used while the associated background task is being executed.Synchronization transparency
Methods of this interface are not required to be synchronization transparent but they are non-blocking relatively quick methods.- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionvoidupdateProgress(Runnable task) Executes a task on the AWT Event Dispatch Thread which is intended to be used to display the current progress of the associated background task.voidExecutes a generic task on the AWT Event Dispatch Thread.
-
Method Details
-
updateProgress
Executes a task on the AWT Event Dispatch Thread which is intended to be used to display the current progress of the associated background task.The submitted task will be executed in the context of the access token associated with the background task. If the access token has been released, the submitted task will not be executed but will be silently discarded.
Calling this method may cause tasks submitted by this method previously to be discarded. This allows the task to update its progress frequently and not worry about flooding the event queue.
Tasks submitted by this method and the
writeDatamethod are executed in the same order as they were submitted.- Parameters:
task- the task to be executed on the AWT Event Dispatch Thread. This argument cannot benull.
-
writeData
Executes a generic task on the AWT Event Dispatch Thread. This method is intended to be used to write intermediate data created by the associated background task.The submitted task will be executed in the context of the access token associated with the background task. If the access token has been released, the submitted task will not be executed but will be silently discarded.
This method differs from the
updateProgressmethod only by not being discarded due to tasks submitted later.Tasks submitted by this method and the
updateProgressmethod are executed in the same order as they were submitted.- Parameters:
task- the task to be executed on the AWT Event Dispatch Thread. This argument cannot benull.
-