@FunctionalInterface public interface CircuitBreakerMapping
CircuitBreaker instance from remote invocation parameters.| Modifier and Type | Method and Description |
|---|---|
CircuitBreaker |
get(ClientRequestContext ctx,
Request req)
Returns the
CircuitBreaker mapped to the given parameters. |
static CircuitBreakerMapping |
ofDefault()
Returns the default
CircuitBreakerMapping. |
static CircuitBreakerMapping |
perHost(Function<String,CircuitBreaker> factory)
Creates a new
CircuitBreakerMapping which maps CircuitBreakers with the remote host name. |
static CircuitBreakerMapping |
perHostAndMethod(Function<String,CircuitBreaker> factory)
Creates a new
CircuitBreakerMapping which maps CircuitBreakers with the remote host and
method name. |
static CircuitBreakerMapping |
perMethod(Function<String,CircuitBreaker> factory)
Creates a new
CircuitBreakerMapping which maps CircuitBreakers with method name. |
static CircuitBreakerMapping ofDefault()
CircuitBreakerMapping.static CircuitBreakerMapping perMethod(Function<String,CircuitBreaker> factory)
CircuitBreakerMapping which maps CircuitBreakers with method name.factory - A function that takes a method name and creates a new CircuitBreakerstatic CircuitBreakerMapping perHost(Function<String,CircuitBreaker> factory)
CircuitBreakerMapping which maps CircuitBreakers with the remote host name.factory - A function that takes a host name and creates a new CircuitBreakerstatic CircuitBreakerMapping perHostAndMethod(Function<String,CircuitBreaker> factory)
CircuitBreakerMapping which maps CircuitBreakers with the remote host and
method name.factory - A function that takes the remote host and method name and
creates a new CircuitBreakerCircuitBreaker get(ClientRequestContext ctx, Request req) throws Exception
CircuitBreaker mapped to the given parameters.ExceptionCopyright © 2020 LeanCloud. All rights reserved.