1 |
package dk.thoerup.circuitbreaker.notification; |
2 |
|
3 |
import java.util.ArrayList; |
4 |
import java.util.List; |
5 |
|
6 |
import dk.thoerup.circuitbreaker.CircuitBreaker; |
7 |
import dk.thoerup.circuitbreaker.Event; |
8 |
|
9 |
public class CompositeNotifier implements Notifier { |
10 |
|
11 |
List<Notifier> children = new ArrayList<Notifier>(); |
12 |
|
13 |
public void addNotifier(Notifier notif) { |
14 |
children.add(notif); |
15 |
} |
16 |
|
17 |
public void sendNotification(CircuitBreaker breaker, Event evnt) { |
18 |
for (Notifier notif : children) { |
19 |
notif.sendNotification(breaker, evnt); |
20 |
} |
21 |
} |
22 |
|
23 |
} |