oscript.data
Class XmlRpcClient

java.lang.Object
  extended by oscript.data.Value
      extended by oscript.data.OObject
          extended by oscript.data.XmlRpcClient
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
XmlRpcClientLite

public class XmlRpcClient
extends oscript.data.OObject

A wrapper for the Apacle XML-RPC client library. For example:

   var client = new XmlRpcClient("http://hostname:port/uri");
   var adder  = client.adder;
   var multiplier = client.multiplier;
   
   writeln( adder.plus( 1, 2 ) );
   writeln( multiplier.times( 2, 3 ) );
 

Author:
Rob Clark (rob@ti.com)
See Also:
Serialized Form

Field Summary
static java.lang.String[] MEMBER_NAMES
           
static java.lang.String PARENT_TYPE_NAME
           
static oscript.data.Value TYPE
          The type object for an instance of XmlRpcClient.
static java.lang.String TYPE_NAME
           
 
Fields inherited from class oscript.data.OObject
EMPTY_EXPR_LIST_EVALUATOR
 
Fields inherited from class oscript.data.Value
DEBUG, NULL, UNDEFINED
 
Constructor Summary
protected XmlRpcClient()
          Class Constructor.
  XmlRpcClient(oscript.util.MemberTable args)
          Class Constructor.
  XmlRpcClient(java.lang.String url)
          Class Constructor.
 
Method Summary
protected static java.lang.String argsToStr(oscript.util.MemberTable args, int idx, int len)
           
 oscript.data.Value getMember(int id, boolean exception)
          Get a member of this object.
protected  oscript.data.Value getTypeImpl()
          Get the type of this object.
static void init()
           
protected  void setXmlRpcClient(org.apache.xmlrpc.XmlRpcClient client)
          Set the client object...
 
Methods inherited from class oscript.data.OObject
castToString, populateMemberSet
 
Methods inherited from class oscript.data.Value
_getTypeMember, _populateTypeMemberSet, bopBitwiseAnd, bopBitwiseAndR, bopBitwiseOr, bopBitwiseOrR, bopBitwiseXor, bopBitwiseXorR, bopCast, bopCastR, bopDivide, bopDivideR, bopEquals, bopEqualsR, bopGreaterThan, bopGreaterThanOrEquals, bopGreaterThanOrEqualsR, bopGreaterThanR, bopInstanceOf, bopInstanceOfR, bopLeftShift, bopLeftShiftR, bopLessThan, bopLessThanOrEquals, bopLessThanOrEqualsR, bopLessThanR, bopLogicalAnd, bopLogicalAndR, bopLogicalOr, bopLogicalOrR, bopMinus, bopMinusR, bopMultiply, bopMultiplyR, bopNotEquals, bopNotEqualsR, bopPlus, bopPlusR, bopRemainder, bopRemainderR, bopSignedRightShift, bopSignedRightShiftR, bopUnsignedRightShift, bopUnsignedRightShiftR, callAsConstructor, callAsConstructor, callAsConstructor, callAsExtends, callAsExtends, callAsExtends, callAsFunction, callAsFunction, callAsFunction, castToBoolean, castToExactNumber, castToInexactNumber, castToJavaObject, elementAt, elementsAt, getMember, getMember, getMember, getMember, getMember, getMonitor, getType, getTypeMember, getTypeMember, isA, length, memberSet, noSuchMember, opAssign, populateTypeMemberSet, readExternal, toString, unhand, uopBitwiseNot, uopDecrement, uopIncrement, uopLogicalNot, uopMinus, uopPlus, writeExternal
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

TYPE

public static final oscript.data.Value TYPE
The type object for an instance of XmlRpcClient.


PARENT_TYPE_NAME

public static final java.lang.String PARENT_TYPE_NAME
See Also:
Constant Field Values

TYPE_NAME

public static final java.lang.String TYPE_NAME
See Also:
Constant Field Values

MEMBER_NAMES

public static final java.lang.String[] MEMBER_NAMES
Constructor Detail

XmlRpcClient

protected XmlRpcClient()
Class Constructor. Remember to call setXmlRpcClient() from constructor.


XmlRpcClient

public XmlRpcClient(java.lang.String url)
             throws java.net.MalformedURLException
Class Constructor.

Parameters:
url - the URL
Throws:
java.net.MalformedURLException

XmlRpcClient

public XmlRpcClient(oscript.util.MemberTable args)
             throws java.net.MalformedURLException
Class Constructor. This is the constructor that gets called via an BuiltinType instance.

Parameters:
args - arguments to this constructor
Throws:
PackagedScriptObjectException(Exception) - if wrong number of args
java.net.MalformedURLException
Method Detail

init

public static void init()

argsToStr

protected static final java.lang.String argsToStr(oscript.util.MemberTable args,
                                                  int idx,
                                                  int len)

setXmlRpcClient

protected void setXmlRpcClient(org.apache.xmlrpc.XmlRpcClient client)
Set the client object... if a derived class uses the no-arg constructor then it must call this method, or else!

Parameters:
client - the client object

getTypeImpl

protected oscript.data.Value getTypeImpl()
Get the type of this object. The returned type doesn't have to take into account the possibility of a script type extending a built-in type, since that is handled by Value.getType().

Overrides:
getTypeImpl in class oscript.data.OObject
Returns:
the object's type

getMember

public oscript.data.Value getMember(int id,
                                    boolean exception)
                             throws oscript.exceptions.PackagedScriptObjectException
Get a member of this object.

Overrides:
getMember in class oscript.data.OObject
Parameters:
id - the id of the symbol that maps to the member
exception - whether an exception should be thrown if the member object is not resolved
Returns:
a reference to the member
Throws:
PackagedScriptObjectException(NoSuchMemberException)
oscript.exceptions.PackagedScriptObjectException