From ac8bb2ddecac09d60760ef83319b627548d0fd77 Mon Sep 17 00:00:00 2001 From: jsdelfino Date: Thu, 1 Jul 2010 06:04:35 +0000 Subject: Minimal support for implementation.widget, using simplified (and generic) JSONRPC and ATOMPub Javascript proxies. Minor changes to the server runtime to serve reference requests from widgets. Adjust and simplified samples using the widget support. git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@959521 13f79535-47bb-0310-9956-ffa450edef68 --- sca-cpp/trunk/modules/server/mod-eval.hpp | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'sca-cpp/trunk/modules/server/mod-eval.hpp') diff --git a/sca-cpp/trunk/modules/server/mod-eval.hpp b/sca-cpp/trunk/modules/server/mod-eval.hpp index e46d8ba78a..14e5f40e9b 100644 --- a/sca-cpp/trunk/modules/server/mod-eval.hpp +++ b/sca-cpp/trunk/modules/server/mod-eval.hpp @@ -358,6 +358,22 @@ const list propProxies(const list& props) { /** * Evaluate a component and convert it to an applicable lambda function. */ +struct implementationFailure { + const value reason; + implementationFailure(const value& r) : reason(r) { + } + + // Default implementation representing an implementation that + // couldn't be evaluated. Report the evaluation error on all + // subsequent calls expect start/stop. + const value operator()(unused const list& params) const { + const value func = car(params); + if (func == "start" || func == "stop") + return mklist(lambda&)>()); + return mklist(value(), reason); + } +}; + const value evalComponent(ServerConf& sc, server_rec& server, const value& comp) { extern const failable&)> > evalImplementation(const string& cpath, const value& impl, const list& px, const lambda&)>& lifecycle); @@ -380,7 +396,7 @@ const value evalComponent(ServerConf& sc, server_rec& server, const value& comp) // Evaluate the component implementation and convert it to an applicable lambda function const failable&)> > cimpl(evalImplementation(sc.contributionPath, impl, append(rpx, ppx), sc.lifecycle)); if (!hasContent(cimpl)) - return reason(cimpl); + return lambda&)>(implementationFailure(reason(cimpl))); return content(cimpl); } -- cgit v1.2.3