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.XMLRPCDataSource; 17 import org.openlaszlo.utils.FileUtils; 18 import org.apache.log4j.Logger; 19 20 public final class ResponderXMLRPCINFO extends ResponderAdmin 21 { 22 private static Logger mLogger = Logger.getLogger(ResponderXMLRPCINFO.class); 23 24 boolean ok(String opt) { 25 return opt != null && opt.equals("1"); 26 } 27 28 31 protected void respondAdmin(HttpServletRequest req, HttpServletResponse res) 32 throws IOException { 33 res.setContentType ("text/xml"); 34 ServletOutputStream out = res.getOutputStream(); 35 try { 36 if (ok(req.getParameter("clear"))) { 37 XMLRPCDataSource.clearLoadInfo(); 38 } 39 StringBuffer sb = new StringBuffer (); 40 XMLRPCDataSource.toXML(sb); 41 out.println(sb.toString()); 42 } finally { 43 FileUtils.close(out); 44 } 45 } 46 47 public int getMimeType() 48 { 49 return MIME_TYPE_XML; 50 } 51 } 52 | Popular Tags |