org.apache.xmlrpc

Class DefaultHandlerMapping

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.
Authors:
Hannes Wallnoefer
Daniel L. Rall
Andrew Evers
Since:
1.2
See Also:
XmlRpcServer

Field Summary

private Hashtable
handlers

Constructor Summary

DefaultHandlerMapping()
Create a new mapping.

Method Summary

void
addHandler(String handlerName, Object handler)
Register a handler object with this name.
Object
getHandler(String methodName)
Find the handler and its method name for a given method.
void
removeHandler(String handlerName)
Remove a handler object that was previously registered with this server.

Field Details

handlers

private Hashtable handlers

Constructor Details

DefaultHandlerMapping

public DefaultHandlerMapping()
Create a new mapping.

Method Details

addHandler

public void addHandler(String handlerName,
                       Object handler)
Parameters:
handler - The handler itself.

getHandler

public Object getHandler(String methodName)
            throws 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.

removeHandler

public void removeHandler(String handlerName)
Remove a handler object that was previously registered with this server.
Parameters:
handlerName - The name identifying the handler to remove.

Copyright B) 1999-2002 Apache Software Foundation. All Rights Reserved.