Interface AsyncStateReporter<DataType>

Type Parameters:
DataType - the type of the data which is being retrieved by the AsyncDataLink reporting its state.

public interface AsyncStateReporter<DataType>
Defines the listener which will be notified periodically by the AsyncDataLink created by the AsyncLinks.createStateReporterLink method.

Thread safety

Implementations of this interface do not need to be safe to be called by multiple threads concurrently. The AsyncDataLink notifying the method of this interface does not call the method concurrently.

Synchronization transparency

Implementations of the reportState method must be as quick as possible and it must not wait for external events or for other threads. Implementations of this interface in general are not required to be synchronization transparent.
See Also:
  • Method Details

    • reportState

      void reportState(AsyncDataLink<DataType> dataLink, AsyncDataListener<? super DataType> dataListener, AsyncDataController controller)
      The method to be called periodically to be notified of the state of the progress of the data retrieving process.

      This method is invoked until the data retrieving is finished (either due to completion, cancellation or an error). Note however, that this method may be invoked after the data retrieving is finished but should be stopped to be called not much after the data retrieving is finished.

      To actually query the state of progress of the data retrieving process, use the specified AsyncDataController.

      Parameters:
      dataLink - the AsyncDataLink which is providing the data whose state is being watched. This argument cannot be null.
      dataListener - the AsyncDataListener to be notified of the retrieved data. This argument cannot be null.
      controller - the AsyncDataController which can be used to retrieve the state of the data retrieving process. This argument cannot be null.