/[projects]/miscJava/CircuitBreaker/src/main/java/dk/thoerup/circuitbreaker/notification/Log4jNotifier.java |
Parent Directory | Revision Log
If the Notifier gets a reference to the CircuitBreaker itself instead of the circuitbreaker's name then the same notifier instance can easily be shared across several circuitbreakers
1 | torben | 467 | package dk.thoerup.circuitbreaker.notification; |
2 | torben | 409 | |
3 | |||
4 | import org.apache.log4j.*; | ||
5 | |||
6 | torben | 1161 | import dk.thoerup.circuitbreaker.CircuitBreaker; |
7 | torben | 409 | |
8 | torben | 1161 | |
9 | torben | 409 | public class Log4jNotifier implements Notifier { |
10 | |||
11 | Logger logger = Logger.getLogger(JavaLogNotifier.class.getName()); | ||
12 | |||
13 | torben | 1161 | public void sendNotification(CircuitBreaker breaker, Event evnt) { |
14 | torben | 465 | |
15 | torben | 1161 | logger.warn("Circuitbreaker " + breaker + " : " + evnt.toString()); |
16 | torben | 409 | } |
17 | |||
18 | } |
ViewVC Help | |
Powered by ViewVC 1.1.20 |