class CircuitBreaker implements MonitoredService, ServiceWrapper {

    public <V> V invoke(Callable<V> c) throws Exception {
        if (!byPass) {
            if (!allowRequest()) {
                throw mapException(new CircuitBreakerException());
            }

            try {
                isAttemptLive = true;
                V result = c.call();
                close();
                return result;
            } catch (Throwable cause) {
                handleFailure(cause);
            }
            throw new IllegalStateException("not possible");
        }
        else {
            return c.call();
        }
    }

    public  CircuitBreaker();
    public  CircuitBreaker(String name);
    public  CircuitBreaker(FailureInterpreter fi);
    public  CircuitBreaker(String name, FailureInterpreter fi);
    public  CircuitBreaker(String name, CircuitBreakerExceptionMapper<? extends Exception> mapper);
    public  CircuitBreaker(String name,
                          FailureInterpreter fi,
                          CircuitBreakerExceptionMapper<? extends Exception> mapper);

}