| Package | Description |
|---|---|
| net.jodah.failsafe |
Core Failsafe APIs for performing failsafe executions.
|
| Modifier and Type | Method and Description |
|---|---|
<T> CircuitBreaker |
CircuitBreaker.failIf(BiPredicate<T,? extends Throwable> completionPredicate)
Specifies that a failure should be recorded if the
completionPredicate matches the completion result. |
<T> CircuitBreaker |
CircuitBreaker.failIf(Predicate<T> resultPredicate)
Specifies that a failure should be recorded if the
resultPredicate matches the result. |
CircuitBreaker |
CircuitBreaker.failOn(Class<? extends Throwable>... failures)
Specifies the types to fail on.
|
CircuitBreaker |
CircuitBreaker.failOn(Class<? extends Throwable> failure)
Specifies the type to fail on.
|
CircuitBreaker |
CircuitBreaker.failOn(List<Class<? extends Throwable>> failures)
Specifies the types to fail on.
|
CircuitBreaker |
CircuitBreaker.failOn(Predicate<? extends Throwable> failurePredicate)
Specifies that a failure should be recorded if the
failurePredicate matches the failure. |
CircuitBreaker |
CircuitBreaker.failWhen(Object result)
Specifies that a failure should be recorded if the execution result matches the
result. |
CircuitBreaker |
CircuitBreaker.onClose(CheckedRunnable runnable)
Calls the
runnable when the circuit is closed. |
CircuitBreaker |
CircuitBreaker.onHalfOpen(CheckedRunnable runnable)
Calls the
runnable when the circuit is half-opened. |
CircuitBreaker |
CircuitBreaker.onOpen(CheckedRunnable runnable)
Calls the
runnable when the circuit is opened. |
CircuitBreaker |
CircuitBreaker.withDelay(long delay,
TimeUnit timeUnit)
Sets the
delay to wait in open state before transitioning to half-open. |
CircuitBreaker |
CircuitBreaker.withFailureThreshold(int failureThreshold)
Sets the number of successive failures that must occur when in a closed state in order to open the circuit.
|
CircuitBreaker |
CircuitBreaker.withFailureThreshold(int failures,
int executions)
Sets the ratio of successive failures that must occur when in a closed state in order to open the circuit.
|
CircuitBreaker |
CircuitBreaker.withSuccessThreshold(int successThreshold)
Sets the number of successive successful executions that must occur when in a half-open state in order to close the
circuit, else the circuit is re-opened when a failure occurs.
|
CircuitBreaker |
CircuitBreaker.withSuccessThreshold(int successes,
int executions)
Sets the ratio of successive successful executions that must occur when in a half-open state in order to close the
circuit.
|
CircuitBreaker |
CircuitBreaker.withTimeout(long timeout,
TimeUnit timeUnit)
Sets the
timeout for executions. |
| Modifier and Type | Method and Description |
|---|---|
F |
FailsafeConfig.with(CircuitBreaker circuitBreaker)
Configures the
circuitBreaker to be used to control the rate of event execution. |
static <T> SyncFailsafe<T> |
Failsafe.with(CircuitBreaker circuitBreaker)
Creates and returns a new SyncFailsafe instance that will perform executions and retries synchronously according to
the
circuitBreaker. |
| Constructor and Description |
|---|
Execution(CircuitBreaker circuitBreaker)
Creates a new Execution for the
circuitBreaker. |
Execution(RetryPolicy retryPolicy,
CircuitBreaker circuitBreaker)
Creates a new Execution for the
retryPolicy and circuitBreaker. |
Copyright © 2018. All rights reserved.