summaryrefslogtreecommitdiffstats
path: root/java/sca/modules/implementation-web-runtime/src/main
diff options
context:
space:
mode:
authorantelder <antelder@13f79535-47bb-0310-9956-ffa450edef68>2008-08-12 12:26:30 +0000
committerantelder <antelder@13f79535-47bb-0310-9956-ffa450edef68>2008-08-12 12:26:30 +0000
commitd265ff25c247dc3bb3933b468762cac419854944 (patch)
tree0033813f407b57afd9bb4b27f3781c9b4a168a45 /java/sca/modules/implementation-web-runtime/src/main
parentbb655343fe4463ad0c5717289a637f45d356e991 (diff)
Add the impl.web RuntimeComponent to the app context and use in the componentcontextservlet
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@685127 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/sca/modules/implementation-web-runtime/src/main')
-rw-r--r--java/sca/modules/implementation-web-runtime/src/main/java/org/apache/tuscany/sca/implementation/web/ComponentContextServlet.java5
-rw-r--r--java/sca/modules/implementation-web-runtime/src/main/java/org/apache/tuscany/sca/implementation/web/runtime/WebImplementationProviderFactory.java1
2 files changed, 5 insertions, 1 deletions
diff --git a/java/sca/modules/implementation-web-runtime/src/main/java/org/apache/tuscany/sca/implementation/web/ComponentContextServlet.java b/java/sca/modules/implementation-web-runtime/src/main/java/org/apache/tuscany/sca/implementation/web/ComponentContextServlet.java
index c08129dc85..d6d015992d 100644
--- a/java/sca/modules/implementation-web-runtime/src/main/java/org/apache/tuscany/sca/implementation/web/ComponentContextServlet.java
+++ b/java/sca/modules/implementation-web-runtime/src/main/java/org/apache/tuscany/sca/implementation/web/ComponentContextServlet.java
@@ -34,6 +34,7 @@ import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.tuscany.sca.assembly.ComponentReference;
+import org.apache.tuscany.sca.runtime.RuntimeComponent;
/**
* Servlet that handles the GET request for the componentContext.js script
@@ -96,7 +97,9 @@ public class ComponentContextServlet extends HttpServlet {
out.write("// SCA References\n");
- for (ComponentReference cr : WebSingleton.INSTANCE.getRuntimeComponent().getReferences()) {
+ RuntimeComponent component = (RuntimeComponent)servletContext.getAttribute("org.apache.tuscany.sca.implementation.web.RuntimeComponent");
+
+ for (ComponentReference cr : component.getReferences()) {
String ref = "// SCA Reference " + cr.getName() + "\n";
out.write(ref);
for (ContextScriptProcessor csp : WebSingleton.INSTANCE.getContextScriptProcessors()) {
diff --git a/java/sca/modules/implementation-web-runtime/src/main/java/org/apache/tuscany/sca/implementation/web/runtime/WebImplementationProviderFactory.java b/java/sca/modules/implementation-web-runtime/src/main/java/org/apache/tuscany/sca/implementation/web/runtime/WebImplementationProviderFactory.java
index 1692cb2b42..3b2f821b4f 100644
--- a/java/sca/modules/implementation-web-runtime/src/main/java/org/apache/tuscany/sca/implementation/web/runtime/WebImplementationProviderFactory.java
+++ b/java/sca/modules/implementation-web-runtime/src/main/java/org/apache/tuscany/sca/implementation/web/runtime/WebImplementationProviderFactory.java
@@ -56,6 +56,7 @@ public class WebImplementationProviderFactory implements ImplementationProviderF
servletHost.addServletMapping("org.osoa.sca.componentContext.js", contextServlet);
contextServlet.setAttribute("org.osoa.sca.ComponentContext", new ComponentContextProxy(component));
+ contextServlet.setAttribute("org.apache.tuscany.sca.implementation.web.RuntimeComponent", component);
WebAppServletHost.getInstance().setAttribute("org.osoa.sca.ComponentContext", new ComponentContextProxy(component));
return new ImplementationProvider() {