Package dev.failsafe
Class FallbackConfig<R>
java.lang.Object
dev.failsafe.PolicyConfig<R>
dev.failsafe.FailurePolicyConfig<R>
dev.failsafe.FallbackConfig<R>
- Type Parameters:
R
- result type
Configuration for a
Fallback
.
This class is threadsafe.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) boolean
(package private) EventListener
<ExecutionAttemptedEvent<R>> (package private) CheckedFunction
<ExecutionAttemptedEvent<R>, R> (package private) CheckedFunction
<ExecutionAttemptedEvent<R>, CompletableFuture<R>> Fields inherited from class dev.failsafe.FailurePolicyConfig
exceptionsChecked, failureConditions
Fields inherited from class dev.failsafe.PolicyConfig
failureListener, successListener
-
Constructor Summary
ConstructorsConstructorDescriptionFallbackConfig
(FallbackConfig<R> config) FallbackConfig
(CheckedFunction<ExecutionAttemptedEvent<R>, R> fallback, CheckedFunction<ExecutionAttemptedEvent<R>, CompletableFuture<R>> fallbackStage) -
Method Summary
Modifier and TypeMethodDescriptionReturns the failed attempt event listener.Returns the fallback function, elsenull
if a fallback stage function was configured instead.Returns the fallback stage function, elsenull
if a fallback function was configured instead.boolean
isAsync()
Returns whether the Fallback is configured to handle execution results asynchronously, separate from execution.Methods inherited from class dev.failsafe.FailurePolicyConfig
getFailureConditions, isExceptionsChecked
Methods inherited from class dev.failsafe.PolicyConfig
getFailureListener, getSuccessListener
-
Field Details
-
fallback
CheckedFunction<ExecutionAttemptedEvent<R>,R> fallback -
fallbackStage
CheckedFunction<ExecutionAttemptedEvent<R>,CompletableFuture<R>> fallbackStage -
async
boolean async -
failedAttemptListener
EventListener<ExecutionAttemptedEvent<R>> failedAttemptListener
-
-
Constructor Details
-
FallbackConfig
FallbackConfig() -
FallbackConfig
FallbackConfig(FallbackConfig<R> config) -
FallbackConfig
FallbackConfig(CheckedFunction<ExecutionAttemptedEvent<R>, R> fallback, CheckedFunction<ExecutionAttemptedEvent<R>, CompletableFuture<R>> fallbackStage)
-
-
Method Details
-
getFallback
Returns the fallback function, elsenull
if a fallback stage function was configured instead.- See Also:
-
getFallbackStage
Returns the fallback stage function, elsenull
if a fallback function was configured instead.- See Also:
-
isAsync
public boolean isAsync()Returns whether the Fallback is configured to handle execution results asynchronously, separate from execution.- See Also:
-
getFailedAttemptListener
Returns the failed attempt event listener.- See Also:
-