org.apache.xmlrpc.server

Class PropertyHandlerMapping

public class PropertyHandlerMapping extends AbstractReflectiveHandlerMapping

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.
Method Summary
voidaddHandler(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.
protected ClassnewHandlerClass(ClassLoader pClassLoader, String pClassName)
voidremoveHandler(String pKey)
Removes all handlers with the given class key.

Method Detail

addHandler

public void addHandler(String pKey, Class pClass)
Adds handlers for the given object to the mapping. The handlers are build by invoking {@link #registerPublicMethods(String, Class)}.

Parameters: pKey The class key, which is passed to {@link #registerPublicMethods(String, Class)}. pClass Class, which is responsible for handling the request.

load

public void load(ClassLoader pClassLoader, String pResource)
Reads handler definitions from a resource file.

Parameters: 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.

UNKNOWN: pClassLoader The class loader being used to load handler classes.

load

public void load(ClassLoader pClassLoader, URL pURL)
Reads handler definitions from a property file.

Parameters: pURL The URL from which to load the property file

Throws: IOException Loading the property file failed. XmlRpcException Initializing the handlers failed.

UNKNOWN: pClassLoader The class loader being used to load handler classes.

newHandlerClass

protected Class newHandlerClass(ClassLoader pClassLoader, String pClassName)

removeHandler

public void removeHandler(String pKey)
Removes all handlers with the given class key.
Copyright © 2001-2007 Apache Software Foundation. All Rights Reserved.