Interface Progress

  • All Known Implementing Classes:
    DefaultProgress

    public interface Progress
    The Progress allows a mojo to report its current state and check if the user has requested cancellation.
    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      boolean isCancelRequested()
      This method should be used to check if the user has requested to finish the current work and break out early.
      void setRemaining​(int work)
      Notifies the remaining amount of work that will be reported
      void startTask​(java.lang.String task, int work)
      Reports that the mojo has started the given task with the given amount of work.
      default void worked()
      Reports one unit of work to be processed
      void worked​(int work)
      Reports a given amount of work was processed
    • Method Detail

      • startTask

        void startTask​(java.lang.String task,
                       int work)
        Reports that the mojo has started the given task with the given amount of work.
        Parameters:
        task -
        work - the amount of work that the mojo plan to report, if a value <= 0 is given the amount of work is assumed to be unknown.
      • worked

        void worked​(int work)
        Reports a given amount of work was processed
        Parameters:
        work -
      • worked

        default void worked()
        Reports one unit of work to be processed
      • setRemaining

        void setRemaining​(int work)
        Notifies the remaining amount of work that will be reported
        Parameters:
        work -
      • isCancelRequested

        boolean isCancelRequested()
        This method should be used to check if the user has requested to finish the current work and break out early.
        Returns:
        true if a cancel request is currently pending.