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
-
-
Constructor Summary
Constructors Constructor Description ZestCircuitBreaker(int threshold, long timeout)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanallowRequest()Is request is allowed to go through (is circuit breaker closed or opened).voidmarkFailure(Throwable cause)Reports about failure conditions to circuit breaker.voidmarkSuccess()Reports about successful invocation to circuit breaker.
-
-
-
Method Detail
-
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
public void markFailure(Throwable cause)
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
-
-