Package hudson.scm.api
Class Retrier
java.lang.Object
hudson.scm.api.Retrier
This class is implemented to handle an exception o reaching maximum number of retries
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidCall when an exception has occurred in the block.booleanReturns true if a retry can be attempted.voidWaits for timeToWaitMS.
-
Field Details
-
MAX_RETRIES
public static final int MAX_RETRIES- See Also:
-
TIME_TO_WAIT_MS
public static final long TIME_TO_WAIT_MS- See Also:
-
-
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
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:
ExceptionInterruptedException
-