Interface ProgressListener


public interface ProgressListener
Receives the progress events of an event-capable Chilkat object during its long-running methods. Every method has a default implementation, so a listener overrides only what it needs; the onAbortCheck / onPercentDone / onProgressInfo methods of the event-capable classes install a lambda for a single callback.

Callbacks run on the thread that called the Chilkat method, inside that call. A method of the same object must not be called from inside its callback (it throws IllegalStateException); property accessors (such as setAbortCurrent(true)) and other objects are fine. An exception thrown by a callback aborts the running method and is rethrown from it.

  • Method Summary

    Modifier and Type
    Method
    Description
    default boolean
    Called periodically (every HeartbeatMs milliseconds on the classes that have that property) during a long-running method.
    default boolean
    percentDone​(int pctDone)
    Called as a long-running method progresses, where the library can measure progress.
    default void
    progressInfo​(String name, String value)
    Called with a name/value pair of progress information as a long-running method proceeds.
  • Method Details

    • abortCheck

      default boolean abortCheck()
      Called periodically (every HeartbeatMs milliseconds on the classes that have that property) during a long-running method.
      Returns:
      true to abort the running method
    • percentDone

      default boolean percentDone​(int pctDone)
      Called as a long-running method progresses, where the library can measure progress.
      Parameters:
      pctDone - the completion percentage, 0..100
      Returns:
      true to abort the running method
    • progressInfo

      default void progressInfo​(String name, String value)
      Called with a name/value pair of progress information as a long-running method proceeds.
      Parameters:
      name - the name of the item, such as "Status"
      value - its value