net.netheos.pcsapi.models
Class RetryStrategy
java.lang.Object
net.netheos.pcsapi.models.RetryStrategy
public class RetryStrategy
- extends Object
Manages retriable requests and sets retry strategy: number of attempts and delay between attempts.
|
Constructor Summary |
RetryStrategy(int nbTriesMax,
long firstSleep_ms)
|
|
Method Summary |
|
invokeRetry(Callable<T> invoker)
Main method to be called by user of this class : calls Callable.call() until success, non retriable error
or max trials has been reached. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
RetryStrategy
public RetryStrategy(int nbTriesMax,
long firstSleep_ms)
invokeRetry
public <T> T invokeRetry(Callable<T> invoker)
throws CStorageException
- Main method to be called by user of this class : calls
Callable.call() until success, non retriable error
or max trials has been reached.
- Type Parameters:
T - The request result type- Parameters:
invoker - The request invoker which execute and validate the request
- Returns:
- The request result
- Throws:
CStorageException - Request execution error
Copyright © 2014. All Rights Reserved.