Author: antelder
Date: Wed Aug 13 04:45:20 2008
New Revision: 685523
URL: http://svn.apache.org/viewvc?rev=685523&view=rev
Log:
pass the servlet request and response to the script processor
Modified:
tuscany/java/sca/modules/implementation-web-runtime/src/main/java/org/apache/tuscany/sca/implementation/web/ComponentContextServlet.java
tuscany/java/sca/modules/implementation-web-runtime/src/main/java/org/apache/tuscany/sca/implementation/web/ContextScriptProcessor.java
tuscany/java/sca/modules/implementation-web-runtime/src/main/java/org/apache/tuscany/sca/implementation/web/runtime/WebImplementationProviderFactory.java
Modified:
tuscany/java/sca/modules/implementation-web-runtime/src/main/java/org/apache/tuscany/sca/implementation/web/ComponentContextServlet.java
URL:
http://svn.apache.org/viewvc/tuscany/java/sca/modules/implementation-web-runtime/src/main/java/org/apache/tuscany/sca/implementation/web/ComponentContextServlet.java?rev=685523&r1=685522&r2=685523&view=diff
==============================================================================
---
tuscany/java/sca/modules/implementation-web-runtime/src/main/java/org/apache/tuscany/sca/implementation/web/ComponentContextServlet.java
(original)
+++
tuscany/java/sca/modules/implementation-web-runtime/src/main/java/org/apache/tuscany/sca/implementation/web/ComponentContextServlet.java
Wed Aug 13 04:45:20 2008
@@ -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 @@
doScriptInit(req, response);
- doScriptReferences(out);
+ doScriptReferences(req, response);
out.write(FOOTER);
@@ -117,7 +116,9 @@
/**
* 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 @@
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 @@
/**
* 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
}
Modified:
tuscany/java/sca/modules/implementation-web-runtime/src/main/java/org/apache/tuscany/sca/implementation/web/ContextScriptProcessor.java
URL:
http://svn.apache.org/viewvc/tuscany/java/sca/modules/implementation-web-runtime/src/main/java/org/apache/tuscany/sca/implementation/web/ContextScriptProcessor.java?rev=685523&r1=685522&r2=685523&view=diff
==============================================================================
---
tuscany/java/sca/modules/implementation-web-runtime/src/main/java/org/apache/tuscany/sca/implementation/web/ContextScriptProcessor.java
(original)
+++
tuscany/java/sca/modules/implementation-web-runtime/src/main/java/org/apache/tuscany/sca/implementation/web/ContextScriptProcessor.java
Wed Aug 13 04:45:20 2008
@@ -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 @@
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;
}
Modified:
tuscany/java/sca/modules/implementation-web-runtime/src/main/java/org/apache/tuscany/sca/implementation/web/runtime/WebImplementationProviderFactory.java
URL:
http://svn.apache.org/viewvc/tuscany/java/sca/modules/implementation-web-runtime/src/main/java/org/apache/tuscany/sca/implementation/web/runtime/WebImplementationProviderFactory.java?rev=685523&r1=685522&r2=685523&view=diff
==============================================================================
---
tuscany/java/sca/modules/implementation-web-runtime/src/main/java/org/apache/tuscany/sca/implementation/web/runtime/WebImplementationProviderFactory.java
(original)
+++
tuscany/java/sca/modules/implementation-web-runtime/src/main/java/org/apache/tuscany/sca/implementation/web/runtime/WebImplementationProviderFactory.java
Wed Aug 13 04:45:20 2008
@@ -56,7 +56,6 @@
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) {