1 16 17 18 package org.apache.xmlrpc; 19 20 import java.io.InputStream ; 21 import java.util.Vector ; 22 23 32 public class XmlRpcRequestProcessor extends XmlRpc 33 { 34 private Vector requestParams; 35 36 39 public XmlRpcRequestProcessor() 40 { 41 requestParams = new Vector (); 42 } 43 44 53 public XmlRpcServerRequest decodeRequest(InputStream is) 54 { 55 long now = 0; 56 57 if (XmlRpc.debug) 58 { 59 now = System.currentTimeMillis(); 60 } 61 try 62 { 63 try 64 { 65 parse(is); 66 } 67 catch (Exception e) 68 { 69 throw new ParseFailed(e); 70 } 71 if (XmlRpc.debug) 72 { 73 System.out.println("XML-RPC method name: " + methodName); 74 System.out.println("Request parameters: " + requestParams); 75 } 76 if (errorLevel > NONE) 78 { 79 throw new ParseFailed(errorMsg); 80 } 81 82 return new XmlRpcRequest(methodName, (Vector ) requestParams.clone()); 83 } 84 finally 85 { 86 requestParams.removeAllElements(); 87 if (XmlRpc.debug) 88 { 89 System.out.println("Spent " + (System.currentTimeMillis() - now) 90 + " millis decoding request"); 91 } 92 } 93 } 94 95 101 protected void objectParsed(Object what) 102 { 103 requestParams.addElement(what); 104 } 105 } 106 | Popular Tags |