Hi All,
I have a problem with the way handlermappings are established in the new
3.0rc1 version.
Let me first state the setting:
I have class "XMLRpcMethodForwarder" which defines all the methods which
are available through xml-rpc. To make use of this class you need to
provide it a parameter 'server' when it starts. However the dynamic
handler mapping can only add a handler by:
DynamicHandlerMapping dhm = new DynamicHandlerMapping(new
TypeConverterFactoryImpl(), true);
dhm.addHandler("Box", XMLRpcMethodForwarder.class);
Which gives basically a blank instantiation of
XMLRpcMethodForwarder.class. However, by means of the
setInitializationHandler method I was able to give this class the
parameter it needs. By adding:
dhm.setInitializationHandler(new XMLRpcMethodForwarder(server));
I could make sure that when a request came in the XMLRpcMethodForwarder
was first provided with a server parameter to finish the call.
But now with 3.0rc1 all this has been removed and we only have a
PropertyHandlerMapping which does not provide a setInitializationHandler
method. So now I cannot pass a parameter anymore to the class handling
the methods...
I thought a workaround might be:
PropertyHandlerMapping phm = new PropertyHandlerMapping();
phm.addHandler("Box", (new XMLRpcMethodForwarder(server)).getClass());
This code compiles perfectly, but when now a client request comes in I
get an exception.
Why is the setInitializationHandler method removed, or is there maybe a
valid workaround? With other words, how can I pass a parameter to the
class where the rpc methods are defined?
greetz
p.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]