Package io.vertx.mutiny.circuitbreaker
Class CircuitBreakerBuilder
java.lang.Object
io.vertx.mutiny.circuitbreaker.CircuitBreakerBuilder
- All Implemented Interfaces:
MutinyDelegate
A builder for
CircuitBreaker.
Unlike CircuitBreaker#openHandler(Handler), CircuitBreaker#halfOpenHandler(Handler) and
CircuitBreaker#closeHandler(Handler), the handlers configured through this builder are baked in as
immutable when build() is called: calling the corresponding mutator method again on the built circuit
breaker throws an IllegalStateException.
NOTE: This class has been automatically generated from the original non Mutiny-ified interface.
- See Also:
-
CircuitBreakerBuilder
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCircuitBreakerBuilder(io.vertx.circuitbreaker.CircuitBreakerBuilder delegate) Create a new instance ofCircuitBreakerBuilderdelegating to the given (non-null) instance ofCircuitBreakerBuilder.CircuitBreakerBuilder(Object delegate) -
Method Summary
Modifier and TypeMethodDescriptionbuild()Build and return the circuit breaker.closeHandler(Runnable handler) Set the handler invoked when the circuit breaker state switches to closed.booleanfailurePolicy(FailurePolicy<T> failurePolicy) Set the failure policy, seeCircuitBreaker.failurePolicy(FailurePolicy).Set the default fallback function, seeCircuitBreaker.fallback(Function).io.vertx.circuitbreaker.CircuitBreakerBuilderGet the delegate instance.halfOpenHandler(Runnable handler) Set the handler invoked when the circuit breaker state switches to half-open.inthashCode()static CircuitBreakerBuildernewInstance(io.vertx.circuitbreaker.CircuitBreakerBuilder delegate) Creates a new instance of theCircuitBreakerBuilder.openHandler(Runnable handler) Set the handler invoked when the circuit breaker state switches to open.retryPolicy(RetryPolicy retryPolicy) Set the retry policy, seeCircuitBreaker.retryPolicy(RetryPolicy).toString()with(io.vertx.circuitbreaker.CircuitBreakerOptions options) Configure the circuit breaker options.
-
Field Details
-
__TYPE_ARG
-
-
Constructor Details
-
CircuitBreakerBuilder
public CircuitBreakerBuilder(io.vertx.circuitbreaker.CircuitBreakerBuilder delegate) Create a new instance ofCircuitBreakerBuilderdelegating to the given (non-null) instance ofCircuitBreakerBuilder. -
CircuitBreakerBuilder
-
-
Method Details
-
getDelegate
public io.vertx.circuitbreaker.CircuitBreakerBuilder 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
-
with
Configure the circuit breaker options.- Parameters:
options- the configuration options- Returns:
- a reference to this, so the API can be used fluently
-
openHandler
Set the handler invoked when the circuit breaker state switches to open.- Parameters:
handler- the handler- Returns:
- a reference to this, so the API can be used fluently
-
halfOpenHandler
Set the handler invoked when the circuit breaker state switches to half-open.- Parameters:
handler- the handler- Returns:
- a reference to this, so the API can be used fluently
-
closeHandler
Set the handler invoked when the circuit breaker state switches to closed.- Parameters:
handler- the handler- Returns:
- a reference to this, so the API can be used fluently
-
fallback
Set the default fallback function, seeCircuitBreaker.fallback(Function).- Parameters:
handler- the fallback function- Returns:
- a reference to this, so the API can be used fluently
-
failurePolicy
Set the failure policy, seeCircuitBreaker.failurePolicy(FailurePolicy).- Parameters:
failurePolicy- the failure policy- Returns:
- a reference to this, so the API can be used fluently
-
retryPolicy
Set the retry policy, seeCircuitBreaker.retryPolicy(RetryPolicy).- Parameters:
retryPolicy- the retry policy- Returns:
- a reference to this, so the API can be used fluently
-
build
Build and return the circuit breaker.- Returns:
- the circuit breaker as configured by this builder
-
newInstance
public static CircuitBreakerBuilder newInstance(io.vertx.circuitbreaker.CircuitBreakerBuilder delegate) Creates a new instance of theCircuitBreakerBuilder. -
hashCode
public int hashCode() -
equals
-
toString
-