From c9dc8128f14174075c170e32ea7d80198f648d9c Mon Sep 17 00:00:00 2001 From: jsdelfino Date: Wed, 21 Dec 2011 18:31:55 +0000 Subject: Fix calculation of composite path when configured with an absolute path. git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1221832 13f79535-47bb-0310-9956-ffa450edef68 --- sca-cpp/trunk/modules/scdl/scdl.hpp | 7 +++++++ sca-cpp/trunk/modules/server/mod-eval.hpp | 2 +- sca-cpp/trunk/modules/server/mod-wiring.cpp | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) (limited to 'sca-cpp') diff --git a/sca-cpp/trunk/modules/scdl/scdl.hpp b/sca-cpp/trunk/modules/scdl/scdl.hpp index 7f6e95393e..7cf43e3b14 100644 --- a/sca-cpp/trunk/modules/scdl/scdl.hpp +++ b/sca-cpp/trunk/modules/scdl/scdl.hpp @@ -208,6 +208,13 @@ const value propertyValue(const value& l) { return elementValue(l); } +/** + * Returns the absolute path of a resource in a contribution. + */ +const string resourcePath(const string& contrib, const string& path) { + return c_str(path)[0] == '/'? path : contrib + path; +} + } } diff --git a/sca-cpp/trunk/modules/server/mod-eval.hpp b/sca-cpp/trunk/modules/server/mod-eval.hpp index 31e850d18c..2de2f3d6fe 100644 --- a/sca-cpp/trunk/modules/server/mod-eval.hpp +++ b/sca-cpp/trunk/modules/server/mod-eval.hpp @@ -741,7 +741,7 @@ const failable confComponents(ServerConf& sc) { if (sc.key != "") debug(sc.key, "modeval::confComponents::sslKey"); // Read the components and get their implementation lambda functions - const failable > comps = readComponents(sc.contributionPath + sc.compositeName); + const failable > comps = readComponents(scdl::resourcePath(sc.contributionPath, sc.compositeName)); if (!hasContent(comps)) return mkfailure(reason(comps)); sc.implementations = componentToImplementationAssoc(sc, content(comps)); diff --git a/sca-cpp/trunk/modules/server/mod-wiring.cpp b/sca-cpp/trunk/modules/server/mod-wiring.cpp index c61e90a6a1..c2380be6a3 100644 --- a/sca-cpp/trunk/modules/server/mod-wiring.cpp +++ b/sca-cpp/trunk/modules/server/mod-wiring.cpp @@ -265,7 +265,7 @@ const bool confComponents(ServerConf& sc) { // Read the component configuration and store the references and service URIs // in trees for fast retrieval later - const failable > comps = readComponents(sc.contributionPath + sc.compositeName); + const failable > comps = readComponents(scdl::resourcePath(sc.contributionPath, sc.compositeName)); if (!hasContent(comps)) return true; const list refs = componentReferenceToTargetAssoc(content(comps)); -- cgit v1.2.3