org.apache.xmlrpc.server
Class PropertyHandlerMapping

java.lang.Object
  extended by org.apache.xmlrpc.server.AbstractReflectiveHandlerMapping
      extended by org.apache.xmlrpc.server.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.
The following constrains apply to the classes:

  1. The classes must be stateless. In other words, any instance of the class must be completely thread safe.
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, AbstractReflectiveHandlerMapping.InitializationHandler
 
Field Summary
 
Fields inherited from class org.apache.xmlrpc.server.AbstractReflectiveHandlerMapping
handlerMap
 
Constructor Summary
PropertyHandlerMapping(java.lang.ClassLoader pClassLoader, java.lang.String pResource, TypeConverterFactory pTypeConverterFactory, boolean pInstanceIsStateless)
          Creates a new instance, loading the properties from the given resource.
PropertyHandlerMapping(java.lang.ClassLoader pClassLoader, java.net.URL pURL, TypeConverterFactory pTypeConverterFactory, boolean pInstanceIsStateless)
          Creates a new instance, loading the property file from the given URL.
 
Method Summary
protected  java.lang.Class newHandlerClass(java.lang.ClassLoader pClassLoader, java.lang.String pClassName)
           
 
Methods inherited from class org.apache.xmlrpc.server.AbstractReflectiveHandlerMapping
getAuthenticationHandler, getHandler, getInitializationHandler, getListMethods, getMethodHelp, getMethodHelp, getMethodSignature, getSignature, newXmlRpcHandler, registerPublicMethods, setAuthenticationHandler, setInitializationHandler
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PropertyHandlerMapping

public PropertyHandlerMapping(java.lang.ClassLoader pClassLoader,
                              java.net.URL pURL,
                              TypeConverterFactory pTypeConverterFactory,
                              boolean pInstanceIsStateless)
                       throws java.io.IOException,
                              XmlRpcException
Creates a new instance, loading the property file from the given URL.

Parameters:
pClassLoader - Classloader being used to load the classes.
pURL - The URL, from which the property file is being loaded.
pInstanceIsStateless - The handler can operate in either of two operation modes:
  1. The object, which is actually performing the requests, is initialized at startup. In other words, there is only one object, which is performing all the requests. Obviously, this is the faster operation mode. On the other hand, it has the disadvantage, that the object must be stateless.
  2. A new object is created for any request. This is slower, because the object needs to be initialized. On the other hand, it allows for stateful objects, which may take request specific configuration like the clients IP address, and the like.
Throws:
java.io.IOException - Loading the property file failed.
XmlRpcException - Initializing the handlers failed.

PropertyHandlerMapping

public PropertyHandlerMapping(java.lang.ClassLoader pClassLoader,
                              java.lang.String pResource,
                              TypeConverterFactory pTypeConverterFactory,
                              boolean pInstanceIsStateless)
                       throws java.io.IOException,
                              XmlRpcException
Creates a new instance, loading the properties from the given resource.

Parameters:
pClassLoader - Classloader being used to locate the resource.
pResource - Resource being loaded.
pInstanceIsStateless - The handler can operate in either of two operation modes:
  1. The object, which is actually performing the requests, is initialized at startup. In other words, there is only one object, which is performing all the requests. Obviously, this is the faster operation mode. On the other hand, it has the disadvantage, that the object must be stateless.
  2. A new object is created for any request. This is slower, because the object needs to be initialized. On the other hand, it allows for stateful objects, which may take request specific configuration like the clients IP address, and the like.
Throws:
java.io.IOException - Loading the property file failed.
XmlRpcException - Initializing the handlers failed.
Method Detail

newHandlerClass

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


Copyright © 2001-2006 Apache Software Foundation. All Rights Reserved.