Package dev.failsafe
Class DelayablePolicyConfig<R>
- java.lang.Object
-
- dev.failsafe.PolicyConfig<R>
-
- dev.failsafe.FailurePolicyConfig<R>
-
- dev.failsafe.DelayablePolicyConfig<R>
-
- Type Parameters:
R
- result type
- Direct Known Subclasses:
CircuitBreakerConfig
,RetryPolicyConfig
public abstract class DelayablePolicyConfig<R> extends FailurePolicyConfig<R>
Configuration for policies that can delay between executions.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) java.time.Duration
delay
(package private) java.lang.Class<? extends java.lang.Throwable>
delayException
(package private) ContextualSupplier<R,java.time.Duration>
delayFn
(package private) R
delayResult
-
Fields inherited from class dev.failsafe.FailurePolicyConfig
exceptionsChecked, failureConditions
-
Fields inherited from class dev.failsafe.PolicyConfig
failureListener, successListener
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
DelayablePolicyConfig()
protected
DelayablePolicyConfig(DelayablePolicyConfig<R> config)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.time.Duration
getDelay()
Returns the delay until the next execution attempt can be performed.java.lang.Class<? extends java.lang.Throwable>
getDelayException()
Returns the Throwable that must be matched in order to delay using thegetDelayFn()
.ContextualSupplier<R,java.time.Duration>
getDelayFn()
Returns the function that determines the next delay before another execution can be performed.R
getDelayResult()
Returns the result that must be matched in order to delay using thegetDelayFn()
.-
Methods inherited from class dev.failsafe.FailurePolicyConfig
getFailureConditions, isExceptionsChecked
-
Methods inherited from class dev.failsafe.PolicyConfig
getFailureListener, getSuccessListener
-
-
-
-
Field Detail
-
delay
java.time.Duration delay
-
delayResult
R delayResult
-
delayException
java.lang.Class<? extends java.lang.Throwable> delayException
-
delayFn
ContextualSupplier<R,java.time.Duration> delayFn
-
-
Constructor Detail
-
DelayablePolicyConfig
protected DelayablePolicyConfig()
-
DelayablePolicyConfig
protected DelayablePolicyConfig(DelayablePolicyConfig<R> config)
-
-
Method Detail
-
getDelay
public java.time.Duration getDelay()
Returns the delay until the next execution attempt can be performed.
-
getDelayFn
public ContextualSupplier<R,java.time.Duration> getDelayFn()
Returns the function that determines the next delay before another execution can be performed.
-
getDelayException
public java.lang.Class<? extends java.lang.Throwable> getDelayException()
Returns the Throwable that must be matched in order to delay using thegetDelayFn()
.
-
getDelayResult
public R getDelayResult()
Returns the result that must be matched in order to delay using thegetDelayFn()
.
-
-