public enum RetryStrategy extends Enum<RetryStrategy> implements IRetryStrategy
Enum Constant and Description |
---|
CONSTANT_BACKOFF |
EXPONENTIAL_BACKOFF |
EXPONENTIAL_RANDOM_BACKOFF |
LINEAR_BACKOFF |
NO_BACKOFF |
Modifier and Type | Method and Description |
---|---|
long |
getRetryDelay(int retryCount,
long initialDelay)
Returns the amount of time to wait (in milliseconds) before retrying the operation.
|
protected abstract long |
getRetryDelayImpl(int retryCount,
long initialDelay) |
static RetryStrategy |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static RetryStrategy[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final RetryStrategy NO_BACKOFF
public static final RetryStrategy CONSTANT_BACKOFF
public static final RetryStrategy LINEAR_BACKOFF
public static final RetryStrategy EXPONENTIAL_BACKOFF
public static final RetryStrategy EXPONENTIAL_RANDOM_BACKOFF
public static RetryStrategy[] values()
for (RetryStrategy c : RetryStrategy.values()) System.out.println(c);
public static RetryStrategy valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic long getRetryDelay(int retryCount, long initialDelay)
IRetryStrategy
getRetryDelay
in interface IRetryStrategy
retryCount
- The number of retry attempts that have already been made starting with zero (0).initialDelay
- The amount of time (in milliseconds) to wait before the first retry attempt.initialDelay
if this is the first retry attempt.protected abstract long getRetryDelayImpl(int retryCount, long initialDelay)
Copyright (c) 2006-2024 North Concepts Inc. All Rights Reserved.