Class RetryNTimesLoop


  • public class RetryNTimesLoop
    extends java.lang.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 Summary

      Constructors 
      Constructor Description
      RetryNTimesLoop​(int numberOfRetries)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean shouldContinue()  
      void takeException​(org.opennms.core.wsman.exceptions.WSManException e)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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