Package org.apache.xmlrpc.server
Class PropertyHandlerMapping
java.lang.Object
org.apache.xmlrpc.server.AbstractReflectiveHandlerMapping
org.apache.xmlrpc.server.PropertyHandlerMapping
- All Implemented Interfaces:
XmlRpcListableHandlerMapping,XmlRpcHandlerMapping
A handler mapping based on a property file. The property file
contains a set of properties. The property key is taken as the
handler name. The property value is taken as the name of a
class being instantiated. For any non-void, non-static, and
public method in the class, an entry in the handler map is
generated. A typical use would be, to specify interface names
as the property keys and implementations as the values.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.xmlrpc.server.AbstractReflectiveHandlerMapping
AbstractReflectiveHandlerMapping.AuthenticationHandler -
Field Summary
Fields inherited from class org.apache.xmlrpc.server.AbstractReflectiveHandlerMapping
handlerMap -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddHandler(String pKey, Class pClass) Adds handlers for the given object to the mapping.voidload(ClassLoader pClassLoader, String pResource) Reads handler definitions from a resource file.voidload(ClassLoader pClassLoader, URL pURL) Reads handler definitions from a property file.voidload(ClassLoader pClassLoader, Map pMap) Reads handler definitions from an existing Map.protected ClassnewHandlerClass(ClassLoader pClassLoader, String pClassName) voidremoveHandler(String pKey) Removes all handlers with the given class key.Methods inherited from class org.apache.xmlrpc.server.AbstractReflectiveHandlerMapping
getAuthenticationHandler, getHandler, getListMethods, getMethodHelp, getMethodHelp, getMethodSignature, getRequestProcessorFactoryFactory, getSignature, getTypeConverterFactory, isHandlerMethod, isVoidMethodEnabled, newXmlRpcHandler, registerPublicMethods, setAuthenticationHandler, setRequestProcessorFactoryFactory, setTypeConverterFactory, setVoidMethodEnabled
-
Constructor Details
-
PropertyHandlerMapping
public PropertyHandlerMapping()
-
-
Method Details
-
load
Reads handler definitions from a resource file.- Parameters:
pClassLoader- The class loader being used to load handler classes.pResource- The resource being used, for example "org/apache/xmlrpc/webserver/XmlRpcServlet.properties"- Throws:
IOException- Loading the property file failed.XmlRpcException- Initializing the handlers failed.
-
load
Reads handler definitions from a property file.- Parameters:
pClassLoader- The class loader being used to load handler classes.pURL- The URL from which to load the property file- Throws:
IOException- Loading the property file failed.XmlRpcException- Initializing the handlers failed.
-
load
Reads handler definitions from an existing Map.- Parameters:
pClassLoader- The class loader being used to load handler classes.pMap- The existing Map to read from- Throws:
XmlRpcException- Initializing the handlers failed.
-
newHandlerClass
- Throws:
XmlRpcException
-
addHandler
Adds handlers for the given object to the mapping. The handlers are build by invokingAbstractReflectiveHandlerMapping.registerPublicMethods(String, Class).- Parameters:
pKey- The class key, which is passed toAbstractReflectiveHandlerMapping.registerPublicMethods(String, Class).pClass- Class, which is responsible for handling the request.- Throws:
XmlRpcException
-
removeHandler
Removes all handlers with the given class key.
-