Class CircuitBreaker<V>
java.lang.Object
io.smallrye.faulttolerance.core.circuit.breaker.CircuitBreaker<V>
- All Implemented Interfaces:
FaultToleranceStrategy<V>
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final int -
Constructor Summary
ConstructorsConstructorDescriptionCircuitBreaker(FaultToleranceStrategy<V> delegate, String description, ExceptionDecision exceptionDecision, long delayInMillis, int requestVolumeThreshold, double failureRatio, int successThreshold, Stopwatch stopwatch, Timer timer) -
Method Summary
Modifier and TypeMethodDescriptionapply(FaultToleranceContext<V> ctx) Apply the fault tolerance strategy around the targetCallable.intvoidreset()
-
Field Details
-
STATE_CLOSED
public static final int STATE_CLOSED- See Also:
-
STATE_OPEN
public static final int STATE_OPEN- See Also:
-
STATE_HALF_OPEN
public static final int STATE_HALF_OPEN- See Also:
-
-
Constructor Details
-
CircuitBreaker
public CircuitBreaker(FaultToleranceStrategy<V> delegate, String description, ExceptionDecision exceptionDecision, long delayInMillis, int requestVolumeThreshold, double failureRatio, int successThreshold, Stopwatch stopwatch, Timer timer)
-
-
Method Details
-
apply
Description copied from interface:FaultToleranceStrategyApply the fault tolerance strategy around the targetCallable. TheCallableis wrapped in anFaultToleranceContext.- Specified by:
applyin interfaceFaultToleranceStrategy<V>- Parameters:
ctx- theInvocationContextwrapping theCallableguarded by this fault tolerance strategy- Returns:
- result computed by the target
Callable
-
currentState
public int currentState() -
reset
public void reset()
-