18 |
} |
} |
19 |
|
|
20 |
@Override |
@Override |
21 |
public Object invoke(CircuitInvocation invocation) throws Throwable { |
public Object invoke(CircuitInvocation invocation) throws Exception { |
22 |
Object result; |
Object result; |
23 |
try { |
try { |
24 |
totalCallCount.incrementAndGet(); |
totalCallCount.incrementAndGet(); |
25 |
result = super.invoke(invocation); |
result = super.invoke(invocation); |
26 |
} catch (Throwable t) { |
} catch (Exception e) { |
27 |
if (t instanceof CircuitBreakerException) { |
if (e instanceof CircuitBreakerException) { |
28 |
blockCount.incrementAndGet(); |
blockCount.incrementAndGet(); |
29 |
} else { |
} else { |
30 |
totalFailureCount.incrementAndGet(); |
totalFailureCount.incrementAndGet(); |
31 |
} |
} |
32 |
throw t; |
throw e; |
33 |
} |
} |
34 |
|
|
35 |
return result; |
return result; |