Package io.vertx.mutiny.circuitbreaker
Class FailurePolicy<T>
java.lang.Object
io.vertx.mutiny.circuitbreaker.FailurePolicy<T>
- All Implemented Interfaces:
MutinyDelegate
A failure policy for the
CircuitBreaker.
The default policy is to consider an asynchronous result as a failure if AsyncResult#failed() returns true.
Nevertheless, sometimes this is not good enough. For example, an HTTP Client could return a response, but with an unexpected status code.
In this case, a custom failure policy can be configured with CircuitBreaker.failurePolicy(FailurePolicy).
NOTE: This class has been automatically generated from the original non Mutiny-ified interface.
- See Also:
-
FailurePolicy
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionFailurePolicy(io.vertx.circuitbreaker.FailurePolicy<T> delegate) Create a new instance ofFailurePolicydelegating to the given (non-null) instance ofFailurePolicy.FailurePolicy(io.vertx.circuitbreaker.FailurePolicy<T> delegate, TypeArg<T> typeArg_0) FailurePolicy(Object delegate, TypeArg<T> typeArg_0) -
Method Summary
Modifier and TypeMethodDescriptionstatic <U> FailurePolicy<U>The default policy, which considers an asynchronous result as a failure ifAsyncResult#failed()returnstrue.booleanio.vertx.circuitbreaker.FailurePolicy<T>Get the delegate instance.inthashCode()static <T> FailurePolicy<T>newInstance(io.vertx.circuitbreaker.FailurePolicy<T> delegate) Creates a new instance of theFailurePolicy.static <T> FailurePolicy<T>newInstance(io.vertx.circuitbreaker.FailurePolicy<T> delegate, TypeArg<T> typeArg_0) Creates a new instance of theFailurePolicy.booleanInvoked by theCircuitBreakerwhen an operation completes.toString()
-
Field Details
-
__TYPE_ARG
-
__typeArg_0
-
-
Constructor Details
-
FailurePolicy
Create a new instance ofFailurePolicydelegating to the given (non-null) instance ofFailurePolicy. -
FailurePolicy
-
FailurePolicy
-
-
Method Details
-
getDelegate
Get the delegate instance.This method returns the instance on which this shim is delegating the calls. And so, give you access to the bare API.
- Specified by:
getDelegatein interfaceMutinyDelegate- Returns:
- the delegate instance
-
defaultPolicy
The default policy, which considers an asynchronous result as a failure ifAsyncResult#failed()returnstrue. -
test
Invoked by theCircuitBreakerwhen an operation completes.- Parameters:
future- a completed future- Returns:
trueif the asynchronous result should be considered as a failure,falseotherwise
-
newInstance
Creates a new instance of theFailurePolicy. -
newInstance
public static <T> FailurePolicy<T> newInstance(io.vertx.circuitbreaker.FailurePolicy<T> delegate, TypeArg<T> typeArg_0) Creates a new instance of theFailurePolicy. -
hashCode
public int hashCode() -
equals
-
toString
-