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 FailurePolicyConfig
exceptionsChecked, failureConditionsFields inherited from class 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, elsenullif a fallback stage function was configured instead.Returns the fallback stage function, elsenullif a fallback function was configured instead.booleanisAsync()Returns whether the Fallback is configured to handle execution results asynchronously, separate from execution.Methods inherited from class FailurePolicyConfig
getFailureConditions, isExceptionsCheckedMethods inherited from class 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, elsenullif a fallback stage function was configured instead.- See Also:
-
getFallbackStage
Returns the fallback stage function, elsenullif 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:
-