/[projects]/CircuitBreaker/src/dk/thoerup/circuitbreaker/notification/NotiferHelper.java
ViewVC logotype

Contents of /CircuitBreaker/src/dk/thoerup/circuitbreaker/notification/NotiferHelper.java

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1289 - (show annotations) (download)
Mon Apr 11 16:05:10 2011 UTC (13 years, 1 month ago) by torben
File size: 579 byte(s)
Expose more details about the current notifier
1 package dk.thoerup.circuitbreaker.notification;
2
3 public class NotiferHelper {
4 public static String getName(Notifier notif) {
5 StringBuilder sb = new StringBuilder();
6 sb.append(notif.getClass().getSimpleName());
7
8 if (notif instanceof CompositeNotifier) {
9 CompositeNotifier composite = (CompositeNotifier) notif;
10 sb.append("(");
11 for (int i=0; i<composite.children.size(); i++) {
12 Notifier n = composite.children.get(i);
13
14 if (i > 0) {
15 sb.append(",");
16 }
17 sb.append( getName(n) );
18 }
19 sb.append(")");
20 }
21
22 return sb.toString();
23 }
24 }

  ViewVC Help
Powered by ViewVC 1.1.20