tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From n...@apache.org
Subject svn commit: r673307 - /tuscany/branches/sca-java-1.3/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/
Date Wed, 02 Jul 2008 07:43:01 GMT
Author: nash
Date: Wed Jul  2 00:43:01 2008
New Revision: 673307

URL: http://svn.apache.org/viewvc?rev=673307&view=rev
Log:
Fix TUSCANY-2449

Added:
    tuscany/branches/sca-java-1.3/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/ComponentReferenceBindingBuilderImpl.java
      - copied, changed from r673199, tuscany/branches/sca-java-1.3/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/CompositeReferenceBindingBuilderImpl.java
    tuscany/branches/sca-java-1.3/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/ComponentServiceBindingBuilderImpl.java
Removed:
    tuscany/branches/sca-java-1.3/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/CompositeReferenceBindingBuilderImpl.java
Modified:
    tuscany/branches/sca-java-1.3/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/CompositeBuilderImpl.java
    tuscany/branches/sca-java-1.3/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/CompositeServiceBindingBuilderImpl.java

Copied: tuscany/branches/sca-java-1.3/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/ComponentReferenceBindingBuilderImpl.java
(from r673199, tuscany/branches/sca-java-1.3/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/CompositeReferenceBindingBuilderImpl.java)
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-java-1.3/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/ComponentReferenceBindingBuilderImpl.java?p2=tuscany/branches/sca-java-1.3/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/ComponentReferenceBindingBuilderImpl.java&p1=tuscany/branches/sca-java-1.3/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/CompositeReferenceBindingBuilderImpl.java&r1=673199&r2=673307&rev=673307&view=diff
==============================================================================
--- tuscany/branches/sca-java-1.3/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/CompositeReferenceBindingBuilderImpl.java
(original)
+++ tuscany/branches/sca-java-1.3/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/ComponentReferenceBindingBuilderImpl.java
Wed Jul  2 00:43:01 2008
@@ -32,14 +32,14 @@
 
 /**
  * A composite builder that performs any additional building steps that
- * reference bindings may need.  Used for WSDL generation.
+ * component reference bindings may need.  Used for WSDL generation.
  *
  * @version $Rev$ $Date$
  */
