summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornash <nash@13f79535-47bb-0310-9956-ffa450edef68>2008-07-02 07:43:01 +0000
committernash <nash@13f79535-47bb-0310-9956-ffa450edef68>2008-07-02 07:43:01 +0000
commitb2a32b253de8c2bc120cb7ce8aa71982d6da8a2b (patch)
tree04dae6a2846cb86d3ef21e0d83da1d8387487756
parent8d7cb21ef3c6cf4a39ee77e3358d2eeb129864fe (diff)
Fix TUSCANY-2449
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@673307 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--branches/sca-java-1.3/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/ComponentReferenceBindingBuilderImpl.java (renamed from branches/sca-java-1.3/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/CompositeReferenceBindingBuilderImpl.java)6
-rw-r--r--branches/sca-java-1.3/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/ComponentServiceBindingBuilderImpl.java73
-rw-r--r--branches/sca-java-1.3/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/CompositeBuilderImpl.java15
-rw-r--r--branches/sca-java-1.3/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/CompositeServiceBindingBuilderImpl.java14
4 files changed, 87 insertions, 21 deletions
diff --git a/branches/sca-java-1.3/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/CompositeReferenceBindingBuilderImpl.java b/branches/sca-java-1.3/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/ComponentReferenceBindingBuilderImpl.java
index 90144ce49e..0c45f7bc9d 100644
--- a/branches/sca-java-1.3/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/CompositeReferenceBindingBuilderImpl.java
+++ b/branches/sca-java-1.3/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/ComponentReferenceBindingBuilderImpl.java
@@ -32,14 +32,14 @@ import org.apache.tuscany.sca.monitor.Monitor;
/**
* 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;
}
diff --git a/branches/sca-java-1.3/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/ComponentServiceBindingBuilderImpl.java b/branches/sca-java-1.3/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/ComponentServiceBindingBuilderImpl.java
new file mode 100644
index 0000000000..c4c6462c60
--- /dev/null
+++ b/branches/sca-java-1.3/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/ComponentServiceBindingBuilderImpl.java
@@ -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);
+ }
+ }
+ }
+ }
+ }
+
+}
diff --git a/branches/sca-java-1.3/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/CompositeBuilderImpl.java b/branches/sca-java-1.3/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/CompositeBuilderImpl.java
index 5b0268dcbc..76c8146654 100644
--- a/branches/sca-java-1.3/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/CompositeBuilderImpl.java
+++ b/branches/sca-java-1.3/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/CompositeBuilderImpl.java
@@ -49,8 +49,9 @@ public class CompositeBuilderImpl implements CompositeBuilder {
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 @@ public class CompositeBuilderImpl implements CompositeBuilder {
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 @@ public class CompositeBuilderImpl implements CompositeBuilder {
// 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 @@ public class CompositeBuilderImpl implements CompositeBuilder {
// 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
diff --git a/branches/sca-java-1.3/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/CompositeServiceBindingBuilderImpl.java b/branches/sca-java-1.3/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/CompositeServiceBindingBuilderImpl.java
index f5508b4ba1..fc4c63ae46 100644
--- a/branches/sca-java-1.3/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/CompositeServiceBindingBuilderImpl.java
+++ b/branches/sca-java-1.3/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/CompositeServiceBindingBuilderImpl.java
@@ -22,7 +22,6 @@ 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.CompositeService;
import org.apache.tuscany.sca.assembly.Implementation;
@@ -34,7 +33,7 @@ import org.apache.tuscany.sca.monitor.Monitor;
/**
* 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 @@ public class CompositeServiceBindingBuilderImpl implements CompositeBuilder {
}
}
- // 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()) {