@Override
public Object execute(Invoker invoker) {
String declaredManager = invoker.getCircuitBreakerAttribute().getCircuitManager();
CircuitManager applicableCircuitManager = null;
for (CircuitManager manager : circuitManagers) {
if (manager != null) {
for (Map.Entry<String, ? extends CircuitManager> entry : applicationContext.getBeansOfType(manager.getClass()).entrySet()) {
if (entry.getKey().equals(declaredManager)) {
applicableCircuitManager = entry.getValue();
}
}
}
}
if (applicableCircuitManager == null && fallbackToNoOpCircuitManager) {
applicableCircuitManager = new NoOpCircuitManager();
}
return applicableCircuitManager.execute(invoker);
}