org.apache.xmlrpc
Class XmlRpc

java.lang.Object
  |
  +--org.xml.sax.HandlerBase
        |
        +--org.apache.xmlrpc.XmlRpc
All Implemented Interfaces:
org.xml.sax.DocumentHandler, org.xml.sax.DTDHandler, org.xml.sax.EntityResolver, org.xml.sax.ErrorHandler
Direct Known Subclasses:
XmlRpcRequestProcessor

public abstract class XmlRpc
extends org.xml.sax.HandlerBase

This abstract base class provides basic capabilities for XML-RPC, like parsing of parameters or encoding Java objects into XML-RPC format. Any XML parser with a SAX interface can be used.

XmlRpcServer and XmlRpcClient are the classes that actually implement an XML-RPC server and client.

Version:
$Id: XmlRpc.java,v 1.35 2002/11/21 01:28:16 dlr Exp $
Author:
Hannes Wallnoefer, Daniel Rall, Andrew Evers
See Also:
XmlRpcServer, XmlRpcClient

Field Summary
static boolean debug
          Whether to log debugging output.
static java.lang.String version
          The version string used in HTTP communication.
 
Constructor Summary
protected XmlRpc()
          Creates a new instance with the TypeFactory set to an instance of the class named by the org.apache.xmlrpc.TypeFactory System property.
protected XmlRpc(java.lang.String typeFactory)
          Creates a new instance with the specified TypeFactory.
 
Method Summary
 void characters(char[] ch, int start, int length)
          Method called by SAX driver.
 void endElement(java.lang.String name)
          Method called by SAX driver.
 void error(org.xml.sax.SAXParseException e)
           
 void fatalError(org.xml.sax.SAXParseException e)
           
 java.lang.String getEncoding()
          Return the encoding, transforming to the canonical name if possible.
static boolean getKeepAlive()
          get current HTTP keepalive mode.
static int getMaxThreads()
          Gets the maximum number of threads used at any given moment.
protected abstract  void objectParsed(java.lang.Object what)
          This method is called when a root level object has been parsed.
static void setDebug(boolean val)
          Switch debugging output on/off.
static void setDriver(java.lang.Class driver)
          Set the SAX Parser to be used by directly passing the Class object.
static void setDriver(java.lang.String driver)
          Set the SAX Parser to be used.
static void setEncoding(java.lang.String enc)
          Set the encoding of the XML.
static void setKeepAlive(boolean val)
          Switch HTTP keepalive on/off.
static void setMaxThreads(int maxThreads)
          Sets the maximum number of threads used at any given moment.
 void startElement(java.lang.String name, org.xml.sax.AttributeList atts)
          Method called by SAX driver.
 
Methods inherited from class org.xml.sax.HandlerBase
endDocument, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, startDocument, unparsedEntityDecl, warning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

version

public static final java.lang.String version
The version string used in HTTP communication.

debug

public static boolean debug
Whether to log debugging output.
Constructor Detail

XmlRpc

protected XmlRpc()
Creates a new instance with the TypeFactory set to an instance of the class named by the org.apache.xmlrpc.TypeFactory System property. If property not set or class is unavailable, uses the default.

XmlRpc

protected XmlRpc(java.lang.String typeFactory)
Creates a new instance with the specified TypeFactory.
Parameters:
typeFactory - The implementation to use.
Method Detail

setDriver

public static void setDriver(java.lang.String driver)
                      throws java.lang.ClassNotFoundException
Set the SAX Parser to be used. The argument can either be the full class name or a user friendly shortcut if the parser is known to this class. The parsers that can currently be set by shortcut are listed in the main documentation page. If you are using another parser please send me the name of the SAX driver and I'll include it in a future release. If setDriver() is never called then the System property "sax.driver" is consulted. If that is not defined the driver defaults to OpenXML.

setDriver

public static void setDriver(java.lang.Class driver)
Set the SAX Parser to be used by directly passing the Class object.

setEncoding

public static void setEncoding(java.lang.String enc)
Set the encoding of the XML.
Parameters:
enc - The Java name of the encoding.

getEncoding

public java.lang.String getEncoding()
Return the encoding, transforming to the canonical name if possible.
See Also:
org.apache.xmlrpc.XmlWriter#canonicalizeEncoding(String)

getMaxThreads

public static int getMaxThreads()
Gets the maximum number of threads used at any given moment.

setMaxThreads

public static void setMaxThreads(int maxThreads)
Sets the maximum number of threads used at any given moment.

setDebug

public static void setDebug(boolean val)
Switch debugging output on/off.

setKeepAlive

public static void setKeepAlive(boolean val)
Switch HTTP keepalive on/off.

getKeepAlive

public static boolean getKeepAlive()
get current HTTP keepalive mode.

objectParsed

protected abstract void objectParsed(java.lang.Object what)
This method is called when a root level object has been parsed. Sub-classes implement this callback to receive the fully parsed object.

characters

public void characters(char[] ch,
                       int start,
                       int length)
                throws org.xml.sax.SAXException
Method called by SAX driver.
Overrides:
characters in class org.xml.sax.HandlerBase

endElement

public void endElement(java.lang.String name)
                throws org.xml.sax.SAXException
Method called by SAX driver.
Overrides:
endElement in class org.xml.sax.HandlerBase

startElement

public void startElement(java.lang.String name,
                         org.xml.sax.AttributeList atts)
                  throws org.xml.sax.SAXException
Method called by SAX driver.
Overrides:
startElement in class org.xml.sax.HandlerBase

error

public void error(org.xml.sax.SAXParseException e)
           throws org.xml.sax.SAXException
Overrides:
error in class org.xml.sax.HandlerBase
Parameters:
e -  
Throws:
org.xml.sax.SAXException -  

fatalError

public void fatalError(org.xml.sax.SAXParseException e)
                throws org.xml.sax.SAXException
Overrides:
fatalError in class org.xml.sax.HandlerBase
Parameters:
e -  
Throws:
org.xml.sax.SAXException -  


Copyright © 1999-2002 Apache Software Foundation. All Rights Reserved.