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

Contents of /CircuitBreaker/src/dk/thoerup/circuitbreaker/notification/Log4jNotifier.java

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1161 - (show annotations) (download)
Mon Oct 4 17:36:43 2010 UTC (13 years, 7 months ago) by torben
File size: 413 byte(s)
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 package dk.thoerup.circuitbreaker.notification;
2
3
4 import org.apache.log4j.*;
5
6 import dk.thoerup.circuitbreaker.CircuitBreaker;
7
8
9 public class Log4jNotifier implements Notifier {
10
11 Logger logger = Logger.getLogger(JavaLogNotifier.class.getName());
12
13 public void sendNotification(CircuitBreaker breaker, Event evnt) {
14
15 logger.warn("Circuitbreaker " + breaker + " : " + evnt.toString());
16 }
17
18 }

  ViewVC Help
Powered by ViewVC 1.1.20