summaryrefslogtreecommitdiffstats
path: root/sca-cpp/trunk/modules/wsgi/scdl.py
diff options
context:
space:
mode:
authorjsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68>2010-03-17 08:12:39 +0000
committerjsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68>2010-03-17 08:12:39 +0000
commit8ccd1ab0bc508fedcb72e1343396fd4c8e8aa9a6 (patch)
tree5a8a0ac7a845aa05d25753ece7212a697776ae3f /sca-cpp/trunk/modules/wsgi/scdl.py
parent2df2ef9c55bcd5fc17d9400799a80cc941e05a39 (diff)
Added support for HTTP references and different versions of the store-wsgi composite.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@924188 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-cpp/trunk/modules/wsgi/scdl.py')
-rw-r--r--sca-cpp/trunk/modules/wsgi/scdl.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/sca-cpp/trunk/modules/wsgi/scdl.py b/sca-cpp/trunk/modules/wsgi/scdl.py
index 2e57c77377..9687860d6e 100644
--- a/sca-cpp/trunk/modules/wsgi/scdl.py
+++ b/sca-cpp/trunk/modules/wsgi/scdl.py
@@ -19,6 +19,7 @@
from xml.etree.cElementTree import iterparse
from util import *
+from httputil import *
# Element tree utility functions, used to parse SCDL documents
def parse(file):
@@ -142,6 +143,13 @@ def uriToComponent(u, comps):
return (m, car(comps))
return uriToComponent(u, cdr(comps))
+# Evaluate a reference, return a proxy to the resolved component or an
+# HTTP client configured with the reference target uri
+def evalReference(r, comps):
+ if not r.startswith("http://"):
+ return nameToComponent(r, comps)
+ return mkclient(r)
+
# Evaluate a component, resolve its implementation and references
def evalComponent(comp, comps):
comp.mod = __import__(comp.impl)
@@ -149,7 +157,7 @@ def evalComponent(comp, comps):
# Make a list of proxy lambda functions for the component references and properties
# A reference proxy is the callable lambda function of the component wired to the reference
# A property proxy is a lambda function that returns the value of the property
- comp.proxies = tuple(map(lambda r: nameToComponent(r, comps), comp.refs)) + tuple(map(lambda v: lambda: v, comp.props))
+ comp.proxies = tuple(map(lambda r: evalReference(r, comps), comp.refs)) + tuple(map(lambda v: lambda: v, comp.props))
return comp