marquee.xmlrpc.objectcomm
Class Proxy

java.lang.Object
  extended bymarquee.xmlrpc.XmlRpcProxy
      extended bymarquee.xmlrpc.objectcomm.Proxy
All Implemented Interfaces:
java.lang.reflect.InvocationHandler

public class Proxy
extends XmlRpcProxy

Performs the same tasks as the XmlRpcProxy but also supports arbitrary Java objects as return values. It relies on the Serializer which serializes Java objects as structs and InvocationProcessor which is able to rebuild the object parameters on the server side.

Before Proxy may be used the Serializer must be added to the XmlRpcSerializer mechanism on both the server and the client side and the InvocationProcessor must be registered with the XmlRpcServer.

Since:
JDK 1.3
Version:
$Revision: 1.3 $
Author:
Rainer Bischof
See Also:
XmlRpcProxy, marquee.xmlrpc.objectcomms.Serializer, marquee.xmlrpc.objectcomms.InvocationProcessor

Method Summary
static java.lang.Object createProxy(java.lang.String host, int port, java.lang.String path, java.lang.Class[] interfaces)
          Creates a new dynamic proxy object that implements all supplied interfaces.
static java.lang.Object createProxy(java.lang.String host, int port, java.lang.String path, java.lang.String objectName, java.lang.Class[] interfaces)
          Creates a new dynamic proxy object that implements all supplied interfaces.
static java.lang.Object createProxy(java.net.URL url, java.lang.Class[] interfaces)
          Creates a new dynamic proxy object that implements all supplied interfaces.
static java.lang.Object createProxy(java.net.URL url, java.lang.String objectName, java.lang.Class[] interfaces)
          Creates a new dynamic proxy object that implements all supplied interfaces.
 java.lang.Object invoke(java.lang.Object proxy, java.lang.reflect.Method method, java.lang.Object[] args)
          Handles method calles invoked on the proxy object.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

createProxy

public static java.lang.Object createProxy(java.lang.String host,
                                           int port,
                                           java.lang.String path,
                                           java.lang.Class[] interfaces)
                                    throws XmlRpcException
Description copied from class: XmlRpcProxy
Creates a new dynamic proxy object that implements all supplied interfaces. This object may be type cast to any of the interface supplied in the call. Method calls through the interfaces will be translated to XML-RPC calls to the server at the supplied host, port and path.

Throws:
XmlRpcException

createProxy

public static java.lang.Object createProxy(java.lang.String host,
                                           int port,
                                           java.lang.String path,
                                           java.lang.String objectName,
                                           java.lang.Class[] interfaces)
                                    throws XmlRpcException
Description copied from class: XmlRpcProxy
Creates a new dynamic proxy object that implements all supplied interfaces. This object may be type cast to any of the interface supplied in the call. Method calls through the interfaces will be translated to XML-RPC calls to the server at the supplied host, port and path.

Throws:
XmlRpcException

createProxy

public static java.lang.Object createProxy(java.net.URL url,
                                           java.lang.Class[] interfaces)
                                    throws XmlRpcException
Description copied from class: XmlRpcProxy
Creates a new dynamic proxy object that implements all supplied interfaces. This object may be type cast to any of the interface supplied in the call. Method calls through the interfaces will be translated to XML-RPC calls to the server in the supplied url.

Throws:
XmlRpcException

createProxy

public static java.lang.Object createProxy(java.net.URL url,
                                           java.lang.String objectName,
                                           java.lang.Class[] interfaces)
                                    throws XmlRpcException
Description copied from class: XmlRpcProxy
Creates a new dynamic proxy object that implements all supplied interfaces. This object may be type cast to any of the interface supplied in the call. Method calls through the interfaces will be translated to XML-RPC calls to the server in the supplied url.

Throws:
XmlRpcException

invoke

public java.lang.Object invoke(java.lang.Object proxy,
                               java.lang.reflect.Method method,
                               java.lang.Object[] args)
                        throws java.lang.Throwable
Description copied from class: XmlRpcProxy
Handles method calles invoked on the proxy object. This is not used by the application but has to be public so that the dynamic proxy has access to it. Just hand call over to the performCall method

Specified by:
invoke in interface java.lang.reflect.InvocationHandler
Overrides:
invoke in class XmlRpcProxy
Returns:
Any of the values returned by an XmlRpcClient
Throws:
java.lang.Throwable