net.wotonomy.web.xml
Class XMLRPCSelector

java.lang.Object
  extended by net.wotonomy.foundation.NSSelector
      extended by net.wotonomy.web.xml.XMLRPCSelector
All Implemented Interfaces:
java.io.Serializable, java.util.Comparator

public class XMLRPCSelector
extends net.wotonomy.foundation.NSSelector

An NSSelector customized to invoke methods with XMLRPC when a URL is passed in as the object to the invoke() method. The method name and parameters will be marshalled and sent as an XMLRPC request to the host specified by the URL.

To use this class simply as an XMLRPC client, just call invoke() with a URL referencing the XMLRPC server and an optional array of parameters.

Version:
$Revision: 905 $
Author:
michael@mpowers.net, $Author: cgruber $
See Also:
Serialized Form

Field Summary
 
Fields inherited from class net.wotonomy.foundation.NSSelector
EMPTY_CLASS_ARRAY, EMPTY_OBJECT_ARRAY, methodMap, methodName, NOT_FOUND, parameterTypes
 
Constructor Summary
XMLRPCSelector(java.lang.String aMethodName)
          Constructor specifying a method name.
XMLRPCSelector(java.lang.String aMethodName, java.lang.Class[] aParameterTypeArray)
          Constructor specifying a method name and an array of parameter types.
 
Method Summary
 java.lang.Object invoke(java.lang.Object anObject, java.lang.Object[] parameters)
          Invokes this selector's method on the specified object using the specified parameters.
static java.lang.Object invoke(java.lang.String methodName, java.lang.Class[] parameterTypes, java.lang.Object anObject, java.lang.Object aParameter)
           
static java.lang.Object invoke(java.lang.String methodName, java.lang.Class[] parameterTypes, java.lang.Object anObject, java.lang.Object[] parameters)
           
static java.lang.Object invoke(java.lang.String methodName, java.lang.Class[] parameterTypes, java.lang.Object anObject, java.lang.Object p1, java.lang.Object p2)
           
static java.lang.Object invoke(java.lang.String methodName, java.lang.Object anObject)
           
 
Methods inherited from class net.wotonomy.foundation.NSSelector
comparator, compare, equals, implementedByClass, implementedByObject, invoke, invoke, invoke, methodOnClass, methodOnObject, name, parameterTypes, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

XMLRPCSelector

public XMLRPCSelector(java.lang.String aMethodName)
Constructor specifying a method name.


XMLRPCSelector

public XMLRPCSelector(java.lang.String aMethodName,
                      java.lang.Class[] aParameterTypeArray)
Constructor specifying a method name and an array of parameter types. When accessing XMLRPC servers, invoke() does require that the specified objects match the types in the parameter type array.

Method Detail

invoke

public java.lang.Object invoke(java.lang.Object anObject,
                               java.lang.Object[] parameters)
                        throws java.lang.IllegalAccessException,
                               java.lang.IllegalArgumentException,
                               java.lang.reflect.InvocationTargetException,
                               java.lang.NoSuchMethodException
Invokes this selector's method on the specified object using the specified parameters.

Overrides:
invoke in class net.wotonomy.foundation.NSSelector
Throws:
java.lang.IllegalAccessException
java.lang.IllegalArgumentException
java.lang.reflect.InvocationTargetException
java.lang.NoSuchMethodException

invoke

public static java.lang.Object invoke(java.lang.String methodName,
                                      java.lang.Class[] parameterTypes,
                                      java.lang.Object anObject,
                                      java.lang.Object[] parameters)
                               throws java.lang.IllegalAccessException,
                                      java.lang.IllegalArgumentException,
                                      java.lang.reflect.InvocationTargetException,
                                      java.lang.NoSuchMethodException
Throws:
java.lang.IllegalAccessException
java.lang.IllegalArgumentException
java.lang.reflect.InvocationTargetException
java.lang.NoSuchMethodException

invoke

public static java.lang.Object invoke(java.lang.String methodName,
                                      java.lang.Object anObject)
                               throws java.lang.IllegalAccessException,
                                      java.lang.IllegalArgumentException,
                                      java.lang.reflect.InvocationTargetException,
                                      java.lang.NoSuchMethodException
Throws:
java.lang.IllegalAccessException
java.lang.IllegalArgumentException
java.lang.reflect.InvocationTargetException
java.lang.NoSuchMethodException

invoke

public static java.lang.Object invoke(java.lang.String methodName,
                                      java.lang.Class[] parameterTypes,
                                      java.lang.Object anObject,
                                      java.lang.Object aParameter)
                               throws java.lang.IllegalAccessException,
                                      java.lang.IllegalArgumentException,
                                      java.lang.reflect.InvocationTargetException,
                                      java.lang.NoSuchMethodException
Throws:
java.lang.IllegalAccessException
java.lang.IllegalArgumentException
java.lang.reflect.InvocationTargetException
java.lang.NoSuchMethodException

invoke

public static java.lang.Object invoke(java.lang.String methodName,
                                      java.lang.Class[] parameterTypes,
                                      java.lang.Object anObject,
                                      java.lang.Object p1,
                                      java.lang.Object p2)
                               throws java.lang.IllegalAccessException,
                                      java.lang.IllegalArgumentException,
                                      java.lang.reflect.InvocationTargetException,
                                      java.lang.NoSuchMethodException
Throws:
java.lang.IllegalAccessException
java.lang.IllegalArgumentException
java.lang.reflect.InvocationTargetException
java.lang.NoSuchMethodException


Copyright © 2006 null. All Rights Reserved.