org.apache.xmlrpc
Class DefaultHandlerMapping

java.lang.Object
  extended by org.apache.xmlrpc.DefaultHandlerMapping
All Implemented Interfaces:
XmlRpcHandlerMapping

public class DefaultHandlerMapping
extends java.lang.Object
implements XmlRpcHandlerMapping

Provide a default handler mapping, used by the XmlRpcServer. This mapping supports the special handler name "$default" that will handle otherwise unhandled requests.

Since:
1.2
Author:
Hannes Wallnoefer, Daniel L. Rall, Andrew Evers
See Also:
XmlRpcServer

Constructor Summary
DefaultHandlerMapping()
          Create a new mapping.
 
Method Summary
 void addHandler(java.lang.String handlerName, java.lang.Object handler)
          Register a handler object with this name.
 java.lang.Object getHandler(java.lang.String methodName)
          Find the handler and its method name for a given method.
 void removeHandler(java.lang.String handlerName)
          Remove a handler object that was previously registered with this server.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultHandlerMapping

public DefaultHandlerMapping()
Create a new mapping.

Method Detail

addHandler

public void addHandler(java.lang.String handlerName,
                       java.lang.Object handler)
Register a handler object with this name. Methods of this objects will be callable over XML-RPC as "handlername.methodname". For more information about XML-RPC handlers see the main documentation page.

Parameters:
handlername - The name to identify the handler by.
handler - The handler itself.

removeHandler

public void removeHandler(java.lang.String handlerName)
Remove a handler object that was previously registered with this server.

Parameters:
handlerName - The name identifying the handler to remove.

getHandler

public java.lang.Object getHandler(java.lang.String methodName)
                            throws java.lang.Exception
Find the handler and its method name for a given method. Implements the XmlRpcHandlerMapping interface.

Specified by:
getHandler in interface XmlRpcHandlerMapping
Parameters:
methodName - The name of the XML-RPC method to find a handler for (this is not the Java method name).
Returns:
A handler object and method name.
Throws:
java.lang.Exception - If a handler can not be found.
See Also:
XmlRpcHandlerMapping.getHandler(String)


Copyright 2001-2001-2005 Apache Software Foundation. All Rights Reserved.