Class ZestCircuitBreaker
java.lang.Object
org.qi4j.library.circuitbreaker.CircuitBreaker
org.apache.cxf.clustering.circuitbreaker.ZestCircuitBreaker
- All Implemented Interfaces:
CircuitBreaker
public class ZestCircuitBreaker
extends org.qi4j.library.circuitbreaker.CircuitBreaker
implements CircuitBreaker
-
Nested Class Summary
Nested classes/interfaces inherited from class org.qi4j.library.circuitbreaker.CircuitBreaker
org.qi4j.library.circuitbreaker.CircuitBreaker.Status -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanIs request is allowed to go through (is circuit breaker closed or opened).voidmarkFailure(Throwable cause) Reports about failure conditions to circuit breaker.voidReports about successful invocation to circuit breaker.Methods inherited from class org.qi4j.library.circuitbreaker.CircuitBreaker
addPropertyChangeListener, addVetoableChangeListener, enabledOn, isOn, lastThrowable, removePropertyChangeListener, removeVetoableChangeListener, serviceLevel, status, success, threshold, throwable, trip, trippedOn, turnOn
-
Constructor Details
-
ZestCircuitBreaker
public ZestCircuitBreaker(int threshold, long timeout)
-
-
Method Details
-
allowRequest
public boolean allowRequest()Description copied from interface:CircuitBreakerIs request is allowed to go through (is circuit breaker closed or opened).- Specified by:
allowRequestin interfaceCircuitBreaker- Returns:
- "false" if circuit breaker is open, "true" otherwise
-
markFailure
Description copied from interface:CircuitBreakerReports about failure conditions to circuit breaker.- Specified by:
markFailurein interfaceCircuitBreaker- Parameters:
cause- exception happened (could be null in case the error is deducted from response status/code).
-
markSuccess
public void markSuccess()Description copied from interface:CircuitBreakerReports about successful invocation to circuit breaker.- Specified by:
markSuccessin interfaceCircuitBreaker
-