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

    Modifier and Type
    Method
    Description
    boolean
    Is request is allowed to go through (is circuit breaker closed or opened).
    void
    Reports about failure conditions to circuit breaker.
    void
    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

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ZestCircuitBreaker

      public ZestCircuitBreaker(int threshold, long timeout)
  • Method Details

    • 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