Class Retrier

java.lang.Object
hudson.scm.api.Retrier

public class Retrier extends Object
This class is implemented to handle an exception o reaching maximum number of retries
  • Field Details

  • Constructor Details

    • Retrier

      public Retrier(int argMaxRetries, long argTimeToWaitMS)
    • Retrier

      public Retrier()
  • Method Details

    • shouldRetry

      public boolean shouldRetry()
      Returns true if a retry can be attempted.
      Returns:
      true if retries attempts remain else false
    • waitUntilNextTry

      public void waitUntilNextTry()
      Waits for timeToWaitMS. Ignores any interrupted exception
    • exceptionOccurred

      public void exceptionOccurred() throws InterruptedException
      Call when an exception has occurred in the block. If the retry limit is exceeded, throws an exception. Else waits for the specified time.
      Throws:
      Exception
      InterruptedException