public class ClientFactory extends Object
The 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 ClientFactory
to
obtain an implementation, which is based on running XML-RPC calls.
Constructor and Description |
---|
ClientFactory(XmlRpcClient pClient)
Creates a new instance.
|
ClientFactory(XmlRpcClient pClient,
TypeConverterFactory pTypeConverterFactory)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
XmlRpcClient |
getClient()
Returns the factories client.
|
boolean |
isObjectMethodLocal()
Returns, whether a method declared by the
Object class is performed by the local object, rather than
by the server. |
Object |
newInstance(Class pClass)
Creates an object, which is implementing the given interface.
|
Object |
newInstance(ClassLoader pClassLoader,
Class pClass)
Creates an object, which is implementing the given interface.
|
Object |
newInstance(ClassLoader pClassLoader,
Class pClass,
String pRemoteName)
Creates an object, which is implementing the given interface.
|
void |
setObjectMethodLocal(boolean pObjectMethodLocal)
Sets, whether a method declared by the
Object class is performed by the local object, rather than
by the server. |
public ClientFactory(XmlRpcClient pClient, TypeConverterFactory pTypeConverterFactory)
pClient
- A fully configured XML-RPC client, which is
used internally to perform XML-RPC calls.pTypeConverterFactory
- Creates instances of TypeConverterFactory
,
which are used to transform the result object in its target representation.public ClientFactory(XmlRpcClient pClient)
new ClientFactory(pClient, new TypeConverterFactoryImpl());
pClient
- A fully configured XML-RPC client, which is
used internally to perform XML-RPC calls.TypeConverterFactoryImpl
public XmlRpcClient getClient()
public boolean isObjectMethodLocal()
Object class
is performed by the local object, rather than
by the server. Defaults to true.public void setObjectMethodLocal(boolean pObjectMethodLocal)
Object class
is performed by the local object, rather than
by the server. Defaults to true.public Object newInstance(Class pClass)
newInstance(Thread.currentThread().getContextClassLoader(), pClass)
public Object newInstance(ClassLoader pClassLoader, Class pClass)
newInstance(pClassLoader, pClass, pClass.getName())
public Object newInstance(ClassLoader pClassLoader, Class pClass, String pRemoteName)
pClassLoader
- The class loader, which is being used for
loading classes, if required.pClass
- Interface, which is being implemented.pRemoteName
- Handler name, which is being used when
calling the server. This is used for composing the
method name. For example, if pRemoteName
is "Foo" and you want to invoke the method "bar" in
the handler, then the full method name would be "Foo.bar".Copyright © 2001-2014 The Apache Software Foundation. All Rights Reserved.