1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.apache.juddi.servlets;
17
18 import java.io.IOException;
19 import java.io.PrintWriter;
20 import java.util.Iterator;
21
22 import javax.servlet.ServletException;
23 import javax.servlet.http.HttpServlet;
24 import javax.servlet.http.HttpServletRequest;
25 import javax.servlet.http.HttpServletResponse;
26
27 import org.apache.commons.collections.Buffer;
28 import org.apache.juddi.subscription.NotificationList;
29
30
31
32
33
34
35
36
37
38 public class NotifyServlet extends HttpServlet
39 {
40 private static final long serialVersionUID = 4862936257096400737L;
41
42 @SuppressWarnings("unchecked")
43 public void doGet(HttpServletRequest request,
44 HttpServletResponse response) throws
45 ServletException, IOException {
46 StringBuffer sb = new StringBuffer();
47
48 Buffer nl = NotificationList.getInstance().getNotifications();
49 Iterator<String> it = nl.iterator();
50 while (it.hasNext()) {
51 String notification = (String) it.next();
52 sb.append(notification);
53 }
54 nl.clear();
55 PrintWriter out = response.getWriter();
56 out.println(sb.toString());
57 }
58 }