xml-rpc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrew Evers" <aev...@redwood.nl>
Subject PATCH: Add Context handling to server
Date Fri, 13 Sep 2002 14:37:45 GMT
Hi guys,

Here is the patch I hinted at in my previous mail. It allows a
context object to be passed around from an entry-point in
XmlRpcServer/Worker through to the actual handlerimplementation (if the handler supports it).

The advantage of this patch (IMHO) is that it separates out the
XML-RPC request itself from the context in which it occured. By
'context' I mean the HTTP connection (which may be re-used), the
headers and authentication information (SSL info...). Information
may now be passed through from a custom embedding application to
that application's handlers.

This can be passed in from the calling framework and used by
special XmlRpcWorker implementations, or by special handler
implementations. It also opens the way for an XmlRpcWorker
that is based on a chain or filter system.

The new context related classes are as follows:
+ XmlRpcContext - an interface containing the context for the
  request. Currently the username/password and the handler
  mapping (used by system handlers).
+ DefaultXmlRpcContext - default implementation - nothing
+ ContextXmlRpcHandler - an XML-RPC handler that is capable
  of handling a request that contains context information.
+ MultiCall.java - the system.multicall handler, factored
  out of SystemHandler.

Changes to XmlRpcRequest:
Move username/password to XmlRpcContext.

Changes to XmlRpcServer,XmlRpcWorker:
Context is passed or created in various execute() methods (the
old entry-points are preserved).

Changes to XmlRpcWorker,DefaultHandlerMapping:
Add support for ContextXmlRpcHandler in the mapping list.

Other changes:
There is now a createWorker() called by getWorker() in
place of constructing an XmlRpcWorker itself. This could
be patched in separately.

The SystemHandler has been changed, in particular it is now
a multiplexor, and the handlers themselves are in separate
classes. The SystemHandler and its sub-handlers all implement
ContextXmlRpcHandler instead of using introspection, this
allows them to obtain context information (esp. information
about server state).

The inclusion of system.* handlers may now be done by the
embedding developer.

Ideally SystemHandler and MultiCall would move to a
separate package (org.apache.xmlrpc.system?).


View raw message