summaryrefslogtreecommitdiffstats
path: root/java/sca/modules/implementation-web-runtime
diff options
context:
space:
mode:
Diffstat (limited to 'java/sca/modules/implementation-web-runtime')
-rw-r--r--java/sca/modules/implementation-web-runtime/src/main/java/org/apache/tuscany/sca/implementation/web/ComponentContextServlet.java11
-rw-r--r--java/sca/modules/implementation-web-runtime/src/main/java/org/apache/tuscany/sca/implementation/web/ContextScriptProcessor.java3
-rw-r--r--java/sca/modules/implementation-web-runtime/src/main/java/org/apache/tuscany/sca/implementation/web/runtime/WebImplementationProviderFactory.java1
3 files changed, 7 insertions, 8 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 6e79b417aa..6318b9ecb7 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
@@ -20,7 +20,6 @@
package org.apache.tuscany.sca.implementation.web;
import java.io.IOException;
-import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.UnsupportedEncodingException;
import java.util.ArrayList;
@@ -75,7 +74,7 @@ public class ComponentContextServlet extends HttpServlet {
doScriptInit(req, response);
- doScriptReferences(out);
+ doScriptReferences(req, response);
out.write(FOOTER);
@@ -117,7 +116,9 @@ public class ComponentContextServlet extends HttpServlet {
/**
* Calls each ContextScriptProcessor for each SCA reference to insert code for the reference into componentContext.js
*/
- protected void doScriptReferences(PrintWriter out) throws IOException, UnsupportedEncodingException {
+ protected void doScriptReferences(HttpServletRequest req, HttpServletResponse response) throws IOException, UnsupportedEncodingException {
+
+ PrintWriter out = response.getWriter();
out.write("// SCA References\n");
@@ -127,7 +128,7 @@ public class ComponentContextServlet extends HttpServlet {
String ref = "// SCA Reference " + cr.getName() + "\n";
out.write(ref);
for (ContextScriptProcessor csp : contextScriptProcessors) {
- csp.scriptReference(cr, out);
+ csp.scriptReference(cr, req, response);
}
}
@@ -137,7 +138,7 @@ public class ComponentContextServlet extends HttpServlet {
/**
* Calls each ContextScriptProcessor for each SCA property to insert code for the property into componentContext.js
*/
- protected void doScriptProperties(OutputStream out) throws IOException, UnsupportedEncodingException {
+ protected void doScriptProperties(HttpServletRequest req, HttpServletResponse response) throws IOException, UnsupportedEncodingException {
// TODO: support properties
}
diff --git a/java/sca/modules/implementation-web-runtime/src/main/java/org/apache/tuscany/sca/implementation/web/ContextScriptProcessor.java b/java/sca/modules/implementation-web-runtime/src/main/java/org/apache/tuscany/sca/implementation/web/ContextScriptProcessor.java
index a660a5285b..02c99debb0 100644
--- a/java/sca/modules/implementation-web-runtime/src/main/java/org/apache/tuscany/sca/implementation/web/ContextScriptProcessor.java
+++ b/java/sca/modules/implementation-web-runtime/src/main/java/org/apache/tuscany/sca/implementation/web/ContextScriptProcessor.java
@@ -20,7 +20,6 @@
package org.apache.tuscany.sca.implementation.web;
import java.io.IOException;
-import java.io.PrintWriter;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@@ -29,5 +28,5 @@ import org.apache.tuscany.sca.assembly.ComponentReference;
public interface ContextScriptProcessor {
void scriptInit(HttpServletRequest req, HttpServletResponse response) throws IOException;
- void scriptReference(ComponentReference cr, PrintWriter out) throws IOException;
+ void scriptReference(ComponentReference cr, HttpServletRequest req, HttpServletResponse response) throws IOException;
}
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 d532c6e80f..2518ba5381 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,7 +56,6 @@ 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() {
public Invoker createInvoker(RuntimeComponentService arg0, Operation arg1) {