/[projects]/CircuitBreaker/src/dk/thoerup/circuitbreaker/CircuitBreaker.java
ViewVC logotype

Diff of /CircuitBreaker/src/dk/thoerup/circuitbreaker/CircuitBreaker.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1161 by torben, Mon Oct 4 17:36:43 2010 UTC revision 1314 by torben, Tue Apr 19 17:12:27 2011 UTC
# Line 4  package dk.thoerup.circuitbreaker; Line 4  package dk.thoerup.circuitbreaker;
4  import java.util.concurrent.ExecutorService;  import java.util.concurrent.ExecutorService;
5  import java.util.concurrent.Executors;  import java.util.concurrent.Executors;
6    
7    import dk.thoerup.circuitbreaker.config.BreakerConfig;
8    import dk.thoerup.circuitbreaker.config.StaticConfig;
9    import dk.thoerup.circuitbreaker.notification.NotiferHelper;
10  import dk.thoerup.circuitbreaker.notification.Notifier;  import dk.thoerup.circuitbreaker.notification.Notifier;
11  import dk.thoerup.circuitbreaker.notification.NullNotifier;  import dk.thoerup.circuitbreaker.notification.NullNotifier;
12    
# Line 57  public class CircuitBreaker{ Line 60  public class CircuitBreaker{
60          private ExecutorService executor = null;                  private ExecutorService executor = null;        
61          private Notifier notifier = new NullNotifier();          private Notifier notifier = new NullNotifier();
62                    
63          public CircuitBreaker(String name, int threshold, long timeoutMS) {          /*public CircuitBreaker(String name, int threshold, int timeoutMS) {
64                  closed.setThreshold(threshold);                  this(name, new StaticConfig(threshold, timeoutMS) );
65                  open.setTimeout(timeoutMS);          }*/
66            
67            public CircuitBreaker(String name, BreakerConfig config) {
68                    closed.setThreshold(config);
69                    open.setTimeout(config);
70                                    
71                  this.name = name;                  this.name = name;
72                    
# Line 187  public class CircuitBreaker{ Line 194  public class CircuitBreaker{
194          this.notifier = notifier;          this.notifier = notifier;
195      }      }
196            
197      public String getNotifierName() {      public String getNotifierName() {
198          return notifier.getClass().getName();          return NotiferHelper.getName(notifier);
199      }      }
200            
201      public synchronized ExecutorService getExecutor() {      public synchronized ExecutorService getExecutor() {

Legend:
Removed from v.1161  
changed lines
  Added in v.1314

  ViewVC Help
Powered by ViewVC 1.1.20