|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.xmlrpc.server.AbstractReflectiveHandlerMapping
public abstract class AbstractReflectiveHandlerMapping
Abstract base class of handler mappings, which are using reflection.
Nested Class Summary | |
---|---|
static interface |
AbstractReflectiveHandlerMapping.AuthenticationHandler
An object implementing this interface may be used to validate user names and passwords. |
Field Summary | |
---|---|
protected java.util.Map |
handlerMap
|
Constructor Summary | |
---|---|
AbstractReflectiveHandlerMapping()
|
Method Summary | |
---|---|
AbstractReflectiveHandlerMapping.AuthenticationHandler |
getAuthenticationHandler()
Returns the authentication handler, if any, or null. |
XmlRpcHandler |
getHandler(java.lang.String pHandlerName)
Returns the XmlRpcHandler with the given name. |
java.lang.String[] |
getListMethods()
This method implements the introspection method system.listMethods , which is specified
as follows:
This method may be used to enumerate the methods implemented
by the XML-RPC server. |
protected java.lang.String |
getMethodHelp(java.lang.Class pClass,
java.lang.reflect.Method[] pMethods)
Creates a help string for the given method, when applied to the given class. |
java.lang.String |
getMethodHelp(java.lang.String pHandlerName)
This method implements the introspection method system.methodSignature , which is specified
as follows:
This method takes one parameter, the name of a
method implemented by the XML-RPC server. |
java.lang.String[][] |
getMethodSignature(java.lang.String pHandlerName)
This method implements the introspection method system.methodSignature , which is specified
as follows:
This method takes one parameter, the name of a method
implemented by the XML-RPC server. |
RequestProcessorFactoryFactory |
getRequestProcessorFactoryFactory()
Returns the mappings RequestProcessorFactoryFactory . |
protected java.lang.String[][] |
getSignature(java.lang.reflect.Method[] pMethods)
Creates a signature for the given method. |
TypeConverterFactory |
getTypeConverterFactory()
Returns the mappings TypeConverterFactory . |
protected boolean |
isHandlerMethod(java.lang.reflect.Method pMethod)
|
boolean |
isVoidMethodEnabled()
Returns, whether void methods are enabled. |
protected XmlRpcHandler |
newXmlRpcHandler(java.lang.Class pClass,
java.lang.reflect.Method[] pMethods)
Creates a new instance of XmlRpcHandler . |
protected void |
registerPublicMethods(java.lang.String pKey,
java.lang.Class pType)
Searches for methods in the given class. |
void |
setAuthenticationHandler(AbstractReflectiveHandlerMapping.AuthenticationHandler pAuthenticationHandler)
Sets the authentication handler, if any, or null. |
void |
setRequestProcessorFactoryFactory(RequestProcessorFactoryFactory pFactory)
Sets the mappings RequestProcessorFactoryFactory . |
void |
setTypeConverterFactory(TypeConverterFactory pFactory)
Sets the mappings TypeConverterFactory . |
void |
setVoidMethodEnabled(boolean pVoidMethodEnabled)
Sets, whether void methods are enabled. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.util.Map handlerMap
Constructor Detail |
---|
public AbstractReflectiveHandlerMapping()
Method Detail |
---|
public void setTypeConverterFactory(TypeConverterFactory pFactory)
TypeConverterFactory
.
public TypeConverterFactory getTypeConverterFactory()
TypeConverterFactory
.
public void setRequestProcessorFactoryFactory(RequestProcessorFactoryFactory pFactory)
RequestProcessorFactoryFactory
. Note, that this doesn't
affect already registered handlers.
public RequestProcessorFactoryFactory getRequestProcessorFactoryFactory()
RequestProcessorFactoryFactory
.
public AbstractReflectiveHandlerMapping.AuthenticationHandler getAuthenticationHandler()
public void setAuthenticationHandler(AbstractReflectiveHandlerMapping.AuthenticationHandler pAuthenticationHandler)
protected boolean isHandlerMethod(java.lang.reflect.Method pMethod)
protected void registerPublicMethods(java.lang.String pKey, java.lang.Class pType) throws XmlRpcException
XmlRpcHandler
.
Valid methods are defined as follows:
Object
.
pKey
- Suffix for building handler names. A dot and
the method name are being added.pType
- The class being inspected.
XmlRpcException
protected XmlRpcHandler newXmlRpcHandler(java.lang.Class pClass, java.lang.reflect.Method[] pMethods) throws XmlRpcException
XmlRpcHandler
.
pClass
- The class, which was inspected for handler
methods. This is used for error messages only. Typically,
it is the same than pInstance.getClass().
pMethods
- The method being invoked.
XmlRpcException
protected java.lang.String[][] getSignature(java.lang.reflect.Method[] pMethods)
protected java.lang.String getMethodHelp(java.lang.Class pClass, java.lang.reflect.Method[] pMethods)
public XmlRpcHandler getHandler(java.lang.String pHandlerName) throws XmlRpcNoSuchHandlerException, XmlRpcException
XmlRpcHandler
with the given name.
getHandler
in interface XmlRpcHandlerMapping
pHandlerName
- The handlers name
XmlRpcNoSuchHandlerException
- A handler with the given
name is unknown.
XmlRpcException
- An internal error occurred.public java.lang.String[] getListMethods() throws XmlRpcException
XmlRpcListableHandlerMapping
system.listMethods
, which is specified
as follows:
This method may be used to enumerate the methods implemented by the XML-RPC server.
The system.listMethods
method requires no
parameters. It returns an array of strings, each of which is
the name of a method implemented by the server.
Note, that the specification doesn't require that the list
must be exhaustive. We conclude, that a valid method
"handlerName" doesn't need to be in the list. For example,
a handler, which implements XmlRpcHandler
, but not
XmlRpcMetaDataHandler
, should possibly excluded:
Otherwise, the listable handler mapping could not provide
meaningful replies to system.methodSignature
,
and system.methodHelp
.
getListMethods
in interface XmlRpcListableHandlerMapping
XmlRpcException
- An internal error occurred.public java.lang.String getMethodHelp(java.lang.String pHandlerName) throws XmlRpcException
XmlRpcListableHandlerMapping
system.methodSignature
, which is specified
as follows:
This method takes one parameter, the name of a method implemented by the XML-RPC server. It returns a documentation string describing the use of that method. If no such string is available, an empty string is returned.
The documentation string may contain HTML markup.
getMethodHelp
in interface XmlRpcListableHandlerMapping
XmlRpcException
public java.lang.String[][] getMethodSignature(java.lang.String pHandlerName) throws XmlRpcException
XmlRpcListableHandlerMapping
system.methodSignature
, which is specified
as follows:
This method takes one parameter, the name of a method implemented by the XML-RPC server. It returns an array of possible signatures for this method. A signature is an array of types. The first of these types is the return type of the method, the rest are parameters.
Multiple signatures (ie. overloading) are permitted: this is the reason that an array of signatures are returned by this method.
Signatures themselves are restricted to the top level parameters expected by a method. For instance if a method expects one array of structs as a parameter, and it returns a string, its signature is simply "string, array". If it expects three integers, its signature is "string, int, int, int".
If no signature is defined for the method, a none-array value is returned. Therefore this is the way to test for a non-signature, if $resp below is the response object from a method call to system.methodSignature:
$v=$resp->value(); if ($v->kindOf()!="array") { // then the method did not have a signature defined }See the introspect.php demo included in this distribution for an example of using this method.
getMethodSignature
in interface XmlRpcListableHandlerMapping
XmlRpcException
XmlRpcMetaDataHandler.getSignatures()
public boolean isVoidMethodEnabled()
public void setVoidMethodEnabled(boolean pVoidMethodEnabled)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |