From 06afc90e64dd5190157b847476bf743c10d1248a Mon Sep 17 00:00:00 2001 From: slaws Date: Wed, 24 Jun 2009 19:55:13 +0000 Subject: Test to push down the default binding configuration into the URI builders so that the binding uri can be calculated with a user specified default root. If this works out need to update the real CompositeBuilder interface however I notice Raymond has recently added so info to the bindings that makes this easier so will re-work to use that. Also need to add mechanism for bindings to determine their own default base URI when none is specified. git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@788159 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/tuscany/sca/node/impl/NodeFactoryImpl.java | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'java/sca/modules/node-impl/src/main') diff --git a/java/sca/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeFactoryImpl.java b/java/sca/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeFactoryImpl.java index 8ce21bc375..66f6f0e090 100644 --- a/java/sca/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeFactoryImpl.java +++ b/java/sca/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeFactoryImpl.java @@ -34,6 +34,7 @@ import java.security.AccessController; import java.security.PrivilegedAction; import java.util.ArrayList; import java.util.Collections; +import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; @@ -52,6 +53,7 @@ import org.apache.tuscany.sca.assembly.AssemblyFactory; import org.apache.tuscany.sca.assembly.Composite; import org.apache.tuscany.sca.assembly.builder.CompositeBuilder; import org.apache.tuscany.sca.assembly.builder.CompositeBuilderExtensionPoint; +import org.apache.tuscany.sca.assembly.builder.CompositeBuilderTmp; import org.apache.tuscany.sca.contribution.Artifact; import org.apache.tuscany.sca.contribution.Contribution; import org.apache.tuscany.sca.contribution.ContributionFactory; @@ -90,6 +92,7 @@ import org.apache.tuscany.sca.monitor.Problem; import org.apache.tuscany.sca.monitor.Problem.Severity; import org.apache.tuscany.sca.node.Node; import org.apache.tuscany.sca.node.NodeFactory; +import org.apache.tuscany.sca.node.configuration.BindingConfiguration; import org.apache.tuscany.sca.node.configuration.ContributionConfiguration; import org.apache.tuscany.sca.node.configuration.DeploymentComposite; import org.apache.tuscany.sca.node.configuration.NodeConfiguration; @@ -596,8 +599,17 @@ public class NodeFactoryImpl extends NodeFactory { } } + // TODO - EPR - create a binding map to pass down into the builders + // for use during URI calculation. + Map, List> bindingMap = new HashMap, List>(); + for (BindingConfiguration config : configuration.getBindings()){ + StAXArtifactProcessor processor = xmlProcessors.getProcessor(config.getBindingType()); + Class bindingClass = processor.getModelType(); + bindingMap.put(bindingClass, config.getBaseURIs()); + } + // build the top level composite - compositeBuilder.build(tempComposite, systemDefinitions, monitor); + ((CompositeBuilderTmp)compositeBuilder).build(tempComposite, systemDefinitions, bindingMap, monitor); analyzeProblems(); endpointReferenceBuilder.build(tempComposite, systemDefinitions, monitor); -- cgit v1.2.3