/[projects]/miscJava/CircuitBreaker/src/main/java/dk/thoerup/circuitbreaker/notification/CompositeNotifier.java
ViewVC logotype

Annotation of /miscJava/CircuitBreaker/src/main/java/dk/thoerup/circuitbreaker/notification/CompositeNotifier.java

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1099 - (hide annotations) (download)
Wed Sep 22 07:38:04 2010 UTC (13 years, 8 months ago) by torben
Original Path: CircuitBreaker/src/dk/thoerup/circuitbreaker/notification/CompositeNotifier.java
File size: 438 byte(s)
The correct name for this pattern is "Composite"
1 torben 1049 package dk.thoerup.circuitbreaker.notification;
2    
3     import java.util.ArrayList;
4     import java.util.List;
5    
6 torben 1099 public class CompositeNotifier implements Notifier {
7 torben 1049
8     List<Notifier> children = new ArrayList<Notifier>();
9    
10     public void addNotifier(Notifier notif) {
11     children.add(notif);
12     }
13    
14     public void sendNotification(String breakerName, Event evnt) {
15     for (Notifier notif : children) {
16     notif.sendNotification(breakerName, evnt);
17     }
18     }
19    
20     }

  ViewVC Help
Powered by ViewVC 1.1.20