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 |
|
|
} |