1 4 5 9 10 package org.openlaszlo.servlets.responders; 11 12 import java.io.*; 13 import javax.servlet.http.HttpServletRequest ; 14 import javax.servlet.http.HttpServletResponse ; 15 import javax.servlet.ServletOutputStream ; 16 import org.openlaszlo.data.SOAPDataSource; 17 import org.openlaszlo.utils.FileUtils; 18 import org.apache.log4j.Logger; 19 20 public final class ResponderSOAPINFO extends ResponderAdmin 21 { 22 private static Logger mLogger = Logger.getLogger(ResponderSOAPINFO.class); 23 24 boolean ok(String opt) { 25 return opt != null && opt.equals("1"); 26 } 27 28 33 protected void respondAdmin(HttpServletRequest req, HttpServletResponse res) 34 throws IOException { 35 res.setContentType ("text/xml"); 36 ServletOutputStream out = res.getOutputStream(); 37 try { 38 if (ok(req.getParameter("clear"))) { 39 SOAPDataSource.clearLoadInfo(); 40 } 41 String service = req.getParameter("service"); 42 StringBuffer sb = new StringBuffer (); 43 if (service != null && ! service.equals("")) { 44 SOAPDataSource.serviceXML(sb, service); 45 } else { 46 SOAPDataSource.toXML(sb); 47 } 48 out.println(sb.toString()); 49 } finally { 50 FileUtils.close(out); 51 } 52 } 53 54 public int getMimeType() 55 { 56 return MIME_TYPE_XML; 57 } 58 } 59 | Popular Tags |