I am in the middle of a migration myself. It is not an easy swapping
out of jar files. The architecture has changed significantly.
Look at the WebServer section about 1/2 way down
http://ws.apache.org/xmlrpc/server.html
There is an example of how to override the default behavior.
You will need a .properties file that looks like
#name = className
myAPI=com.mycompany.MyXmlHandler
Where MyXmlHandler is your handler class.
By default, all public methods are exposed. In contrast to XmlRpc 2.x,
if you have public methods that take parameters or return objects that
are not known (do not have parsers/serializers defined) an exception
will be thrown. I fixed this by making the nonconforming methods
protected.
My app runs in a servlet container, so I don't know if this actually
works, as several other code examples on the xmlrcp web site don't compile.
Mike
Daniel Noll wrote:
Hi.
I'm having some trouble figuring out what I'm supposed to do to
convert my existing XML-RPC 2.0 code to support version 3.0.
Stripping a lot of detail out of the class, my 2.0 version looks like
this:
public class MyEmbeddedWebServer implements Startable {
private WebServer server;
private Registry registry;
// Registry actually passed in by PicoContainer.
public MyEmbeddedWebServer(Registry registry) {
this.registry = registry;
}
public synchronized start() {
if (server == null) {
server = new WebServer(8080);
server.addHandler(Registry.class.getName(), registry);
server.start();
}
}
public synchronized stop() {
if (server != null) {
server.shutdown();
server = null;
}
}
}
My problem is that under 3.0, WebServer#addHandler has been removed.
As far as I can tell, I'm now supposed to modify the handlers by using
something like this:
PropertyHandlerMapping mapping = new PropertyHandlerMapping();
webServer.getXmlRpcServer().setHandlerMapping(mapping)
My problem now is that PropertyHandlerMapping#addMapping requires a
class. Actually, "Registry" is an interface and the actual class it
happens to be depends on what was set into this PicoContainer. And I
can't come up with some way to make passing in a class work without
using some kind of dodgy hack where I put something into a static
ThreadLocal and then have the constructor pull it back out.
Is there a way to get the older and simpler behaviour where I can just
pass in an object?
Daniel
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]