public class Retrier extends Object
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_MAX_RETRIES
Default max number of attempts to make in performing a Retriable action
|
static int |
DEFAULT_WAIT_BETWEEN_RETRIES |
static int |
DEFAULT_WAIT_MULTIPLIER |
Constructor and Description |
---|
Retrier() |
Retrier(int maxRetries) |
Retrier(int maxRetries,
int waitBetweenRetries,
int waitBetweenRetriesMultiplier) |
Modifier and Type | Method and Description |
---|---|
<T> T |
execute(Retriable retriable)
Executes the action of a Retriable, and retries on error.
|
<T> T |
execute(Retriable retriable,
ExceptionHandler exceptionHandler)
Executes the action of a Retriable, and retries on error.
|
public static final int DEFAULT_MAX_RETRIES
public static final int DEFAULT_WAIT_BETWEEN_RETRIES
public static final int DEFAULT_WAIT_MULTIPLIER
public Retrier()
public Retrier(int maxRetries)
maxRetries
- public Retrier(int maxRetries, int waitBetweenRetries, int waitBetweenRetriesMultiplier)
maxRetries
- waitBetweenRetries
- waitBetweenRetriesMultiplier
- public <T> T execute(Retriable retriable) throws Exception
retriable
- Exception
public <T> T execute(Retriable retriable, ExceptionHandler exceptionHandler) throws Exception
retriable
- exceptionHandler
- for customing handling of exceptions - especially with respect
to customized logging.Exception
Copyright © 2009–2016 DuraSpace. All rights reserved.