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 aCircuitBreaker
instance from remote invocation parameters.
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods 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 Detail
-
ofDefault
static CircuitBreakerMapping ofDefault()
Returns the defaultCircuitBreakerMapping
.
-
perMethod
static CircuitBreakerMapping perMethod(Function<String,CircuitBreaker> factory)
Creates a newCircuitBreakerMapping
which mapsCircuitBreaker
s with method name.- Parameters:
factory
- A function that takes a method name and creates a newCircuitBreaker
-
perHost
static CircuitBreakerMapping perHost(Function<String,CircuitBreaker> factory)
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
static CircuitBreakerMapping perHostAndMethod(Function<String,CircuitBreaker> factory)
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
CircuitBreaker get(ClientRequestContext ctx, Request req) throws Exception
Returns theCircuitBreaker
mapped to the given parameters.- Throws:
Exception
-
-