Uses of Class
dev.failsafe.spi.ExecutionResult
-
Packages that use ExecutionResult Package Description dev.failsafe APIs for performing failsafe executions.dev.failsafe.internal dev.failsafe.spi The Failsafe Service Provider Interface (SPI). -
-
Uses of ExecutionResult in dev.failsafe
Fields in dev.failsafe declared as ExecutionResult Modifier and Type Field Description private ExecutionResult<R>ExecutionImpl. previousResult(package private) ExecutionResult<R>ExecutionImpl. resultFields in dev.failsafe with type parameters of type ExecutionResult Modifier and Type Field Description (package private) java.util.function.BiConsumer<ExecutionResult<R>,ExecutionContext<R>>FailsafeExecutor. completionHandlerprivate java.util.function.Function<AsyncExecutionInternal<R>,java.util.concurrent.CompletableFuture<ExecutionResult<R>>>AsyncExecutionImpl. outerFnprivate java.util.function.Function<SyncExecutionInternal<R>,ExecutionResult<R>>SyncExecutionImpl. outerFnMethods in dev.failsafe that return ExecutionResult Modifier and Type Method Description ExecutionResult<R>ExecutionImpl. 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 ExecutionResult Modifier and Type Method Description (package private) static <R> java.util.function.Function<SyncExecutionImpl<R>,ExecutionResult<R>>Functions. get(ContextualSupplier<R,R> supplier, java.util.concurrent.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> java.util.function.Function<AsyncExecutionInternal<R>,java.util.concurrent.CompletableFuture<ExecutionResult<R>>>Functions. getPromise(ContextualSupplier<R,R> supplier, java.util.concurrent.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> java.util.function.Function<AsyncExecutionInternal<R>,java.util.concurrent.CompletableFuture<ExecutionResult<R>>>Functions. getPromiseExecution(AsyncRunnable<R> runnable, java.util.concurrent.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> java.util.function.Function<AsyncExecutionInternal<R>,java.util.concurrent.CompletableFuture<ExecutionResult<R>>>Functions. getPromiseOfStage(ContextualSupplier<R,? extends java.util.concurrent.CompletionStage<? extends R>> supplier, FailsafeFuture<R> future, java.util.concurrent.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> java.util.function.Function<AsyncExecutionInternal<R>,java.util.concurrent.CompletableFuture<ExecutionResult<R>>>Functions. toAsync(java.util.function.Function<AsyncExecutionInternal<R>,java.util.concurrent.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> java.util.function.Function<AsyncExecutionInternal<R>,java.util.concurrent.CompletableFuture<ExecutionResult<R>>>Functions. toExecutionAware(java.util.function.Function<AsyncExecutionInternal<R>,java.util.concurrent.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 ExecutionResult Modifier and Type Method Description private voidAsyncExecutionImpl. complete(ExecutionResult<R> result, java.lang.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 ExecutionResult Modifier and Type Method Description private <T> java.util.concurrent.CompletableFuture<T>FailsafeExecutor. callAsync(java.util.function.Function<FailsafeFuture<T>,java.util.function.Function<AsyncExecutionInternal<T>,java.util.concurrent.CompletableFuture<ExecutionResult<T>>>> innerFn, boolean asyncExecution)Calls the asynchronousinnerFnvia the configured Scheduler, handling results according to the configured policies.(package private) static <R> java.util.function.Function<AsyncExecutionInternal<R>,java.util.concurrent.CompletableFuture<ExecutionResult<R>>>Functions. toAsync(java.util.function.Function<AsyncExecutionInternal<R>,java.util.concurrent.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> java.util.function.Function<AsyncExecutionInternal<R>,java.util.concurrent.CompletableFuture<ExecutionResult<R>>>Functions. toExecutionAware(java.util.function.Function<AsyncExecutionInternal<R>,java.util.concurrent.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 ExecutionResult Constructor Description ExecutionImpl(ExecutionResult<R> previousResult)Used for testing purposes onlyConstructor parameters in dev.failsafe with type arguments of type ExecutionResult Constructor Description AsyncExecutionImpl(java.util.List<Policy<R>> policies, Scheduler scheduler, FailsafeFuture<R> future, boolean asyncExecution, java.util.function.Function<AsyncExecutionInternal<R>,java.util.concurrent.CompletableFuture<ExecutionResult<R>>> innerFn)SyncExecutionImpl(FailsafeExecutor<R> executor, Scheduler scheduler, CallImpl<R> call, java.util.function.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 ExecutionResult Modifier and Type Method Description protected ExecutionResult<R>BulkheadExecutor. onFailure(ExecutionContext<R> context, ExecutionResult<R> result)protected ExecutionResult<R>CircuitBreakerExecutor. onFailure(ExecutionContext<R> context, ExecutionResult<R> result)ExecutionResult<R>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 ExecutionResult Modifier and Type Method Description java.util.function.Function<SyncExecutionInternal<R>,ExecutionResult<R>>FallbackExecutor. apply(java.util.function.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.java.util.function.Function<SyncExecutionInternal<R>,ExecutionResult<R>>RetryPolicyExecutor. apply(java.util.function.Function<SyncExecutionInternal<R>,ExecutionResult<R>> innerFn, Scheduler scheduler)java.util.function.Function<SyncExecutionInternal<R>,ExecutionResult<R>>TimeoutExecutor. apply(java.util.function.Function<SyncExecutionInternal<R>,ExecutionResult<R>> innerFn, Scheduler scheduler)Schedules a separate timeout call that fails withTimeoutExceededExceptionif the policy's timeout is exceeded.java.util.function.Function<AsyncExecutionInternal<R>,java.util.concurrent.CompletableFuture<ExecutionResult<R>>>FallbackExecutor. applyAsync(java.util.function.Function<AsyncExecutionInternal<R>,java.util.concurrent.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.java.util.function.Function<AsyncExecutionInternal<R>,java.util.concurrent.CompletableFuture<ExecutionResult<R>>>RetryPolicyExecutor. applyAsync(java.util.function.Function<AsyncExecutionInternal<R>,java.util.concurrent.CompletableFuture<ExecutionResult<R>>> innerFn, Scheduler scheduler, FailsafeFuture<R> future)java.util.function.Function<AsyncExecutionInternal<R>,java.util.concurrent.CompletableFuture<ExecutionResult<R>>>TimeoutExecutor. applyAsync(java.util.function.Function<AsyncExecutionInternal<R>,java.util.concurrent.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.java.util.concurrent.CompletableFuture<ExecutionResult<R>>RetryPolicyExecutor. onFailureAsync(ExecutionContext<R> context, ExecutionResult<R> result, Scheduler scheduler, FailsafeFuture<R> future)Defaults async executions to not be complete untilsays they are.protected java.util.concurrent.CompletableFuture<ExecutionResult<R>>BulkheadExecutor. preExecuteAsync(Scheduler scheduler, FailsafeFuture<R> future)protected java.util.concurrent.CompletableFuture<ExecutionResult<R>>RateLimiterExecutor. preExecuteAsync(Scheduler scheduler, FailsafeFuture<R> future)Methods in dev.failsafe.internal with parameters of type ExecutionResult Modifier and Type Method Description voidEventHandler. handle(ExecutionResult<R> result, ExecutionContext<R> context)booleanTimeoutExecutor. isFailure(ExecutionResult<R> result)(package private) booleanRetryPolicyExecutor. isValidResult(ExecutionResult<R> result, java.lang.Throwable error, java.util.concurrent.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)ExecutionResult<R>RetryPolicyExecutor. onFailure(ExecutionContext<R> context, ExecutionResult<R> result)java.util.concurrent.CompletableFuture<ExecutionResult<R>>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 ExecutionResult Modifier and Type Method Description java.util.function.Function<SyncExecutionInternal<R>,ExecutionResult<R>>FallbackExecutor. apply(java.util.function.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.java.util.function.Function<SyncExecutionInternal<R>,ExecutionResult<R>>RetryPolicyExecutor. apply(java.util.function.Function<SyncExecutionInternal<R>,ExecutionResult<R>> innerFn, Scheduler scheduler)java.util.function.Function<SyncExecutionInternal<R>,ExecutionResult<R>>TimeoutExecutor. apply(java.util.function.Function<SyncExecutionInternal<R>,ExecutionResult<R>> innerFn, Scheduler scheduler)Schedules a separate timeout call that fails withTimeoutExceededExceptionif the policy's timeout is exceeded.java.util.function.Function<AsyncExecutionInternal<R>,java.util.concurrent.CompletableFuture<ExecutionResult<R>>>FallbackExecutor. applyAsync(java.util.function.Function<AsyncExecutionInternal<R>,java.util.concurrent.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.java.util.function.Function<AsyncExecutionInternal<R>,java.util.concurrent.CompletableFuture<ExecutionResult<R>>>RetryPolicyExecutor. applyAsync(java.util.function.Function<AsyncExecutionInternal<R>,java.util.concurrent.CompletableFuture<ExecutionResult<R>>> innerFn, Scheduler scheduler, FailsafeFuture<R> future)java.util.function.Function<AsyncExecutionInternal<R>,java.util.concurrent.CompletableFuture<ExecutionResult<R>>>TimeoutExecutor. applyAsync(java.util.function.Function<AsyncExecutionInternal<R>,java.util.concurrent.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.java.lang.ObjectRetryPolicyExecutor. handleAsync(AsyncExecutionInternal<R> execution, java.util.function.Function<AsyncExecutionInternal<R>,java.util.concurrent.CompletableFuture<ExecutionResult<R>>> innerFn, Scheduler scheduler, FailsafeFuture<R> future, java.util.concurrent.CompletableFuture<ExecutionResult<R>> promise, java.util.concurrent.atomic.AtomicReference<ExecutionResult<R>> previousResultRef)java.lang.ObjectRetryPolicyExecutor. handleAsync(AsyncExecutionInternal<R> execution, java.util.function.Function<AsyncExecutionInternal<R>,java.util.concurrent.CompletableFuture<ExecutionResult<R>>> innerFn, Scheduler scheduler, FailsafeFuture<R> future, java.util.concurrent.CompletableFuture<ExecutionResult<R>> promise, java.util.concurrent.atomic.AtomicReference<ExecutionResult<R>> previousResultRef)java.lang.ObjectRetryPolicyExecutor. handleAsync(AsyncExecutionInternal<R> execution, java.util.function.Function<AsyncExecutionInternal<R>,java.util.concurrent.CompletableFuture<ExecutionResult<R>>> innerFn, Scheduler scheduler, FailsafeFuture<R> future, java.util.concurrent.CompletableFuture<ExecutionResult<R>> promise, java.util.concurrent.atomic.AtomicReference<ExecutionResult<R>> previousResultRef)(package private) booleanRetryPolicyExecutor. isValidResult(ExecutionResult<R> result, java.lang.Throwable error, java.util.concurrent.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 ExecutionResult Modifier and Type Field Description private static ExecutionResult<?>ExecutionResult. NONEFields in dev.failsafe.spi with type parameters of type ExecutionResult Modifier and Type Field Description private java.util.Map<java.lang.Integer,java.util.function.BiConsumer<java.lang.Boolean,ExecutionResult<R>>>FailsafeFuture. cancelFunctionsprivate java.util.function.BiConsumer<ExecutionResult<R>,ExecutionContext<R>>FailsafeFuture. completionHandlerMethods in dev.failsafe.spi that return ExecutionResult Modifier and Type Method Description static <R> ExecutionResult<R>ExecutionResult. exception(java.lang.Throwable exception)Returns an ExecutionResult with theexceptionset,completetrue andsuccessfalse.ExecutionResult<R>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.ExecutionResult<R>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<R>ExecutionResult. with(long delayNanos, boolean complete, boolean success)Returns a copy of the ExecutionResult with thedelayNanos,completeandsuccessvalues.ExecutionResult<R>ExecutionResult. withDelay(long delayNanos)Returns a copy of the ExecutionResult with thedelayNanosvalue.ExecutionResult<R>ExecutionResult. withException()Returns a copy of the ExecutionResult with success value of {code false}.ExecutionResult<R>ExecutionResult. withNonResult()Returns a copy of the ExecutionResult with a non-result, and complete and success set to true.ExecutionResult<R>ExecutionResult. withNotComplete()Returns a copy of the ExecutionResult withcompleteset to false, else this if nothing has changed.ExecutionResult<R>ExecutionResult. withResult(R result)Returns a copy of the ExecutionResult with theresultvalue, and complete and success set to true.ExecutionResult<R>ExecutionResult. withSuccess()Returns a copy of the ExecutionResult with thecompleteandsuccessvalues oftrue.Methods in dev.failsafe.spi that return types with arguments of type ExecutionResult Modifier and Type Method Description java.util.function.Function<SyncExecutionInternal<R>,ExecutionResult<R>>PolicyExecutor. apply(java.util.function.Function<SyncExecutionInternal<R>,ExecutionResult<R>> innerFn, Scheduler scheduler)Performs an execution by calling pre-execute else calling the supplier and doing a post-execute.java.util.function.Function<AsyncExecutionInternal<R>,java.util.concurrent.CompletableFuture<ExecutionResult<R>>>PolicyExecutor. applyAsync(java.util.function.Function<AsyncExecutionInternal<R>,java.util.concurrent.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> java.util.concurrent.CompletableFuture<ExecutionResult<R>>ExecutionResult. nullFuture()Returns a CompletableFuture that is completed withnull.protected java.util.concurrent.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 java.util.concurrent.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 java.util.concurrent.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 ExecutionResult Modifier and Type Method Description voidFailsafeFuture. cancelDependencies(PolicyExecutor<R> cancellingPolicyExecutor, boolean mayInterrupt, ExecutionResult<R> cancelResult)Applies anycancel functionswith thecancelResultfor PolicyExecutors whose policyIndex is < 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 java.util.concurrent.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).ExecutionResult<R>PolicyExecutor. postExecute(ExecutionInternal<R> execution, ExecutionResult<R> result)Performs synchronous post-execution handling for aresult.protected java.util.concurrent.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 ExecutionResult Modifier and Type Method Description java.util.function.Function<SyncExecutionInternal<R>,ExecutionResult<R>>PolicyExecutor. apply(java.util.function.Function<SyncExecutionInternal<R>,ExecutionResult<R>> innerFn, Scheduler scheduler)Performs an execution by calling pre-execute else calling the supplier and doing a post-execute.java.util.function.Function<AsyncExecutionInternal<R>,java.util.concurrent.CompletableFuture<ExecutionResult<R>>>PolicyExecutor. applyAsync(java.util.function.Function<AsyncExecutionInternal<R>,java.util.concurrent.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, java.util.function.BiConsumer<java.lang.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, java.util.function.BiConsumer<java.lang.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 ExecutionResult Constructor Description FailsafeFuture(java.util.function.BiConsumer<ExecutionResult<R>,ExecutionContext<R>> completionHandler)
-