Uses of Class
dev.failsafe.spi.ExecutionResult
Packages that use ExecutionResult
Package
Description
APIs for performing failsafe executions.
The Failsafe Service Provider Interface (SPI).
-
Uses of ExecutionResult in dev.failsafe
Fields in dev.failsafe declared as ExecutionResultModifier and TypeFieldDescriptionprivate final ExecutionResult<R> ExecutionImpl.previousResult(package private) ExecutionResult<R> ExecutionImpl.resultFields in dev.failsafe with type parameters of type ExecutionResultModifier and TypeFieldDescription(package private) final BiConsumer<ExecutionResult<R>, ExecutionContext<R>> FailsafeExecutor.completionHandlerprivate Function<AsyncExecutionInternal<R>, CompletableFuture<ExecutionResult<R>>> AsyncExecutionImpl.outerFnprivate Function<SyncExecutionInternal<R>, ExecutionResult<R>> SyncExecutionImpl.outerFnMethods in dev.failsafe that return ExecutionResultModifier and TypeMethodDescriptionExecutionImpl.getResult()(package private) ExecutionResult<R> ExecutionImpl.postExecute(ExecutionResult<R> result) Externally called.(package private) ExecutionResult<R> SyncExecutionImpl.postExecute(ExecutionResult<R> result) Methods in dev.failsafe that return types with arguments of type ExecutionResultModifier and TypeMethodDescription(package private) static <R> Function<SyncExecutionImpl<R>, ExecutionResult<R>> Functions.get(ContextualSupplier<R, R> supplier, Executor executor) Returns a Supplier for synchronous executions that pre-executes theexecution, applies thesupplier, records the result and returns the result.(package private) static <R> Function<AsyncExecutionInternal<R>, CompletableFuture<ExecutionResult<R>>> Functions.getPromise(ContextualSupplier<R, R> supplier, Executor executor) Returns a Function for asynchronous executions that pre-executes theexecution, applies thesupplier, records the result and returns a promise containing the result.(package private) static <R> Function<AsyncExecutionInternal<R>, CompletableFuture<ExecutionResult<R>>> Functions.getPromiseExecution(AsyncRunnable<R> runnable, Executor executor) Returns a Function for asynchronous executions that pre-executes theexecution, runs therunnable, and attempts to complete theexecutionif a failure occurs.(package private) static <R> Function<AsyncExecutionInternal<R>, CompletableFuture<ExecutionResult<R>>> Functions.getPromiseOfStage(ContextualSupplier<R, ? extends CompletionStage<? extends R>> supplier, FailsafeFuture<R> future, Executor executor) Returns a Function that for asynchronous executions that pre-executes theexecution, applies thesupplier, records the result and returns a promise containing the result.(package private) static <R> Function<AsyncExecutionInternal<R>, CompletableFuture<ExecutionResult<R>>> Functions.toAsync(Function<AsyncExecutionInternal<R>, CompletableFuture<ExecutionResult<R>>> innerFn, Scheduler scheduler, FailsafeFuture<R> future) Returns a Function that asynchronously applies theinnerFnon the first call, synchronously on subsequent calls, and returns a promise containing the result.(package private) static <R> Function<AsyncExecutionInternal<R>, CompletableFuture<ExecutionResult<R>>> Functions.toExecutionAware(Function<AsyncExecutionInternal<R>, CompletableFuture<ExecutionResult<R>>> innerFn) Returns a Function that returns an execution result if one was previously recorded, else applies theinnerFn.Methods in dev.failsafe with parameters of type ExecutionResultModifier and TypeMethodDescriptionprivate voidAsyncExecutionImpl.complete(ExecutionResult<R> result, Throwable error) (package private) ExecutionResult<R> ExecutionImpl.postExecute(ExecutionResult<R> result) Externally called.(package private) ExecutionResult<R> SyncExecutionImpl.postExecute(ExecutionResult<R> result) voidExecutionImpl.record(ExecutionResult<R> result) Method parameters in dev.failsafe with type arguments of type ExecutionResultModifier and TypeMethodDescriptionprivate <T> CompletableFuture<T> FailsafeExecutor.callAsync(Function<FailsafeFuture<T>, Function<AsyncExecutionInternal<T>, CompletableFuture<ExecutionResult<T>>>> innerFn, boolean asyncExecution) Calls the asynchronousinnerFnvia the configured Scheduler, handling results according to the configured policies.(package private) static <R> Function<AsyncExecutionInternal<R>, CompletableFuture<ExecutionResult<R>>> Functions.toAsync(Function<AsyncExecutionInternal<R>, CompletableFuture<ExecutionResult<R>>> innerFn, Scheduler scheduler, FailsafeFuture<R> future) Returns a Function that asynchronously applies theinnerFnon the first call, synchronously on subsequent calls, and returns a promise containing the result.(package private) static <R> Function<AsyncExecutionInternal<R>, CompletableFuture<ExecutionResult<R>>> Functions.toExecutionAware(Function<AsyncExecutionInternal<R>, CompletableFuture<ExecutionResult<R>>> innerFn) Returns a Function that returns an execution result if one was previously recorded, else applies theinnerFn.Constructors in dev.failsafe with parameters of type ExecutionResultModifierConstructorDescription(package private)ExecutionImpl(ExecutionResult<R> previousResult) Used for testing purposes onlyConstructor parameters in dev.failsafe with type arguments of type ExecutionResultModifierConstructorDescription(package private)AsyncExecutionImpl(List<Policy<R>> policies, Scheduler scheduler, FailsafeFuture<R> future, boolean asyncExecution, Function<AsyncExecutionInternal<R>, CompletableFuture<ExecutionResult<R>>> innerFn) (package private)SyncExecutionImpl(FailsafeExecutor<R> executor, Scheduler scheduler, CallImpl<R> call, Function<SyncExecutionInternal<R>, ExecutionResult<R>> innerFn) Create a sync execution for theexecutor. -
Uses of ExecutionResult in dev.failsafe.internal
Methods in dev.failsafe.internal that return ExecutionResultModifier and TypeMethodDescriptionprotected ExecutionResult<R> BulkheadExecutor.onFailure(ExecutionContext<R> context, ExecutionResult<R> result) protected ExecutionResult<R> CircuitBreakerExecutor.onFailure(ExecutionContext<R> context, ExecutionResult<R> result) RetryPolicyExecutor.onFailure(ExecutionContext<R> context, ExecutionResult<R> result) protected ExecutionResult<R> BulkheadExecutor.preExecute()protected ExecutionResult<R> CircuitBreakerExecutor.preExecute()protected ExecutionResult<R> RateLimiterExecutor.preExecute()Methods in dev.failsafe.internal that return types with arguments of type ExecutionResultModifier and TypeMethodDescriptionFallbackExecutor.apply(Function<SyncExecutionInternal<R>, ExecutionResult<R>> innerFn, Scheduler scheduler) Performs an execution by calling pre-execute else calling the supplier, applying a fallback if it fails, and calling post-execute.RetryPolicyExecutor.apply(Function<SyncExecutionInternal<R>, ExecutionResult<R>> innerFn, Scheduler scheduler) TimeoutExecutor.apply(Function<SyncExecutionInternal<R>, ExecutionResult<R>> innerFn, Scheduler scheduler) Schedules a separate timeout call that fails withTimeoutExceededExceptionif the policy's timeout is exceeded.FallbackExecutor.applyAsync(Function<AsyncExecutionInternal<R>, CompletableFuture<ExecutionResult<R>>> innerFn, Scheduler scheduler, FailsafeFuture<R> future) Performs an async execution by calling pre-execute else calling the supplier and doing a post-execute.RetryPolicyExecutor.applyAsync(Function<AsyncExecutionInternal<R>, CompletableFuture<ExecutionResult<R>>> innerFn, Scheduler scheduler, FailsafeFuture<R> future) TimeoutExecutor.applyAsync(Function<AsyncExecutionInternal<R>, CompletableFuture<ExecutionResult<R>>> innerFn, Scheduler scheduler, FailsafeFuture<R> future) Schedules a separate timeout call that blocks and fails withTimeoutExceededExceptionif the policy's timeout is exceeded.RetryPolicyExecutor.onFailureAsync(ExecutionContext<R> context, ExecutionResult<R> result, Scheduler scheduler, FailsafeFuture<R> future) Defaults async executions to not be complete untilsays they are.protected CompletableFuture<ExecutionResult<R>> BulkheadExecutor.preExecuteAsync(Scheduler scheduler, FailsafeFuture<R> future) protected CompletableFuture<ExecutionResult<R>> RateLimiterExecutor.preExecuteAsync(Scheduler scheduler, FailsafeFuture<R> future) Methods in dev.failsafe.internal with parameters of type ExecutionResultModifier and TypeMethodDescriptionvoidEventHandler.handle(ExecutionResult<R> result, ExecutionContext<R> context) booleanTimeoutExecutor.isFailure(ExecutionResult<R> result) (package private) booleanRetryPolicyExecutor.isValidResult(ExecutionResult<R> result, Throwable error, CompletableFuture<ExecutionResult<R>> promise) Completes thepromiseand returnsfalseif theresultorerrorare invalid, else returnstrue.protected ExecutionResult<R> BulkheadExecutor.onFailure(ExecutionContext<R> context, ExecutionResult<R> result) protected ExecutionResult<R> CircuitBreakerExecutor.onFailure(ExecutionContext<R> context, ExecutionResult<R> result) RetryPolicyExecutor.onFailure(ExecutionContext<R> context, ExecutionResult<R> result) RetryPolicyExecutor.onFailureAsync(ExecutionContext<R> context, ExecutionResult<R> result, Scheduler scheduler, FailsafeFuture<R> future) Defaults async executions to not be complete untilsays they are.voidBulkheadExecutor.onSuccess(ExecutionResult<R> result) voidCircuitBreakerExecutor.onSuccess(ExecutionResult<R> result) Method parameters in dev.failsafe.internal with type arguments of type ExecutionResultModifier and TypeMethodDescriptionFallbackExecutor.apply(Function<SyncExecutionInternal<R>, ExecutionResult<R>> innerFn, Scheduler scheduler) Performs an execution by calling pre-execute else calling the supplier, applying a fallback if it fails, and calling post-execute.RetryPolicyExecutor.apply(Function<SyncExecutionInternal<R>, ExecutionResult<R>> innerFn, Scheduler scheduler) TimeoutExecutor.apply(Function<SyncExecutionInternal<R>, ExecutionResult<R>> innerFn, Scheduler scheduler) Schedules a separate timeout call that fails withTimeoutExceededExceptionif the policy's timeout is exceeded.FallbackExecutor.applyAsync(Function<AsyncExecutionInternal<R>, CompletableFuture<ExecutionResult<R>>> innerFn, Scheduler scheduler, FailsafeFuture<R> future) Performs an async execution by calling pre-execute else calling the supplier and doing a post-execute.RetryPolicyExecutor.applyAsync(Function<AsyncExecutionInternal<R>, CompletableFuture<ExecutionResult<R>>> innerFn, Scheduler scheduler, FailsafeFuture<R> future) TimeoutExecutor.applyAsync(Function<AsyncExecutionInternal<R>, CompletableFuture<ExecutionResult<R>>> innerFn, Scheduler scheduler, FailsafeFuture<R> future) Schedules a separate timeout call that blocks and fails withTimeoutExceededExceptionif the policy's timeout is exceeded.RetryPolicyExecutor.handleAsync(AsyncExecutionInternal<R> execution, Function<AsyncExecutionInternal<R>, CompletableFuture<ExecutionResult<R>>> innerFn, Scheduler scheduler, FailsafeFuture<R> future, CompletableFuture<ExecutionResult<R>> promise, AtomicReference<ExecutionResult<R>> previousResultRef) RetryPolicyExecutor.handleAsync(AsyncExecutionInternal<R> execution, Function<AsyncExecutionInternal<R>, CompletableFuture<ExecutionResult<R>>> innerFn, Scheduler scheduler, FailsafeFuture<R> future, CompletableFuture<ExecutionResult<R>> promise, AtomicReference<ExecutionResult<R>> previousResultRef) RetryPolicyExecutor.handleAsync(AsyncExecutionInternal<R> execution, Function<AsyncExecutionInternal<R>, CompletableFuture<ExecutionResult<R>>> innerFn, Scheduler scheduler, FailsafeFuture<R> future, CompletableFuture<ExecutionResult<R>> promise, AtomicReference<ExecutionResult<R>> previousResultRef) (package private) booleanRetryPolicyExecutor.isValidResult(ExecutionResult<R> result, Throwable error, CompletableFuture<ExecutionResult<R>> promise) Completes thepromiseand returnsfalseif theresultorerrorare invalid, else returnstrue. -
Uses of ExecutionResult in dev.failsafe.spi
Fields in dev.failsafe.spi declared as ExecutionResultFields in dev.failsafe.spi with type parameters of type ExecutionResultModifier and TypeFieldDescriptionprivate Map<Integer, BiConsumer<Boolean, ExecutionResult<R>>> FailsafeFuture.cancelFunctionsprivate final BiConsumer<ExecutionResult<R>, ExecutionContext<R>> FailsafeFuture.completionHandlerMethods in dev.failsafe.spi that return ExecutionResultModifier and TypeMethodDescriptionstatic <R> ExecutionResult<R> Returns an ExecutionResult with theexceptionset,completetrue andsuccessfalse.ExecutionInternal.getResult()Returns the recorded result for an execution attempt.static <R> ExecutionResult<R> ExecutionResult.none()Returns an execution that was completed with a non-result.protected ExecutionResult<R> PolicyExecutor.onFailure(ExecutionContext<R> context, ExecutionResult<R> result) Performs post-execution handling for aresultthat is considered a failure according toPolicyExecutor.isFailure(ExecutionResult), possibly creating a new result, else returning the originalresult.PolicyExecutor.postExecute(ExecutionInternal<R> execution, ExecutionResult<R> result) Performs synchronous post-execution handling for aresult.protected ExecutionResult<R> PolicyExecutor.preExecute()Called before execution to return an alternative result or exception such as if execution is not allowed or needed.static <R> ExecutionResult<R> ExecutionResult.success(R result) Returns an ExecutionResult with theresultset,completetrue andsuccesstrue.ExecutionResult.with(long delayNanos, boolean complete, boolean success) Returns a copy of the ExecutionResult with thedelayNanos,completeandsuccessvalues.ExecutionResult.withDelay(long delayNanos) Returns a copy of the ExecutionResult with thedelayNanosvalue.ExecutionResult.withException()Returns a copy of the ExecutionResult with success value of {code false}.ExecutionResult.withNonResult()Returns a copy of the ExecutionResult with a non-result, and complete and success set to true.ExecutionResult.withNotComplete()Returns a copy of the ExecutionResult withcompleteset to false, else this if nothing has changed.ExecutionResult.withResult(R result) Returns a copy of the ExecutionResult with theresultvalue, and complete and success set to true.ExecutionResult.withSuccess()Returns a copy of the ExecutionResult with thecompleteandsuccessvalues oftrue.Methods in dev.failsafe.spi that return types with arguments of type ExecutionResultModifier and TypeMethodDescriptionPolicyExecutor.apply(Function<SyncExecutionInternal<R>, ExecutionResult<R>> innerFn, Scheduler scheduler) Performs an execution by calling pre-execute else calling the supplier and doing a post-execute.PolicyExecutor.applyAsync(Function<AsyncExecutionInternal<R>, CompletableFuture<ExecutionResult<R>>> innerFn, Scheduler scheduler, FailsafeFuture<R> future) Performs an async execution by calling pre-execute else calling the supplier and doing a post-execute.static <R> CompletableFuture<ExecutionResult<R>> ExecutionResult.nullFuture()Returns a CompletableFuture that is completed withnull.protected CompletableFuture<ExecutionResult<R>> PolicyExecutor.onFailureAsync(ExecutionContext<R> context, ExecutionResult<R> result, Scheduler scheduler, FailsafeFuture<R> future) Performs potentially asynchrononus post-execution handling for a failedresult, possibly creating a new result, else returning the originalresult.protected CompletableFuture<ExecutionResult<R>> PolicyExecutor.postExecuteAsync(AsyncExecutionInternal<R> execution, ExecutionResult<R> result, Scheduler scheduler, FailsafeFuture<R> future) Performs potentially asynchronous post-execution handling for aresult.protected CompletableFuture<ExecutionResult<R>> PolicyExecutor.preExecuteAsync(Scheduler scheduler, FailsafeFuture<R> future) Called before an async execution to return an alternative result or exception such as if execution is not allowed or needed.Methods in dev.failsafe.spi with parameters of type ExecutionResultModifier and TypeMethodDescriptionvoidFailsafeFuture.cancelDependencies(PolicyExecutor<R> cancellingPolicyExecutor, boolean mayInterrupt, ExecutionResult<R> cancelResult) Applies anycancel functionswith thecancelResultfor PolicyExecutors whose policyIndex is invalid input: '<' the policyIndex of thecancellingPolicyExecutor.booleanFailsafeFuture.completeResult(ExecutionResult<R> result) Completes the execution with theresultand calls the completion handler.private voidPolicyExecutor.handleFailure(ExecutionResult<R> result, ExecutionContext<R> context) private voidPolicyExecutor.handleSuccess(ExecutionResult<R> result, ExecutionContext<R> context) protected booleanPolicyExecutor.isFailure(ExecutionResult<R> result) Returns whether theresultis a success according to the policy.protected ExecutionResult<R> PolicyExecutor.onFailure(ExecutionContext<R> context, ExecutionResult<R> result) Performs post-execution handling for aresultthat is considered a failure according toPolicyExecutor.isFailure(ExecutionResult), possibly creating a new result, else returning the originalresult.protected CompletableFuture<ExecutionResult<R>> PolicyExecutor.onFailureAsync(ExecutionContext<R> context, ExecutionResult<R> result, Scheduler scheduler, FailsafeFuture<R> future) Performs potentially asynchrononus post-execution handling for a failedresult, possibly creating a new result, else returning the originalresult.protected voidPolicyExecutor.onSuccess(ExecutionResult<R> result) Performs post-execution handling for aresultthat is considered a success according toPolicyExecutor.isFailure(ExecutionResult).PolicyExecutor.postExecute(ExecutionInternal<R> execution, ExecutionResult<R> result) Performs synchronous post-execution handling for aresult.protected CompletableFuture<ExecutionResult<R>> PolicyExecutor.postExecuteAsync(AsyncExecutionInternal<R> execution, ExecutionResult<R> result, Scheduler scheduler, FailsafeFuture<R> future) Performs potentially asynchronous post-execution handling for aresult.voidExecutionInternal.record(ExecutionResult<R> result) Records theresultif the execution has beenpre-executedand a result has not already been recorded.Method parameters in dev.failsafe.spi with type arguments of type ExecutionResultModifier and TypeMethodDescriptionPolicyExecutor.apply(Function<SyncExecutionInternal<R>, ExecutionResult<R>> innerFn, Scheduler scheduler) Performs an execution by calling pre-execute else calling the supplier and doing a post-execute.PolicyExecutor.applyAsync(Function<AsyncExecutionInternal<R>, CompletableFuture<ExecutionResult<R>>> innerFn, Scheduler scheduler, FailsafeFuture<R> future) Performs an async execution by calling pre-execute else calling the supplier and doing a post-execute.voidFailsafeFuture.setCancelFn(int policyIndex, BiConsumer<Boolean, ExecutionResult<R>> cancelFn) Sets acancelFnto be called when a PolicyExecutorcancels dependencieswith a policyIndex > the givenpolicyIndex, or when this future iscancelled.voidFailsafeFuture.setCancelFn(PolicyExecutor<R> policyExecutor, BiConsumer<Boolean, ExecutionResult<R>> cancelFn) Sets acancelFnto be called when a PolicyExecutorcancels dependencieswith a policyIndex > the policyIndex of the givenpolicyExecutor, or when this future iscancelled.Constructor parameters in dev.failsafe.spi with type arguments of type ExecutionResultModifierConstructorDescriptionFailsafeFuture(BiConsumer<ExecutionResult<R>, ExecutionContext<R>> completionHandler)