Interface UiReporter


public interface UiReporter
Defines an interface to report the progress of a 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 Type
    Method
    Description
    void
    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.
    void
    Executes a generic task on the AWT Event Dispatch Thread.
  • Method Details

    • updateProgress

      void updateProgress(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.

      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 writeData method 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 be null.
    • writeData

      void writeData(Runnable task)
      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 updateProgress method only by not being discarded due to tasks submitted later.

      Tasks submitted by this method and the updateProgress method 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 be null.