所有已知实现类:
AbstractCircuitBreaker, ExceptionCircuitBreaker, ResponseTimeCircuitBreaker

public interface CircuitBreaker

Basic circuit breaker interface.

作者:
Eric Zhao
  • 嵌套类概要

    嵌套类
    修饰符和类型
    接口
    说明
    static enum 
    Circuit breaker state.
  • 方法概要

    修饰符和类型
    方法
    说明
    Get current state of the circuit breaker.
    Get the associated circuit breaking rule.
    void
    Record a completed request with the context and handle state transformation of the circuit breaker.
    boolean
    tryPass(Context context)
    Acquires permission of an invocation only if it is available at the time of invoking.
  • 方法详细资料

    • getRule

      DegradeRule getRule()
      Get the associated circuit breaking rule.
      返回:
      associated circuit breaking rule
    • tryPass

      boolean tryPass(Context context)
      Acquires permission of an invocation only if it is available at the time of invoking.
      参数:
      context - context of current invocation
      返回:
      true if permission was acquired and false otherwise
    • currentState

      CircuitBreaker.State currentState()
      Get current state of the circuit breaker.
      返回:
      current state of the circuit breaker
    • onRequestComplete

      void onRequestComplete(Context context)

      Record a completed request with the context and handle state transformation of the circuit breaker.

      Called when a passed invocation finished.

      参数:
      context - context of current invocation