34 |
int timeout = Integer.parseInt( sce.getServletContext().getInitParameter("banedk_timeout") ); |
int timeout = Integer.parseInt( sce.getServletContext().getInitParameter("banedk_timeout") ); |
35 |
CircuitBreakerManager mgr = CircuitBreakerManager.getManager(); |
CircuitBreakerManager mgr = CircuitBreakerManager.getManager(); |
36 |
|
|
|
|
|
|
AccountingCircuitBreaker banedk = new AccountingCircuitBreaker("banedk", threshold, timeout); |
|
37 |
CompositeNotifier notif = new CompositeNotifier(); |
CompositeNotifier notif = new CompositeNotifier(); |
38 |
notif.addNotifier( new JavaLogNotifier() ); |
notif.addNotifier( new JavaLogNotifier() ); |
39 |
notif.addNotifier( new MailNotifier(banedk,"traininfo@t-hoerup.dk", "torben@t-hoerup.dk", "192.168.10.5") ); |
notif.addNotifier( new MailNotifier("traininfo@t-hoerup.dk", "torben@t-hoerup.dk", "192.168.10.5") ); |
40 |
|
|
41 |
|
|
42 |
|
AccountingCircuitBreaker banedk = new AccountingCircuitBreaker("banedk", threshold, timeout); |
43 |
banedk.setNotifier(notif); |
banedk.setNotifier(notif); |
44 |
mgr.addCircuitBreaker( banedk ); |
mgr.addCircuitBreaker( banedk ); |
45 |
|
|
46 |
|
|
47 |
AccountingCircuitBreaker metro = new AccountingCircuitBreaker("metro", threshold, timeout); |
AccountingCircuitBreaker metro = new AccountingCircuitBreaker("metro", threshold, timeout); |
48 |
notif = new CompositeNotifier(); |
metro.setNotifier(notif); |
|
notif.addNotifier( new JavaLogNotifier() ); |
|
|
notif.addNotifier( new MailNotifier(banedk,"traininfo@t-hoerup.dk", "torben@t-hoerup.dk", "192.168.10.5") ); |
|
|
banedk.setNotifier(notif); |
|
49 |
mgr.addCircuitBreaker( metro ); |
mgr.addCircuitBreaker( metro ); |
50 |
|
|
51 |
JMXWrapper.registerAllCircuitBreakers(); |
JMXWrapper.registerAllCircuitBreakers(); |