Interface CircuitBreakerMapping
- All Known Implementing Classes:
KeyedCircuitBreakerMapping
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface public interface CircuitBreakerMapping
Returns a
CircuitBreaker
instance from remote invocation parameters.-
Method Summary
Modifier and Type Method Description CircuitBreaker
get(ClientRequestContext ctx, Request req)
Returns theCircuitBreaker
mapped to the given parameters.static CircuitBreakerMapping
ofDefault()
Returns the defaultCircuitBreakerMapping
.static CircuitBreakerMapping
perHost(Function<String,CircuitBreaker> factory)
Creates a newCircuitBreakerMapping
which mapsCircuitBreaker
s with the remote host name.static CircuitBreakerMapping
perHostAndMethod(Function<String,CircuitBreaker> factory)
Creates a newCircuitBreakerMapping
which mapsCircuitBreaker
s with the remote host and method name.static CircuitBreakerMapping
perMethod(Function<String,CircuitBreaker> factory)
Creates a newCircuitBreakerMapping
which mapsCircuitBreaker
s with method name.
-
Method Details
-
ofDefault
Returns the defaultCircuitBreakerMapping
. -
perMethod
Creates a newCircuitBreakerMapping
which mapsCircuitBreaker
s with method name.- Parameters:
factory
- A function that takes a method name and creates a newCircuitBreaker
-
perHost
Creates a newCircuitBreakerMapping
which mapsCircuitBreaker
s with the remote host name.- Parameters:
factory
- A function that takes a host name and creates a newCircuitBreaker
-
perHostAndMethod
Creates a newCircuitBreakerMapping
which mapsCircuitBreaker
s with the remote host and method name.- Parameters:
factory
- A function that takes the remote host and method name and creates a newCircuitBreaker
-
get
Returns theCircuitBreaker
mapped to the given parameters.- Throws:
Exception
-