Class PropertyHandlerMapping

  • All Implemented Interfaces:
    XmlRpcListableHandlerMapping, XmlRpcHandlerMapping

    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.
    • Constructor Detail

      • PropertyHandlerMapping

        public PropertyHandlerMapping()
    • Method Detail

      • load

        public void load​(java.lang.ClassLoader pClassLoader,
                         java.lang.String pResource)
                  throws java.io.IOException,
                         XmlRpcException
        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:
        java.io.IOException - Loading the property file failed.
        XmlRpcException - Initializing the handlers failed.
      • load

        public void load​(java.lang.ClassLoader pClassLoader,
                         java.net.URL pURL)
                  throws java.io.IOException,
                         XmlRpcException
        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:
        java.io.IOException - Loading the property file failed.
        XmlRpcException - Initializing the handlers failed.
      • load

        public void load​(java.lang.ClassLoader pClassLoader,
                         java.util.Map pMap)
                  throws XmlRpcException
        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

        protected java.lang.Class newHandlerClass​(java.lang.ClassLoader pClassLoader,
                                                  java.lang.String pClassName)
                                           throws XmlRpcException
        Throws:
        XmlRpcException
      • removeHandler

        public void removeHandler​(java.lang.String pKey)
        Removes all handlers with the given class key.