|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.dfki.util.xmlrpc.XmlRpc
public class XmlRpc
Offers some useful static methods for creating remote clients and do type conversion.
Nested Class Summary | |
---|---|
static class |
XmlRpc.Type
XML-RPC Type constants. |
Constructor Summary | |
---|---|
XmlRpc()
|
Method Summary | ||
---|---|---|
static
|
createClient(java.lang.Class<API> apiClass,
java.lang.String handlerName,
java.lang.String host,
int port)
Create a remote client which connects to the given host and port using the specified API. |
|
static
|
createClient(java.lang.Class<API> apiClass,
java.lang.String handlerName,
XmlRpcConnection xmlRpcConnection)
Creates a XML-RPC client for the given API class. |
|
static
|
createClient(java.lang.Class<API> apiClass,
java.lang.String handlerName,
XmlRpcConnection xmlRpcConnection,
java.lang.ClassLoader classLoader)
Creates a XML-RPC client for the given API class. |
|
static
|
createClient(java.lang.Class<API> apiClass,
XmlRpcConnection xmlRpcConnection)
|
|
static
|
createClientForClass(java.lang.Class<API> baseClass,
java.lang.String handlerName,
XmlRpcConnection xmlRpcConnection)
Creates a remote proxy for a given class. |
|
static
|
createClientForClass(java.lang.Class<API> baseClass,
java.lang.String handlerName,
XmlRpcConnection xmlRpcConnection,
java.lang.Class<?>[] parameterTypes,
java.lang.Object[] baseCtorArgs)
Creates a remote proxy for a given class. |
|
static java.util.Map<java.lang.reflect.Method,java.lang.Boolean> |
getMethodXmlRpcComplianceMap(java.lang.Class<?> apiClass)
Tests all methods of the given API whether they are XML-RPC compliant or not. |
|
static TypeConverter |
getTypeConverter()
|
|
static
|
getUserRepresentation(java.lang.Class<T> targetClass,
java.lang.Object xmlRpcRepresentation)
Converts a XML-RPC representation into an instance of the given type. |
|
static java.lang.Object |
getXmlRpcRepresentation(java.lang.Class<?> userPrepresentationType,
java.lang.Object toConvert)
Converts an instance of a certain type into a XML-RPC representation. |
|
static java.lang.Object |
getXmlRpcRepresentation(java.lang.Object toConvert)
Same as getXmlRpcRepresentation(Class, Object) . |
|
static boolean |
isTreatUnknownTypesAsBeans()
|
|
static java.util.logging.Logger |
log()
|
|
static void |
treatUnknownTypesAsBeans(boolean b)
Enables the fall-back behaviour to treat all unknown types as XmlRpcBeans (instead of throwing an exception). |
|
static void |
useAutomaticNullMasking(boolean b)
Enables/Disables the automatic null-masking ability. |
|
static boolean |
usesAutomaticNullMasking()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public XmlRpc()
Method Detail |
---|
public static java.util.logging.Logger log()
public static <API> API createClient(java.lang.Class<API> apiClass, java.lang.String handlerName, java.lang.String host, int port)
apiClass
- The client interface class.handlerName
- The name of the server-side XML-RPC handler.host
- The host the server is located at.port
- The port the server is listening at.
XmlRpcClient
.public static <API> API createClient(java.lang.Class<API> apiClass, java.lang.String handlerName, XmlRpcConnection xmlRpcConnection)
Thread.currentThread()
.
apiClass
- The client interface class.handlerName
- The name of the server-side XML-RPC handler.xmlRpcConnection
- The connection the client should connect to.
XmlRpcClient
.public static <API> API createClient(java.lang.Class<API> apiClass, java.lang.String handlerName, XmlRpcConnection xmlRpcConnection, java.lang.ClassLoader classLoader)
Thread.currentThread()
.
apiClass
- The client interface class.handlerName
- The name of the server-side XML-RPC handler.xmlRpcConnection
- The connection the client should connect to.classLoader
- The ClassLoader to use for proxy generation
XmlRpcClient
.public static <API> API createClientForClass(java.lang.Class<API> baseClass, java.lang.String handlerName, XmlRpcConnection xmlRpcConnection)
baseClass
- The class to build the remote proxy for.handlerName
- The name of the server-side XML-RPC handler.xmlRpcConnection
- The connection the client should connect to.
XmlRpcClient
.public static <API> API createClientForClass(java.lang.Class<API> baseClass, java.lang.String handlerName, XmlRpcConnection xmlRpcConnection, java.lang.Class<?>[] parameterTypes, java.lang.Object[] baseCtorArgs)
parameterTypes
and baseCtorArgs
.
baseClass
- The class to build the remote proxy for.handlerName
- The name of the server-side XML-RPC handler.xmlRpcConnection
- The connection the client should connect to.parameterTypes
- Array of Classes identifying a unique constructor of the base class.baseCtorArgs
- Arguments passed to the constructor.
XmlRpcClient
.public static <API> API createClient(java.lang.Class<API> apiClass, XmlRpcConnection xmlRpcConnection)
public static java.util.Map<java.lang.reflect.Method,java.lang.Boolean> getMethodXmlRpcComplianceMap(java.lang.Class<?> apiClass)
apiClass
- The API class.
public static void useAutomaticNullMasking(boolean b)
b
- true enables masking mode. false disables it.public static boolean usesAutomaticNullMasking()
public static void treatUnknownTypesAsBeans(boolean b)
b
- true, to enable this feature. false to disable it (=default)public static boolean isTreatUnknownTypesAsBeans()
public static TypeConverter getTypeConverter()
public static java.lang.Object getXmlRpcRepresentation(java.lang.Class<?> userPrepresentationType, java.lang.Object toConvert) throws TypeConversionException
XmlRpc
)
this is used for conversion. Converter mappings used in the API interface (ConverterMappings
)
will only be used if the API has been processed by a a
createClient(java.lang.Class, java.lang.String, java.lang.String, int)
or a
XmlRpcHandlerFactory.createHandlerFor(Object)
call before or a converter has been registered
before using ParameterConverterRegistry.setParameterConverterForClass(Class, Class)
.
TypeConversionException:
- Denotes problems while converting representations. This may
include missing annotations, illegal object types, missing converter mappings, ...
TypeConversionException
public static java.lang.Object getXmlRpcRepresentation(java.lang.Object toConvert) throws TypeConversionException
getXmlRpcRepresentation(Class, Object)
. The representation type is taken directly from
the object to convert.
TypeConversionException
public static <T> T getUserRepresentation(java.lang.Class<T> targetClass, java.lang.Object xmlRpcRepresentation) throws TypeConversionException
XmlRpc
)
this is used for conversion. Converter mappings used in the API interface (ConverterMappings
)
will only be used if the API has been processed by a a
createClient(java.lang.Class, java.lang.String, java.lang.String, int)
or a
XmlRpcHandlerFactory.createHandlerFor(Object)
call before.
targetClass
- Type to convert to.xmlRpcRepresentation
- The XML-RPC representation.
TypeConversionException:
- Denotes problems while converting representations. This may
include missing annotations, illegal object types, ...
TypeConversionException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |