tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lrese...@apache.org
Subject svn commit: r670758 - /tuscany/java/sca/modules/implementation-widget-runtime/src/main/java/org/apache/tuscany/sca/implementation/widget/provider/WidgetImplementationInvoker.java
Date Mon, 23 Jun 2008 21:17:39 GMT
Author: lresende
Date: Mon Jun 23 14:17:38 2008
New Revision: 670758

URL: http://svn.apache.org/viewvc?rev=670758&view=rev
Log:
Fixing problem where generated javaScript had duplicated js clients if composite had multiple
references using same bindign type

Modified:
    tuscany/java/sca/modules/implementation-widget-runtime/src/main/java/org/apache/tuscany/sca/implementation/widget/provider/WidgetImplementationInvoker.java

Modified: tuscany/java/sca/modules/implementation-widget-runtime/src/main/java/org/apache/tuscany/sca/implementation/widget/provider/WidgetImplementationInvoker.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/implementation-widget-runtime/src/main/java/org/apache/tuscany/sca/implementation/widget/provider/WidgetImplementationInvoker.java?rev=670758&r1=670757&r2=670758&view=diff
==============================================================================
--- tuscany/java/sca/modules/implementation-widget-runtime/src/main/java/org/apache/tuscany/sca/implementation/widget/provider/WidgetImplementationInvoker.java
(original)
+++ tuscany/java/sca/modules/implementation-widget-runtime/src/main/java/org/apache/tuscany/sca/implementation/widget/provider/WidgetImplementationInvoker.java
Mon Jun 23 14:17:38 2008
@@ -27,6 +27,8 @@
 import java.net.MalformedURLException;
 import java.net.URI;
 import java.net.URL;
+import java.util.HashMap;
+import java.util.Map;
 
 import org.apache.tuscany.sca.assembly.Binding;
 import org.apache.tuscany.sca.assembly.ComponentProperty;
@@ -108,11 +110,18 @@
         pw.println("/* Apache Tuscany SCA Widget header */");
         pw.println();
         
+        Map<String, Boolean> bindingClientProcessed = new HashMap<String, Boolean>();
+        
         for(ComponentReference reference : component.getReferences()) {
             for(Binding binding : reference.getBindings()) {
                 String bindingProxyName = WidgetProxyHelper.getJavaScriptProxyFile(binding.getClass().getName());
-                if(bindingProxyName != null) {
-                    generateJavaScriptBindingProxy(pw,bindingProxyName);
+                //check if binding client code was already processed and inject to the generated
script
+                Boolean processedFlag = bindingClientProcessed.get(bindingProxyName);
+                if( processedFlag == null || processedFlag.booleanValue() == false) {
+                    if(bindingProxyName != null) {
+                        generateJavaScriptBindingProxy(pw,bindingProxyName);
+                        bindingClientProcessed.put(bindingProxyName, Boolean.TRUE);
+                    }
                 }
             }
         }



Mime
View raw message