From 8fcdf88bcf848bbfe07b077960735e865f15bcc3 Mon Sep 17 00:00:00 2001 From: hns Date: Wed, 28 May 2003 17:33:47 +0000 Subject: [PATCH] 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. --- src/helma/main/ApplicationManager.java | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/helma/main/ApplicationManager.java b/src/helma/main/ApplicationManager.java index 0b007e21..aaf94a47 100644 --- a/src/helma/main/ApplicationManager.java +++ b/src/helma/main/ApplicationManager.java @@ -212,6 +212,12 @@ public class ApplicationManager implements XmlRpcHandler { String method2 = method.substring(dot + 1); 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) { throw new Exception("Handler \"" + handler + "\" not found for " + method); } @@ -269,7 +275,7 @@ public class ApplicationManager implements XmlRpcHandler { String pathPattern; String staticDir; String staticMountpoint; - String[] xmlrpcHandlerNames; + String xmlrpcHandlerName; String cookieDomain; String uploadLimit; String debug; @@ -287,7 +293,6 @@ public class ApplicationManager implements XmlRpcHandler { staticDir = props.getProperty(name+".static"); staticMountpoint = getPathPattern(props.getProperty(name+".staticMountpoint", joinMountpoint(mountpoint, "static"))); - xmlrpcHandlerNames = StringUtils.split(props.getProperty(name+".xmlrpcHandler")); cookieDomain = props.getProperty(name+".cookieDomain"); uploadLimit = props.getProperty(name+".uploadLimit"); debug = props.getProperty(name+".debug"); @@ -409,7 +414,8 @@ public class ApplicationManager implements XmlRpcHandler { } // register as XML-RPC handler - xmlrpcHandlers.put(app.getXmlRpcHandlerName(), app); + xmlrpcHandlerName = app.getXmlRpcHandlerName(); + xmlrpcHandlers.put(xmlrpcHandlerName, app); // app.start(); } catch (Exception x) { Server.getLogger().log("Couldn't bind app: " + x); @@ -446,7 +452,7 @@ public class ApplicationManager implements XmlRpcHandler { } // unregister as XML-RPC handler - xmlrpcHandlers.remove(app.getXmlRpcHandlerName()); + xmlrpcHandlers.remove(xmlrpcHandlerName); } catch (Exception x) { Server.getLogger().log("Couldn't unbind app: " + x); }