Package org.opennms.core.wsman.utils
Class RetryNTimesLoop
- java.lang.Object
-
- org.opennms.core.wsman.utils.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)
-