redstone.xmlrpc
Class XmlRpcDispatcher
java.lang.Object
org.xml.sax.helpers.DefaultHandler
redstone.xmlrpc.XmlRpcParser
redstone.xmlrpc.XmlRpcDispatcher
- All Implemented Interfaces:
- org.xml.sax.ContentHandler, org.xml.sax.DTDHandler, org.xml.sax.EntityResolver, org.xml.sax.ErrorHandler
public class XmlRpcDispatcher
- extends XmlRpcParser
Objects of the XmlRpcDispather class perform the parsing of inbound XML-RPC
messages received by an XmlRpcServer and are responsible for invoking handlers and
dealing with their return values and exceptions.
- Author:
- Greger Olsson
Fields inherited from class redstone.xmlrpc.XmlRpcParser |
ARRAY, BASE64, BOOLEAN, DATE, DOUBLE, I4, I8, INT, MEMBER, NAME, STRING, STRUCT, VALUE |
Constructor Summary |
XmlRpcDispatcher(XmlRpcServer server,
java.lang.String callerIp)
Creates a dispatcher and associates it with an XmlRpcServer and the IP address
of the calling client. |
Method Summary |
void |
dispatch(java.io.InputStream xmlInput,
java.io.Writer xmlOutput)
Inbound XML-RPC messages to a server are delegated to this method. |
void |
endElement(java.lang.String uri,
java.lang.String name,
java.lang.String qualifiedName)
Override the endElement() method of the XmlRpcParser class, and catch
the method name element. |
java.lang.String |
getCallerIp()
Returns the IP adress of the client being dispatched. |
Methods inherited from class org.xml.sax.helpers.DefaultHandler |
endDocument, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl, warning |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DEFAULT_HANDLER_NAME
public static java.lang.String DEFAULT_HANDLER_NAME
XmlRpcDispatcher
public XmlRpcDispatcher(XmlRpcServer server,
java.lang.String callerIp)
- Creates a dispatcher and associates it with an XmlRpcServer and the IP address
of the calling client.
- Parameters:
server
-
getCallerIp
public java.lang.String getCallerIp()
- Returns the IP adress of the client being dispatched.
- Returns:
- The IP adress of the client being dispatched.
dispatch
public void dispatch(java.io.InputStream xmlInput,
java.io.Writer xmlOutput)
throws XmlRpcException
- Inbound XML-RPC messages to a server are delegated to this method. It
performs the parsing of the message, through the inherited parse() method,
and locates and invokes the appropriate invocation handlers.
- Throws:
XmlRpcException
- When the inbound XML message cannot be parsed due to no
available SAX driver, or when an invalid message was received.
All other exceptions are caught and encoded within the
XML-RPC writer.
endElement
public void endElement(java.lang.String uri,
java.lang.String name,
java.lang.String qualifiedName)
throws org.xml.sax.SAXException
- Override the endElement() method of the XmlRpcParser class, and catch
the method name element. The method name element is unique for XML-RPC
calls, and belongs here in the server.
- Specified by:
endElement
in interface org.xml.sax.ContentHandler
- Overrides:
endElement
in class XmlRpcParser
- Parameters:
uri
- name
- qualifiedName
-
- Throws:
org.xml.sax.SAXException