summaryrefslogtreecommitdiffstats
path: root/branches/sca-java-1.x/modules/implementation-widget-runtime/src/main/java/org/apache/tuscany/sca/implementation/widget/provider/WidgetImplementationProvider.java
diff options
context:
space:
mode:
authorlresende <lresende@13f79535-47bb-0310-9956-ffa450edef68>2009-03-27 08:28:11 +0000
committerlresende <lresende@13f79535-47bb-0310-9956-ffa450edef68>2009-03-27 08:28:11 +0000
commit25d03792990d853fcad19364f9c08718f968730f (patch)
tree862696dfc94c7a5016cf73c9ccb1b38b3b716f79 /branches/sca-java-1.x/modules/implementation-widget-runtime/src/main/java/org/apache/tuscany/sca/implementation/widget/provider/WidgetImplementationProvider.java
parent415755337408fb10d59fb972b13b101a46a71449 (diff)
TUSCANY-2837 - Updates to start using Javascript extension points to generate js client proxies
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@759050 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to '')
-rw-r--r--branches/sca-java-1.x/modules/implementation-widget-runtime/src/main/java/org/apache/tuscany/sca/implementation/widget/provider/WidgetImplementationProvider.java18
1 files changed, 13 insertions, 5 deletions
diff --git a/branches/sca-java-1.x/modules/implementation-widget-runtime/src/main/java/org/apache/tuscany/sca/implementation/widget/provider/WidgetImplementationProvider.java b/branches/sca-java-1.x/modules/implementation-widget-runtime/src/main/java/org/apache/tuscany/sca/implementation/widget/provider/WidgetImplementationProvider.java
index 26f8c78677..8f1511f483 100644
--- a/branches/sca-java-1.x/modules/implementation-widget-runtime/src/main/java/org/apache/tuscany/sca/implementation/widget/provider/WidgetImplementationProvider.java
+++ b/branches/sca-java-1.x/modules/implementation-widget-runtime/src/main/java/org/apache/tuscany/sca/implementation/widget/provider/WidgetImplementationProvider.java
@@ -23,6 +23,7 @@ import java.net.URI;
import javax.servlet.Servlet;
import org.apache.tuscany.sca.assembly.ComponentService;
+import org.apache.tuscany.sca.core.web.JavascriptProxyFactoryExtensionPoint;
import org.apache.tuscany.sca.host.http.ServletHost;
import org.apache.tuscany.sca.implementation.widget.WidgetImplementation;
import org.apache.tuscany.sca.interfacedef.Operation;
@@ -41,6 +42,7 @@ class WidgetImplementationProvider implements ImplementationProvider {
private RuntimeComponent component;
+ private JavascriptProxyFactoryExtensionPoint javascriptProxyFactories;
private ServletHost servletHost;
private String widgetLocationURL;
@@ -52,9 +54,13 @@ class WidgetImplementationProvider implements ImplementationProvider {
/**
* Constructs a new resource implementation provider.
*/
- WidgetImplementationProvider(RuntimeComponent component, WidgetImplementation implementation, ServletHost servletHost) {
+ WidgetImplementationProvider(RuntimeComponent component,
+ WidgetImplementation implementation,
+ JavascriptProxyFactoryExtensionPoint javascriptProxyFactories,
+ ServletHost servletHost) {
this.component = component;
+ this.javascriptProxyFactories = javascriptProxyFactories;
this.servletHost = servletHost;
widgetLocationURL = implementation.getLocationURL().toString();
@@ -65,7 +71,7 @@ class WidgetImplementationProvider implements ImplementationProvider {
}
public Invoker createInvoker(RuntimeComponentService service, Operation operation) {
- WidgetImplementationInvoker invoker = new WidgetImplementationInvoker(component, widgetName, widgetFolderURL, widgetLocationURL);
+ WidgetImplementationInvoker invoker = new WidgetImplementationInvoker(component, javascriptProxyFactories, widgetName, widgetFolderURL, widgetLocationURL);
return invoker;
}
@@ -74,8 +80,6 @@ class WidgetImplementationProvider implements ImplementationProvider {
}
public void start() {
- System.out.println(">>> Starting component : " + this.component.getName());
-
String contextRoot = getContextRoot();
// get the ScaDomainScriptServlet, if it doesn't yet exist create one
@@ -84,7 +88,7 @@ class WidgetImplementationProvider implements ImplementationProvider {
Servlet servlet = servletHost.getServletMapping(scriptURI);
if (servlet == null /*|| servlet instanceof HTTPGetListenerServlet*/) {
WidgetComponentScriptServlet widgetScriptServlet;
- widgetScriptServlet = new WidgetComponentScriptServlet(this.component);
+ widgetScriptServlet = new WidgetComponentScriptServlet(this.component, javascriptProxyFactories);
servletHost.addServletMapping(scriptURI, widgetScriptServlet);
} else {
System.out.println(">>>Servlet::" + servlet.getClass().toString());
@@ -101,6 +105,10 @@ class WidgetImplementationProvider implements ImplementationProvider {
}
+ /**
+ * Get the contextRoot considering the HTTP Binding URI when in a embedded environment
+ * @return
+ */
private String getContextRoot() {
String contextRoot = null;