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