summaryrefslogtreecommitdiffstats
path: root/java/sca/modules/implementation-web-runtime/src/main
diff options
context:
space:
mode:
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() {