diff options
Diffstat (limited to 'java/sca/modules/assembly')
4 files changed, 22 insertions, 22 deletions
diff --git a/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/CompositeBuilderTmp.java b/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/CompositeBuilderTmp.java index cf3e62ab38..c6bf6caac0 100644 --- a/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/CompositeBuilderTmp.java +++ b/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/CompositeBuilderTmp.java @@ -22,6 +22,8 @@ package org.apache.tuscany.sca.assembly.builder; import java.util.List; import java.util.Map; +import javax.xml.namespace.QName; + import org.apache.tuscany.sca.assembly.Composite; import org.apache.tuscany.sca.definitions.Definitions; import org.apache.tuscany.sca.monitor.Monitor; @@ -49,6 +51,6 @@ public interface CompositeBuilderTmp { * @param monitor * @throws CompositeBuilderException */ - void build(Composite composite, Definitions definitions, Map<Class<?>, List<String>> bindingMap, Monitor monitor) throws CompositeBuilderException; + void build(Composite composite, Definitions definitions, Map<QName, List<String>> bindingBaseURIs, Monitor monitor) throws CompositeBuilderException; } diff --git a/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/DefaultCompositeBuilderExtensionPoint.java b/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/DefaultCompositeBuilderExtensionPoint.java index 4d6612979f..035d620778 100644 --- a/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/DefaultCompositeBuilderExtensionPoint.java +++ b/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/DefaultCompositeBuilderExtensionPoint.java @@ -25,6 +25,8 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import javax.xml.namespace.QName; + import org.apache.tuscany.sca.assembly.Composite; import org.apache.tuscany.sca.core.ExtensionPointRegistry; import org.apache.tuscany.sca.core.FactoryExtensionPoint; @@ -125,9 +127,9 @@ public class DefaultCompositeBuilderExtensionPoint implements CompositeBuilderEx getBuilder().build(composite, definitions, monitor); } - public void build(Composite composite, Definitions definitions, Map<Class<?>, List<String>> bindingMap, Monitor monitor) + public void build(Composite composite, Definitions definitions, Map<QName, List<String>> bindingBaseURIs, Monitor monitor) throws CompositeBuilderException { - ((CompositeBuilderTmp)getBuilder()).build(composite, definitions, bindingMap, monitor); + ((CompositeBuilderTmp)getBuilder()).build(composite, definitions, bindingBaseURIs, monitor); } private CompositeBuilder getBuilder() { diff --git a/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/CompositeBindingURIBuilderImpl.java b/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/CompositeBindingURIBuilderImpl.java index 896d6d3540..2ef6202a85 100644 --- a/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/CompositeBindingURIBuilderImpl.java +++ b/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/CompositeBindingURIBuilderImpl.java @@ -25,6 +25,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import javax.xml.namespace.QName; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.transform.TransformerFactory; @@ -81,10 +82,10 @@ public class CompositeBindingURIBuilderImpl extends BaseBuilderImpl implements C public void build(Composite composite, Definitions definitions, Monitor monitor) throws CompositeBuilderException { configureBindingURIsAndNames(composite, definitions, monitor); } - - public void build(Composite composite, Definitions definitions, Map<Class<?>, List<String>> bindingMap, Monitor monitor) + + public void build(Composite composite, Definitions definitions, Map<QName, List<String>> bindingBaseURIs, Monitor monitor) throws CompositeBuilderException { - configureBindingURIs(composite, null, definitions, bindingMap, monitor); + configureBindingURIs(composite, null, definitions, bindingBaseURIs, monitor); configureBindingNames(composite, monitor); } @@ -107,7 +108,7 @@ public class CompositeBindingURIBuilderImpl extends BaseBuilderImpl implements C * @param defaultBindings list of default binding configurations */ protected void configureBindingURIs(Composite composite, - Definitions definitions, Map<Class<?>, List<String>> defaultBindings, + Definitions definitions, Map<QName, List<String>> defaultBindings, Monitor monitor) throws CompositeBuilderException { configureBindingURIs(composite, null, definitions, defaultBindings, monitor); } @@ -133,7 +134,7 @@ public class CompositeBindingURIBuilderImpl extends BaseBuilderImpl implements C * @param defaultBindings list of default binding configurations */ private void configureBindingURIs(Composite composite, String uri, - Definitions definitions, Map<Class<?>, List<String>> defaultBindings, + Definitions definitions, Map<QName, List<String>> defaultBindings, Monitor monitor) throws CompositeBuilderException { String parentComponentURI = uri; @@ -346,7 +347,7 @@ public class CompositeBindingURIBuilderImpl extends BaseBuilderImpl implements C * @param defaultBindings */ private void constructBindingURI(String parentComponentURI, Composite composite, Service service, - Binding binding, Map<Class<?>, List<String>> defaultBindings, Monitor monitor) + Binding binding, Map<QName, List<String>> defaultBindings, Monitor monitor) throws CompositeBuilderException{ // This is a composite service so there is no component to provide a component URI // The path to this composite (through nested composites) is used. @@ -365,7 +366,7 @@ public class CompositeBindingURIBuilderImpl extends BaseBuilderImpl implements C * @param defaultBindings the list of default binding configurations */ private void constructBindingURI(Component component, Service service, - Binding binding, Map<Class<?>, List<String>> defaultBindings, Monitor monitor) + Binding binding, Map<QName, List<String>> defaultBindings, Monitor monitor) throws CompositeBuilderException{ boolean includeBindingName = component.getServices().size() != 1; constructBindingURI(component.getURI(), service, binding, includeBindingName, defaultBindings, monitor); @@ -382,7 +383,7 @@ public class CompositeBindingURIBuilderImpl extends BaseBuilderImpl implements C * @throws CompositeBuilderException */ private void constructBindingURI(String componentURIString, Service service, Binding binding, - boolean includeBindingName, Map<Class<?>, List<String>> defaultBindings, Monitor monitor) + boolean includeBindingName, Map<QName, List<String>> defaultBindings, Monitor monitor) throws CompositeBuilderException{ try { @@ -426,15 +427,9 @@ public class CompositeBindingURIBuilderImpl extends BaseBuilderImpl implements C // calculate the base URI URI baseURI = null; if (defaultBindings != null) { - for (Class<?> bindingClass : defaultBindings.keySet()){ - if (bindingClass.isInstance(binding)){ - List<String> uris = defaultBindings.get(bindingClass); - if (uris.size() > 0){ - baseURI = new URI(addSlashToPath(uris.get(0))); - } - - break; - } + List<String> uris = defaultBindings.get(binding.getType()); + if (uris != null && uris.size() > 0) { + baseURI = new URI(addSlashToPath(uris.get(0))); } } diff --git a/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/CompositeBuilderImpl.java b/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/CompositeBuilderImpl.java index e1598bb75f..bced0c807e 100644 --- a/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/CompositeBuilderImpl.java +++ b/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/CompositeBuilderImpl.java @@ -22,6 +22,7 @@ import java.util.List; import java.util.Map; import java.util.logging.Logger; +import javax.xml.namespace.QName; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.transform.TransformerFactory; @@ -145,7 +146,7 @@ public class CompositeBuilderImpl implements CompositeBuilder, CompositeBuilderT build(composite, definitions, null, monitor); } - public void build(Composite composite, Definitions definitions, Map<Class<?>, List<String>> bindingMap, Monitor monitor) throws CompositeBuilderException { + public void build(Composite composite, Definitions definitions, Map<QName, List<String>> bindingBaseURIs, Monitor monitor) throws CompositeBuilderException { try { // Collect and fuse includes @@ -170,7 +171,7 @@ public class CompositeBuilderImpl implements CompositeBuilder, CompositeBuilderT // Configure service binding URIs and names. Creates an SCA defined URI based // on the scheme base URI, the component name and the binding name - ((CompositeBuilderTmp)compositeBindingURIBuilder).build(composite, definitions, bindingMap, monitor); + ((CompositeBuilderTmp)compositeBindingURIBuilder).build(composite, definitions, bindingBaseURIs, monitor); // Create $promoted$ component services on bottom level components // to represent promoted services |