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