org.apache.xmlrpc
Class XmlRpcServer

java.lang.Object
  |
  +--org.apache.xmlrpc.XmlRpcServer

public class XmlRpcServer
extends java.lang.Object

A multithreaded, reusable XML-RPC server object. The name may be misleading because this does not open any server sockets. Instead it is fed by passing an XML-RPC input stream to the execute method. If you want to open a HTTP listener, use the WebServer class instead.

Author:
Hannes Wallnoefer

Inner Class Summary
(package private)  class XmlRpcServer.Worker
           
 
Field Summary
(package private)  java.util.Hashtable handlers
           
(package private)  java.util.Stack pool
           
(package private)  int workers
           
 
Constructor Summary
XmlRpcServer()
          Construct a new XML-RPC server.
 
Method Summary
 void addHandler(java.lang.String handlername, java.lang.Object handler)
          Register a handler object with this name.
 byte[] execute(java.io.InputStream is)
          Parse the request and execute the handler method, if one is found.
 byte[] execute(java.io.InputStream is, java.lang.String user, java.lang.String password)
          Parse the request and execute the handler method, if one is found.
private  XmlRpcServer.Worker getWorker()
           
 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, registerNatives, toString, wait, wait, wait
 

Field Detail

handlers

java.util.Hashtable handlers

pool

java.util.Stack pool

workers

int workers
Constructor Detail

XmlRpcServer

public XmlRpcServer()
Construct a new XML-RPC server. You have to register handlers to make it do something useful.
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.

removeHandler

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

execute

public byte[] execute(java.io.InputStream is)
Parse the request and execute the handler method, if one is found. Returns the result as XML. The calling Java code doesn't need to know whether the call was successful or not since this is all packed into the response.

execute

public byte[] execute(java.io.InputStream is,
                      java.lang.String user,
                      java.lang.String password)
Parse the request and execute the handler method, if one is found. If the invoked handler is AuthenticatedXmlRpcHandler, use the credentials to authenticate the user.

getWorker

private final XmlRpcServer.Worker getWorker()


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