Package dev.failsafe.internal
Class FallbackImpl<R>
java.lang.Object
dev.failsafe.internal.FallbackImpl<R>
- Type Parameters:
R
- result type
- All Implemented Interfaces:
Fallback<R>
,Policy<R>
,FailurePolicy<R>
A
Fallback
implementation.- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected R
apply
(R result, Throwable exception, ExecutionContext<R> context) Returns the applied fallback result.protected CompletableFuture
<R> applyStage
(R result, Throwable exception, ExecutionContext<R> context) Returns a future applied fallback result.Returns theFallbackConfig
that the Fallback was built with.toExecutor
(int policyIndex) Returns aPolicyExecutor
capable of handling an execution for the Policy.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface dev.failsafe.spi.FailurePolicy
isFailure
-
Field Details
-
NONE
A fallback that will return null if execution fails. -
config
-
-
Constructor Details
-
FallbackImpl
-
-
Method Details
-
getConfig
Description copied from interface:Fallback
Returns theFallbackConfig
that the Fallback was built with. -
apply
Returns the applied fallback result.- Throws:
Throwable
-
applyStage
protected CompletableFuture<R> applyStage(R result, Throwable exception, ExecutionContext<R> context) throws Throwable Returns a future applied fallback result.- Throws:
Throwable
-
toExecutor
Description copied from interface:Policy
Returns aPolicyExecutor
capable of handling an execution for the Policy.- Specified by:
toExecutor
in interfacePolicy<R>
-