Interface IMonitor

All Known Implementing Classes:
NullMonitor

public interface IMonitor
Interface for monitoring progress and cancellation of long-running operations. Provides support for work progress tracking, cancellation state management, and hierarchical monitoring through sub-monitors.
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    Checks if progress monitor has been cancelled.
    Creates a sub-monitor for tracking a portion of this monitor's work.
    boolean
    Returns whether this monitor has been cancelled.
    void
    setCancelled(boolean cancelled)
    Sets the cancellation state of this monitor.
    void
    Sets the name of the current task being monitored.
    void
    setWorkRemaining(int size)
    Sets the number of work units remaining for this monitor.
    void
    worked(int i)
    Notifies that a given number of work units have been completed.
  • Method Details

    • setCancelled

      void setCancelled(boolean cancelled)
      Sets the cancellation state of this monitor.
      Parameters:
      cancelled - true to cancel the operation, false otherwise
    • isCancelled

      boolean isCancelled()
      Returns whether this monitor has been cancelled.
      Returns:
      true if the operation has been cancelled, false otherwise
    • worked

      void worked(int i)
      Notifies that a given number of work units have been completed.
      Parameters:
      i - the number of work units completed
    • createSubMonitor

      IMonitor createSubMonitor()
      Creates a sub-monitor for tracking a portion of this monitor's work.
      Returns:
      a new sub-monitor instance
    • setWorkRemaining

      void setWorkRemaining(int size)
      Sets the number of work units remaining for this monitor.
      Parameters:
      size - the number of work units remaining
    • setTaskName

      void setTaskName(String name)
      Sets the name of the current task being monitored.
      Parameters:
      name - the task name
    • checkCancelled

      static void checkCancelled(IMonitor monitor) throws InterruptedException
      Checks if progress monitor has been cancelled.
      Parameters:
      monitor - the progress monitor to check
      Throws:
      InterruptedException - if monitor is cancelled