Class RetryNTimesLoop


  • public class RetryNTimesLoop
    extends Object
    Retry loop inspired by the one implemented in the Apache Curator Client. Example usage:
     {@code
     final RetryNTimesLoop retryLoop = new RetryNTimesLoop(3);
     while (retryLoop.shouldContinue()) {
         try {
             node = client.get(resourceUri, selectors);
             break;
         } catch (WSManException e) {
             retryLoop.takeException(e);
         }
     }
     
    Author:
    jwhite
    • Constructor Detail

      • RetryNTimesLoop

        public RetryNTimesLoop​(int numberOfRetries)
    • Method Detail

      • shouldContinue

        public boolean shouldContinue()
      • takeException

        public void takeException​(org.opennms.core.wsman.exceptions.WSManException e)
                           throws org.opennms.core.wsman.exceptions.WSManException
        Throws:
        org.opennms.core.wsman.exceptions.WSManException