-public class CompositeReferenceBindingBuilderImpl implements CompositeBuilder {
+public class ComponentReferenceBindingBuilderImpl implements CompositeBuilder {
     private Monitor monitor;
 
-    public CompositeReferenceBindingBuilderImpl(Monitor monitor) {
+    public ComponentReferenceBindingBuilderImpl(Monitor monitor) {
         this.monitor = monitor;
     }
 

Added: tuscany/branches/sca-java-1.3/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/ComponentServiceBindingBuilderImpl.java
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-java-1.3/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/ComponentServiceBindingBuilderImpl.java?rev=673307&view=auto
==============================================================================
--- tuscany/branches/sca-java-1.3/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/ComponentServiceBindingBuilderImpl.java
(added)
+++ tuscany/branches/sca-java-1.3/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/ComponentServiceBindingBuilderImpl.java
Wed Jul  2 00:43:01 2008
@@ -0,0 +1,73 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.    
+ */
+
+package org.apache.tuscany.sca.assembly.builder.impl;
+
+
+import org.apache.tuscany.sca.assembly.Binding;
+import org.apache.tuscany.sca.assembly.Component;
+import org.apache.tuscany.sca.assembly.ComponentService;
+import org.apache.tuscany.sca.assembly.Composite;
+import org.apache.tuscany.sca.assembly.Implementation;
+import org.apache.tuscany.sca.assembly.Service;
+import org.apache.tuscany.sca.assembly.builder.BindingBuilderExtension;
+import org.apache.tuscany.sca.assembly.builder.CompositeBuilder;
+import org.apache.tuscany.sca.assembly.builder.CompositeBuilderException;
+import org.apache.tuscany.sca.monitor.Monitor;
+
+/**
+ * A composite builder that performs any additional building steps that
+ * component service bindings may need.  Used for WSDL generation.
+ *
+ * @version $Rev$ $Date$
+ */
+public class ComponentServiceBindingBuilderImpl implements CompositeBuilder {
+    private Monitor monitor;
+
+    public ComponentServiceBindingBuilderImpl(Monitor monitor) {
+        this.monitor = monitor;
+    }
+
+    public void build(Composite composite) throws CompositeBuilderException {
+        buildServiceBindings(composite);
+    }
+    
+    private void buildServiceBindings(Composite composite) {
+        
+        // build bindings recursively
+        for (Component component : composite.getComponents()) {
+            Implementation implementation = component.getImplementation();
+            if (implementation instanceof Composite) {
+                buildServiceBindings((Composite)implementation);
+            }
+        }
+
+        // find all the component service bindings     
+        for (Component component : composite.getComponents()) {
+            for (ComponentService componentService : component.getServices()) {
+                for (Binding binding : componentService.getBindings()) {
+                    if (binding instanceof BindingBuilderExtension) {
+                        ((BindingBuilderExtension)binding).getBuilder().build(component,
componentService, binding, monitor);
+                    }
+                }
+            }
+        }
+    }
+
+}

Modified: tuscany/branches/sca-java-1.3/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/CompositeBuilderImpl.java
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-java-1.3/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/CompositeBuilderImpl.java?rev=673307&r1=673306&r2=673307&view=diff
==============================================================================
--- tuscany/branches/sca-java-1.3/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/CompositeBuilderImpl.java
(original)
+++ tuscany/branches/sca-java-1.3/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/CompositeBuilderImpl.java
Wed Jul  2 00:43:01 2008
@@ -49,8 +49,9 @@
     private CompositeBuilder compositeServiceConfigurationBuilder;
     private CompositeBuilder compositePromotionBuilder;
     private CompositeBuilder compositePolicyBuilder;
+    private CompositeBuilder componentServiceBindingBuilder;
     private CompositeBuilder compositeServiceBindingBuilder;
-    private CompositeBuilder compositeReferenceBindingBuilder;
+    private CompositeBuilder componentReferenceBindingBuilder;
     
     /**
      * Constructs a new composite builder.
@@ -100,8 +101,9 @@
         compositeServiceConfigurationBuilder = new CompositeServiceConfigurationBuilderImpl(assemblyFactory,
scaBindingFactory, interfaceContractMapper, policyDefinitions, monitor);
         compositePromotionBuilder = new CompositePromotionBuilderImpl(assemblyFactory, endpointFactory,
interfaceContractMapper, monitor);
         compositePolicyBuilder = new CompositePolicyBuilderImpl(assemblyFactory, endpointFactory,
interfaceContractMapper, monitor);
+        componentServiceBindingBuilder = new ComponentServiceBindingBuilderImpl(monitor);
         compositeServiceBindingBuilder = new CompositeServiceBindingBuilderImpl(monitor);
-        compositeReferenceBindingBuilder = new CompositeReferenceBindingBuilderImpl(monitor);
+        componentReferenceBindingBuilder = new ComponentReferenceBindingBuilderImpl(monitor);
     }
 
     public void build(Composite composite) throws CompositeBuilderException {
@@ -121,7 +123,10 @@
         // Compute the policies across the model hierarchy
         compositePolicyBuilder.build(composite);
 
-        // Build service binding-related information
+        // Build component service binding-related information
+        componentServiceBindingBuilder.build(composite);
+
+        // Build composite service binding-related information
         compositeServiceBindingBuilder.build(composite);
         
         // Wire the components
@@ -133,8 +138,8 @@
         // Wire the composite references
         compositeReferenceWireBuilder.build(composite);
 
-        // Build reference binding-related information
-        compositeReferenceBindingBuilder.build(composite);
+        // Build component reference binding-related information
+        componentReferenceBindingBuilder.build(composite);
         
         // Fuse nested composites
         //FIXME do this later

Modified: tuscany/branches/sca-java-1.3/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/CompositeServiceBindingBuilderImpl.java
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-java-1.3/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/CompositeServiceBindingBuilderImpl.java?rev=673307&r1=673306&r2=673307&view=diff
==============================================================================
--- tuscany/branches/sca-java-1.3/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/CompositeServiceBindingBuilderImpl.java
(original)
+++ tuscany/branches/sca-java-1.3/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/CompositeServiceBindingBuilderImpl.java
Wed Jul  2 00:43:01 2008
@@ -22,7 +22,6 @@
 
 import org.apache.tuscany.sca.assembly.Binding;
 import org.apache.tuscany.sca.assembly.Component;
-import org.apache.tuscany.sca.assembly.ComponentService;
 import org.apache.tuscany.sca.assembly.Composite;
 import org.apache.tuscany.sca.assembly.CompositeService;
 import org.apache.tuscany.sca.assembly.Implementation;
@@ -34,7 +33,7 @@
 
 /**
  * A composite builder that performs any additional building steps that
- * service bindings may need.  Used for WSDL generation.
+ * composite service bindings may need.  Used for WSDL generation.
  *
  * @version $Rev$ $Date$
  */
@@ -59,17 +58,6 @@
             }
         }
 
-        // find all the component service bindings     
-        for (Component component : composite.getComponents()) {
-            for (ComponentService componentService : component.getServices()) {
-                for (Binding binding : componentService.getBindings()) {
-                    if (binding instanceof BindingBuilderExtension) {
-                        ((BindingBuilderExtension)binding).getBuilder().build(component,
componentService, binding, monitor);
-                    }
-                }
-            }
-        }
-
         // find all the composite service bindings     
         for (Service service : composite.getServices()) {
             for (Binding binding : service.getBindings()) {



Mime
View raw message