--- CircuitBreaker/src/dk/thoerup/circuitbreaker/CircuitBreaker.java 2011/04/19 15:07:23 1305 +++ CircuitBreaker/src/dk/thoerup/circuitbreaker/CircuitBreaker.java 2011/04/19 15:22:09 1306 @@ -4,6 +4,8 @@ import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; +import dk.thoerup.circuitbreaker.config.BreakerConfig; +import dk.thoerup.circuitbreaker.config.StaticConfig; import dk.thoerup.circuitbreaker.notification.NotiferHelper; import dk.thoerup.circuitbreaker.notification.Notifier; import dk.thoerup.circuitbreaker.notification.NullNotifier; @@ -58,9 +60,13 @@ private ExecutorService executor = null; private Notifier notifier = new NullNotifier(); - public CircuitBreaker(String name, int threshold, long timeoutMS) { - closed.setThreshold(threshold); - open.setTimeout(timeoutMS); + public CircuitBreaker(String name, int threshold, int timeoutMS) { + this(name, new StaticConfig(threshold, timeoutMS) ); + } + + public CircuitBreaker(String name, BreakerConfig config) { + closed.setThreshold(config); + open.setTimeout(config); this.name = name;