class CircuitBreakerBeanFactory extends CircuitBreakerFactory implements InitializingBean {

    public synchronized CircuitBreaker createCircuitBreaker(String name, CircuitBreakerConfig config) {

        CircuitBreaker circuitBreaker = findCircuitBreaker(name);

        if (circuitBreaker == null) {
            circuitBreaker = new CircuitBreakerBean(name);

            configureCircuitBreaker(name, circuitBreaker, config);

            if (mBeanExportOperations != null) {
                ObjectName objectName;

                try {
                    objectName = new ObjectName("org.fishwife.jrugged.spring:type=CircuitBreakerBean," + "name=" + name);
                } catch (MalformedObjectNameException e) {
                    throw new IllegalArgumentException("Invalid MBean Name " + name, e);

                }

                mBeanExportOperations.registerManagedResource(circuitBreaker, objectName);
            }

            addCircuitBreakerToMap(name, circuitBreaker);
        }

        return circuitBreaker;
    }

}