public class KeyedCircuitBreakerMapping<K> extends Object implements CircuitBreakerMapping
CircuitBreakerMapping
that binds a CircuitBreaker
to its key. KeyedCircuitBreakerMapping.KeySelector
is used
to resolve the key from remote invocation parameters. If there is no circuit breaker bound to the key,
A new one is created by using the given circuit breaker factory.Modifier and Type | Class and Description |
---|---|
static interface |
KeyedCircuitBreakerMapping.KeySelector<K>
Returns the mapping key of the given remote invocation parameters.
|
Constructor and Description |
---|
KeyedCircuitBreakerMapping(KeyedCircuitBreakerMapping.KeySelector<K> keySelector,
java.util.function.Function<K,CircuitBreaker> factory)
Creates a new
KeyedCircuitBreakerMapping with the given KeyedCircuitBreakerMapping.KeySelector and
CircuitBreaker factory. |
Modifier and Type | Method and Description |
---|---|
CircuitBreaker |
get(io.netty.channel.EventLoop eventLoop,
URI uri,
ClientOptions options,
ClientCodec codec,
Method method,
Object[] args)
Returns the
CircuitBreaker mapped to the given parameters. |
public KeyedCircuitBreakerMapping(KeyedCircuitBreakerMapping.KeySelector<K> keySelector, java.util.function.Function<K,CircuitBreaker> factory)
KeyedCircuitBreakerMapping
with the given KeyedCircuitBreakerMapping.KeySelector
and
CircuitBreaker
factory.keySelector
- A function that returns the key of the given remote invocation parameters.factory
- A function that takes a key and creates a new CircuitBreaker
for the key.public CircuitBreaker get(io.netty.channel.EventLoop eventLoop, URI uri, ClientOptions options, ClientCodec codec, Method method, Object[] args) throws Exception
CircuitBreakerMapping
CircuitBreaker
mapped to the given parameters.get
in interface CircuitBreakerMapping
Exception
Copyright © 2015-2016 LINE Corporation. All Rights Reserved.