public class CircuitBreaker<V> extends Object implements FaultToleranceStrategy<V>
| Modifier and Type | Class and Description |
|---|---|
static interface |
CircuitBreaker.MetricsRecorder |
| Constructor and Description |
|---|
CircuitBreaker(FaultToleranceStrategy<V> delegate,
String description,
SetOfThrowables failOn,
SetOfThrowables skipOn,
long delayInMillis,
int requestVolumeThreshold,
double failureRatio,
int successThreshold,
Stopwatch stopwatch,
CircuitBreaker.MetricsRecorder metricsRecorder) |
| Modifier and Type | Method and Description |
|---|---|
void |
addListener(CircuitBreakerListener listener) |
V |
apply(InvocationContext<V> ctx)
Apply the fault tolerance strategy around the target
Callable. |
public CircuitBreaker(FaultToleranceStrategy<V> delegate, String description, SetOfThrowables failOn, SetOfThrowables skipOn, long delayInMillis, int requestVolumeThreshold, double failureRatio, int successThreshold, Stopwatch stopwatch, CircuitBreaker.MetricsRecorder metricsRecorder)
public V apply(InvocationContext<V> ctx) throws Exception
FaultToleranceStrategyCallable.
The Callable is wrapped in an InvocationContext.apply in interface FaultToleranceStrategy<V>ctx - the InvocationContext wrapping the Callable guarded by this fault tolerance strategyCallableException - if result couldn't be computedpublic void addListener(CircuitBreakerListener listener)
Copyright © 2018–2020. All rights reserved.