Class 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 
      Constructor Description
      ZestCircuitBreaker​(int threshold, long timeout)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean allowRequest()
      Is request is allowed to go through (is circuit breaker closed or opened).
      void markFailure​(Throwable cause)
      Reports about failure conditions to circuit breaker.
      void markSuccess()
      Reports 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 Detail

      • ZestCircuitBreaker

        public ZestCircuitBreaker​(int threshold,
                                  long timeout)
    • Method Detail

      • allowRequest

        public boolean allowRequest()
        Description copied from interface: CircuitBreaker
        Is request is allowed to go through (is circuit breaker closed or opened).
        Specified by:
        allowRequest in interface CircuitBreaker
        Returns:
        "false" if circuit breaker is open, "true" otherwise
      • markFailure

        public void markFailure​(Throwable cause)
        Description copied from interface: CircuitBreaker
        Reports about failure conditions to circuit breaker.
        Specified by:
        markFailure in interface CircuitBreaker
        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: CircuitBreaker
        Reports about successful invocation to circuit breaker.
        Specified by:
        markSuccess in interface CircuitBreaker