Class ExecutorCircuitBreaker

    • Constructor Summary

      Constructors 
      Constructor Description
      ExecutorCircuitBreaker​(java.lang.Integer circuitCheckIntervalInMillis)  
      ExecutorCircuitBreaker​(java.lang.Integer circuitCheckIntervalInMillis, java.time.Duration timeout)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int getCheckIntervalMillis()  
      java.util.Optional<java.time.Duration> getTimeout()  
      protected boolean isPercentageValueValid​(java.lang.Integer value)  
      <T> T run​(java.util.concurrent.Callable<T> callable)
      Runs callable and breaks it when circuit breaker is closed
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • timeout

        protected java.util.Optional<java.time.Duration> timeout
    • Constructor Detail

      • ExecutorCircuitBreaker

        public ExecutorCircuitBreaker​(java.lang.Integer circuitCheckIntervalInMillis)
      • ExecutorCircuitBreaker

        public ExecutorCircuitBreaker​(java.lang.Integer circuitCheckIntervalInMillis,
                                      java.time.Duration timeout)
    • Method Detail

      • run

        public <T> T run​(java.util.concurrent.Callable<T> callable)
        Description copied from interface: CircuitBreaker
        Runs callable and breaks it when circuit breaker is closed
        Specified by:
        run in interface CircuitBreaker
        Returns:
      • getTimeout

        public java.util.Optional<java.time.Duration> getTimeout()
      • isPercentageValueValid

        protected boolean isPercentageValueValid​(java.lang.Integer value)