org.apache.xmlrpc.client.util

Class ClientFactory

public class ClientFactory extends Object

The {@link ClientFactory} is a useful tool for simplifying the use of Apache XML-RPC. The rough idea is as follows: All XML-RPC handlers are implemented as interfaces. The server uses the actual implementation. The client uses the {@link ClientFactory} to obtain an implementation, which is based on running XML-RPC calls.

Constructor Summary
ClientFactory(XmlRpcClient pClient, TypeConverterFactory pTypeConverterFactory)
Creates a new instance.
ClientFactory(XmlRpcClient pClient)
Creates a new instance.
Method Summary
XmlRpcClientgetClient()
Returns the factories client.
booleanisObjectMethodLocal()
Returns, whether a method declared by the {@link Object Object class} is performed by the local object, rather than by the server.
ObjectnewInstance(Class pClass)
Creates an object, which is implementing the given interface.
ObjectnewInstance(ClassLoader pClassLoader, Class pClass)
Creates an object, which is implementing the given interface.
voidsetObjectMethodLocal(boolean pObjectMethodLocal)
Sets, whether a method declared by the {@link Object Object class} is performed by the local object, rather than by the server.

Constructor Detail

ClientFactory

public ClientFactory(XmlRpcClient pClient, TypeConverterFactory pTypeConverterFactory)
Creates a new instance.

Parameters: pClient A fully configured XML-RPC client, which is used internally to perform XML-RPC calls. pTypeConverterFactory Creates instances of {@link TypeConverterFactory}, which are used to transform the result object in its target representation.

ClientFactory

public ClientFactory(XmlRpcClient pClient)
Creates a new instance. Shortcut for
   new ClientFactory(pClient, new TypeConverterFactoryImpl());
 

Parameters: pClient A fully configured XML-RPC client, which is used internally to perform XML-RPC calls.

See Also: TypeConverterFactoryImpl

Method Detail

getClient

public XmlRpcClient getClient()
Returns the factories client.

isObjectMethodLocal

public boolean isObjectMethodLocal()
Returns, whether a method declared by the {@link Object Object class} is performed by the local object, rather than by the server. Defaults to true.

newInstance

public Object newInstance(Class pClass)
Creates an object, which is implementing the given interface. The objects methods are internally calling an XML-RPC server by using the factories client.

newInstance

public Object newInstance(ClassLoader pClassLoader, Class pClass)
Creates an object, which is implementing the given interface. The objects methods are internally calling an XML-RPC server by using the factories client.

setObjectMethodLocal

public void setObjectMethodLocal(boolean pObjectMethodLocal)
Sets, whether a method declared by the {@link Object Object class} is performed by the local object, rather than by the server. Defaults to true.
Copyright © 2001-2007 Apache Software Foundation. All Rights Reserved.