Vladimir R. Bossicard wrote:
Someone raised the problem of the xml-rpc messages that need to be placed in
the org.apache.xindice.server.rpc.messages subfolder because of
public Hashtable run(Hashtable message) throws Exception {
String classname = "org.apache.xindice.server.rpc.messages." +
message.get(MESSAGE_PARAM);
// The method determines what class we load to handle the message.
RPCMessage handler = (RPCMessage)
Class.forName(classname).newInstance();
return handler.execute(message);
}
in RPCMessageInterface.
Should the developer be able to define their own XML-RPC messages but use the
standard RPCMessageInterface class? If so, we have to change how the class
is referenced and have
'org.apache.xindice.server.rpc.messages.RemoveCollection' instead of
'RemoveCollection' as MESSAGE_PARAM.
Feed-back?
Well, not the cleanest solution ever, but how about:
String classname;
String class = message.get(MESSAGE_PARAM);
if (message.indexOf(".") == -1)
classname = "org.apache.xindice.server.rpc.messages." +
class; // the package might be encoded in a static string...
else
classname = class;
Ugly hack, yes, but it would work...
Ciao,
--
Gianugo Rabellino