Support '*' as xmlrpcHandlerName. This will handle any XML-RPC request

that isn't handled explicitly by another application. The full XML-RPC method
name will be passed through to the application, i.e. the handler name is not
cut off.
This commit is contained in:
hns 2003-05-28 17:33:47 +00:00
parent 284850f973
commit 8fcdf88bcf

View file

@ -212,6 +212,12 @@ public class ApplicationManager implements XmlRpcHandler {
String method2 = method.substring(dot + 1); String method2 = method.substring(dot + 1);
Application app = (Application) xmlrpcHandlers.get(handler); Application app = (Application) xmlrpcHandlers.get(handler);
if (app == null) {
app = (Application) xmlrpcHandlers.get("*");
// use the original method name, the handler is resolved within the app.
method2 = method;
}
if (app == null) { if (app == null) {
throw new Exception("Handler \"" + handler + "\" not found for " + method); throw new Exception("Handler \"" + handler + "\" not found for " + method);
} }
@ -269,7 +275,7 @@ public class ApplicationManager implements XmlRpcHandler {
String pathPattern; String pathPattern;
String staticDir; String staticDir;
String staticMountpoint; String staticMountpoint;
String[] xmlrpcHandlerNames; String xmlrpcHandlerName;
String cookieDomain; String cookieDomain;
String uploadLimit; String uploadLimit;
String debug; String debug;
@ -287,7 +293,6 @@ public class ApplicationManager implements XmlRpcHandler {
staticDir = props.getProperty(name+".static"); staticDir = props.getProperty(name+".static");
staticMountpoint = getPathPattern(props.getProperty(name+".staticMountpoint", staticMountpoint = getPathPattern(props.getProperty(name+".staticMountpoint",
joinMountpoint(mountpoint, "static"))); joinMountpoint(mountpoint, "static")));
xmlrpcHandlerNames = StringUtils.split(props.getProperty(name+".xmlrpcHandler"));
cookieDomain = props.getProperty(name+".cookieDomain"); cookieDomain = props.getProperty(name+".cookieDomain");
uploadLimit = props.getProperty(name+".uploadLimit"); uploadLimit = props.getProperty(name+".uploadLimit");
debug = props.getProperty(name+".debug"); debug = props.getProperty(name+".debug");
@ -409,7 +414,8 @@ public class ApplicationManager implements XmlRpcHandler {
} }
// register as XML-RPC handler // register as XML-RPC handler
xmlrpcHandlers.put(app.getXmlRpcHandlerName(), app); xmlrpcHandlerName = app.getXmlRpcHandlerName();
xmlrpcHandlers.put(xmlrpcHandlerName, app);
// app.start(); // app.start();
} catch (Exception x) { } catch (Exception x) {
Server.getLogger().log("Couldn't bind app: " + x); Server.getLogger().log("Couldn't bind app: " + x);
@ -446,7 +452,7 @@ public class ApplicationManager implements XmlRpcHandler {
} }
// unregister as XML-RPC handler // unregister as XML-RPC handler
xmlrpcHandlers.remove(app.getXmlRpcHandlerName()); xmlrpcHandlers.remove(xmlrpcHandlerName);
} catch (Exception x) { } catch (Exception x) {
Server.getLogger().log("Couldn't unbind app: " + x); Server.getLogger().log("Couldn't unbind app: " + x);
} }