Uses of Interface
dev.failsafe.ExecutionContext
-
Packages that use ExecutionContext Package Description dev.failsafe APIs for performing failsafe executions.dev.failsafe.event Event listener types.dev.failsafe.function Functional interface types.dev.failsafe.internal dev.failsafe.spi The Failsafe Service Provider Interface (SPI). -
-
Uses of ExecutionContext in dev.failsafe
Subinterfaces of ExecutionContext in dev.failsafe Modifier and Type Interface Description interface
AsyncExecution<R>
Allows asynchronous executions to record their results or complete an execution.interface
Execution<R>
Tracks synchronous executions and handles failures according to one or morepolicies
.Classes in dev.failsafe that implement ExecutionContext Modifier and Type Class Description (package private) class
AsyncExecutionImpl<R>
AsyncExecution and AsyncExecutionInternal implementation.(package private) class
ExecutionImpl<R>
Execution and ExecutionInternal implementation.(package private) class
SyncExecutionImpl<R>
SyncExecution and SyncExecutionInternal implementation.Fields in dev.failsafe with type parameters of type ExecutionContext Modifier and Type Field Description (package private) java.util.function.BiConsumer<ExecutionResult<R>,ExecutionContext<R>>
FailsafeExecutor. completionHandler
-
Uses of ExecutionContext in dev.failsafe.event
Fields in dev.failsafe.event declared as ExecutionContext Modifier and Type Field Description private ExecutionContext<?>
ExecutionEvent. context
Constructors in dev.failsafe.event with parameters of type ExecutionContext Constructor Description ExecutionAttemptedEvent(R result, java.lang.Throwable exception, ExecutionContext<R> context)
ExecutionCompletedEvent(R result, java.lang.Throwable exception, ExecutionContext<R> context)
ExecutionEvent(ExecutionContext<?> context)
ExecutionScheduledEvent(R result, java.lang.Throwable exception, java.time.Duration delay, ExecutionContext<R> context)
-
Uses of ExecutionContext in dev.failsafe.function
Methods in dev.failsafe.function with parameters of type ExecutionContext Modifier and Type Method Description T
ContextualSupplier. get(ExecutionContext<R> context)
void
ContextualRunnable. run(ExecutionContext<R> context)
-
Uses of ExecutionContext in dev.failsafe.internal
Methods in dev.failsafe.internal with parameters of type ExecutionContext Modifier and Type Method Description private long
RetryPolicyExecutor. adjustForBackoff(ExecutionContext<R> context, long delayNanos)
protected R
FallbackImpl. apply(R result, java.lang.Throwable exception, ExecutionContext<R> context)
Returns the applied fallback result.protected java.util.concurrent.CompletableFuture<R>
FallbackImpl. applyStage(R result, java.lang.Throwable exception, ExecutionContext<R> context)
Returns a future applied fallback result.(package private) void
CircuitState. checkThreshold(ExecutionContext<R> context)
(package private) void
ClosedState. checkThreshold(ExecutionContext<R> context)
Checks to see if the executions and failure thresholds have been exceeded, opening the circuit if so.(package private) void
HalfOpenState. checkThreshold(ExecutionContext<R> context)
Checks to determine if a threshold has been met and the circuit should be opened or closed.void
EventHandler. handle(ExecutionResult<R> result, ExecutionContext<R> context)
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
.protected void
CircuitBreakerImpl. open(ExecutionContext<R> context)
Opens the circuit breaker and considers thecontext
when computing the delay before the circuit breaker will transition to half open.protected void
CircuitBreakerImpl. recordExecutionFailure(ExecutionContext<R> context)
Records an execution failure.void
CircuitState. recordFailure(ExecutionContext<R> context)
protected void
CircuitBreakerImpl. transitionTo(CircuitBreaker.State newState, EventListener<CircuitBreakerStateChangedEvent> listener, ExecutionContext<R> context)
Transitions to thenewState
if not already in that state and calls any associated event listener. -
Uses of ExecutionContext in dev.failsafe.spi
Subinterfaces of ExecutionContext in dev.failsafe.spi Modifier and Type Interface Description interface
AsyncExecutionInternal<R>
Internal async execution APIs.interface
ExecutionInternal<R>
Internal execution APIs.interface
SyncExecutionInternal<R>
Internal execution APIs.Fields in dev.failsafe.spi with type parameters of type ExecutionContext Modifier and Type Field Description private java.util.function.BiConsumer<ExecutionResult<R>,ExecutionContext<R>>
FailsafeFuture. completionHandler
Methods in dev.failsafe.spi with parameters of type ExecutionContext Modifier and Type Method Description default java.time.Duration
DelayablePolicy. computeDelay(ExecutionContext<R> context)
Returns a computed delay for theresult
andcontext
elsenull
if no delay function is configured or the computed delay is invalid.private void
PolicyExecutor. handleFailure(ExecutionResult<R> result, ExecutionContext<R> context)
private void
PolicyExecutor. handleSuccess(ExecutionResult<R> result, ExecutionContext<R> context)
protected ExecutionResult<R>
PolicyExecutor. onFailure(ExecutionContext<R> context, ExecutionResult<R> result)
Performs post-execution handling for aresult
that 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
.Constructor parameters in dev.failsafe.spi with type arguments of type ExecutionContext Constructor Description FailsafeFuture(java.util.function.BiConsumer<ExecutionResult<R>,ExecutionContext<R>> completionHandler)
-