01: /*=============================================================================
02: * Copyright Texas Instruments 2003. All Rights Reserved.
03: *
04: * This program is free software; you can redistribute it and/or
05: * modify it under the terms of the GNU Lesser General Public
06: * License as published by the Free Software Foundation; either
07: * version 2 of the License, or (at your option) any later version.
08: *
09: * This program is distributed in the hope that it will be useful,
10: * but WITHOUT ANY WARRANTY; without even the implied warranty of
11: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12: * Lesser General Public License for more details.
13: *
14: * You should have received a copy of the GNU Lesser General Public
15: * License along with this library; if not, write to the Free Software
16: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17: *
18: * $ProjectHeader: OSCRIPT 0.155 Fri, 20 Dec 2002 18:34:22 -0800 rclark $
19: */
20:
21: package oscript.data;
22:
23: import oscript.exceptions.*;
24:
25: /**
26: * A wrapper for the Apacle XML-RPC client lite library. For example:
27: * <pre>
28: * var adder = new XmlRpcClientLite("http://hostname:port/adder");
29: * writeln( adder.plus( 1, 2 ) );
30: * </pre>
31: * The lite library uses it's own lightweight HTTP client implementation
32: * for better performance. This lightweight implementation does not have
33: * full HTTP support (Proxies, Redirect, etc).
34: *
35: * @author Rob Clark (rob@ti.com)
36: * <!--$Format: " * @version $Revision$"$-->
37: * @version 1.15
38: */
39: public class XmlRpcClientLite extends XmlRpcClient {
40: /**
41: * The type object for an instance of XmlRpcClientLite.
42: */
43: public final static Value TYPE = BuiltinType
44: .makeBuiltinType("oscript.data.XmlRpcClientLite");
45: public final static String PARENT_TYPE_NAME = "oscript.data.OObject";
46: public final static String TYPE_NAME = "XmlRpcClientLite";
47: public final static String[] MEMBER_NAMES = new String[] {};
48:
49: public static void init() {
50: oscript.OscriptInterpreter.getGlobalScope().createMember(
51: "XmlRpcClientLite", 0).opAssign(TYPE);
52: }
53:
54: /*=======================================================================*/
55: /**
56: * Class Constructor.
57: *
58: * @param url the URL
59: */
60: public XmlRpcClientLite(String url)
61: throws java.net.MalformedURLException {
62: super ();
63:
64: setXmlRpcClient(new org.apache.xmlrpc.XmlRpcClientLite(url));
65: }
66:
67: /*=======================================================================*/
68: /**
69: * Class Constructor. This is the constructor that gets called via an
70: * BuiltinType instance.
71: *
72: * @param args arguments to this constructor
73: * @throws PackagedScriptObjectException(Exception) if wrong number of args
74: */
75: public XmlRpcClientLite(oscript.util.MemberTable args)
76: throws java.net.MalformedURLException {
77: this (argsToStr(args, 0, 1));
78: }
79: }
80:
81: /*
82: * Local Variables:
83: * tab-width: 2
84: * indent-tabs-mode: nil
85: * mode: java
86: * c-indentation-style: java
87: * c-basic-offset: 2
88: * eval: (c-set-offset 'substatement-open '0)
89: * eval: (c-set-offset 'case-label '+)
90: * eval: (c-set-offset 'inclass '+)
91: * eval: (c-set-offset 'inline-open '0)
92: * End:
93: */
|