private static final Map<String, Boolean> CONFIGURED_BREAKERS = new ConcurrentHashMap<String, Boolean>();
@Override
public Object execute(final Invoker invoker) {
CircuitBreakerAttribute attr = invoker.getCircuitBreakerAttribute();
String circuitBreakerName = determineCommandName(attr);
String circuitBreakerGroup = determineGroupName(attr);
String threadPoolName = determineThreadPoolName(attr);
if (!CONFIGURED_BREAKERS.containsKey(circuitBreakerName)) {
synchronized (circuitBreakerName) {
if (!CONFIGURED_BREAKERS.containsKey(circuitBreakerName)) {
for (Map.Entry<String, String> entry : attr.getProperties().entrySet()) {
String commandKey = String.format(INSTANCE_COMMAND_PROP_KEY_FORMAT, circuitBreakerName, entry.getKey());
ConfigurationManager.getConfigInstance().setProperty(commandKey, entry.getValue());
String threadPoolKey = String.format(INSTANCE_THREADPOOL_PROP_KEY_FORMAT, threadPoolName, entry.getKey());
ConfigurationManager.getConfigInstance().setProperty(threadPoolKey, entry.getValue());
String collapserKey = String.format(INSTANCE_COLLAPSER_PROP_KEY_FORMAT, threadPoolName, entry.getKey());