diff options
Diffstat (limited to 'branches/sca-equinox/itest/validation/src')
-rw-r--r-- | branches/sca-equinox/itest/validation/src/test/java/domain/CustomCompositeBuilder.java | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/branches/sca-equinox/itest/validation/src/test/java/domain/CustomCompositeBuilder.java b/branches/sca-equinox/itest/validation/src/test/java/domain/CustomCompositeBuilder.java index 8665bfd535..e7305e671d 100644 --- a/branches/sca-equinox/itest/validation/src/test/java/domain/CustomCompositeBuilder.java +++ b/branches/sca-equinox/itest/validation/src/test/java/domain/CustomCompositeBuilder.java @@ -35,9 +35,9 @@ import org.apache.tuscany.sca.assembly.AssemblyFactory; import org.apache.tuscany.sca.assembly.Composite; import org.apache.tuscany.sca.assembly.SCABindingFactory; import org.apache.tuscany.sca.assembly.builder.CompositeBuilder; +import org.apache.tuscany.sca.assembly.builder.impl.CompositeBindingConfigurationBuilderImpl; import org.apache.tuscany.sca.assembly.builder.impl.CompositeBuilderImpl; import org.apache.tuscany.sca.contribution.Contribution; -import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint; import org.apache.tuscany.sca.contribution.processor.ExtensibleStAXArtifactProcessor; import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor; import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessorExtensionPoint; @@ -47,6 +47,7 @@ import org.apache.tuscany.sca.contribution.resolver.ExtensibleModelResolver; import org.apache.tuscany.sca.contribution.resolver.ModelResolverExtensionPoint; import org.apache.tuscany.sca.core.DefaultExtensionPointRegistry; import org.apache.tuscany.sca.core.ExtensionPointRegistry; +import org.apache.tuscany.sca.core.FactoryExtensionPoint; import org.apache.tuscany.sca.core.ModuleActivator; import org.apache.tuscany.sca.core.ModuleActivatorExtensionPoint; import org.apache.tuscany.sca.core.UtilityExtensionPoint; @@ -59,18 +60,18 @@ import org.apache.tuscany.sca.monitor.MonitorFactory; import org.apache.tuscany.sca.policy.IntentAttachPointTypeFactory; import org.apache.tuscany.sca.workspace.Workspace; import org.apache.tuscany.sca.workspace.WorkspaceFactory; -import org.apache.tuscany.sca.workspace.builder.ContributionDependencyBuilder; +import org.apache.tuscany.sca.workspace.builder.ContributionBuilder; import org.apache.tuscany.sca.workspace.builder.impl.ContributionDependencyBuilderImpl; public class CustomCompositeBuilder { private URLArtifactProcessor<Contribution> contributionProcessor; private ModelResolverExtensionPoint modelResolvers; - private ModelFactoryExtensionPoint modelFactories; + private FactoryExtensionPoint modelFactories; private WorkspaceFactory workspaceFactory; private AssemblyFactory assemblyFactory; private XMLOutputFactory outputFactory; private StAXArtifactProcessor<Object> xmlProcessor; - private ContributionDependencyBuilder contributionDependencyBuilder; + private ContributionBuilder contributionDependencyBuilder; private CompositeBuilder domainCompositeBuilder; private CompositeBuilder nodeCompositeBuilder; private NodeImplementationFactory nodeFactory; @@ -109,7 +110,7 @@ public class CustomCompositeBuilder { } // Get XML input/output factories - modelFactories = extensionPoints.getExtensionPoint(ModelFactoryExtensionPoint.class); + modelFactories = extensionPoints.getExtensionPoint(FactoryExtensionPoint.class); XMLInputFactory inputFactory = modelFactories.getFactory(XMLInputFactory.class); outputFactory = modelFactories.getFactory(XMLOutputFactory.class); @@ -131,16 +132,17 @@ public class CustomCompositeBuilder { modelResolvers = extensionPoints.getExtensionPoint(ModelResolverExtensionPoint.class); // Create a contribution dependency builder - contributionDependencyBuilder = new ContributionDependencyBuilderImpl(monitor); + contributionDependencyBuilder = new ContributionDependencyBuilderImpl(null); // Create a composite builder SCABindingFactory scaBindingFactory = modelFactories.getFactory(SCABindingFactory.class); IntentAttachPointTypeFactory attachPointTypeFactory = modelFactories.getFactory(IntentAttachPointTypeFactory.class); InterfaceContractMapper contractMapper = utilities.getUtility(InterfaceContractMapper.class); - domainCompositeBuilder = new CompositeBuilderImpl(assemblyFactory, scaBindingFactory, attachPointTypeFactory, contractMapper, monitor); + domainCompositeBuilder = new CompositeBuilderImpl(assemblyFactory, scaBindingFactory, attachPointTypeFactory, contractMapper); // Create a node composite builder - nodeCompositeBuilder = new NodeCompositeBuilderImpl(assemblyFactory, scaBindingFactory, contractMapper, null, monitor); + CompositeBuilder bindingConfigurationBuilder = new CompositeBindingConfigurationBuilderImpl(assemblyFactory, scaBindingFactory, contractMapper); + nodeCompositeBuilder = new NodeCompositeBuilderImpl(assemblyFactory, scaBindingFactory, contractMapper, bindingConfigurationBuilder); } public void loadContribution(String compositeURL, String sourceURI, String sourceURL) throws Exception { @@ -159,20 +161,17 @@ public class CustomCompositeBuilder { workspace.getContributions().add(storeContribution); // Build the contribution dependencies - Map<Contribution, List<Contribution>> contributionDependencies = new HashMap<Contribution, List<Contribution>>(); Set<Contribution> resolved = new HashSet<Contribution>(); for (Contribution contribution: workspace.getContributions()) { - List<Contribution> dependencies = contributionDependencyBuilder.buildContributionDependencies(contribution, workspace); + contributionDependencyBuilder.build(contribution, workspace, monitor); // Resolve contributions - for (Contribution dependency: dependencies) { + for (Contribution dependency: contribution.getDependencies()) { if (!resolved.contains(dependency)) { resolved.add(dependency); contributionProcessor.resolve(dependency, workspace.getModelResolver()); } } - - contributionDependencies.put(contribution, dependencies); } // Create a composite model for the domain @@ -201,7 +200,7 @@ public class CustomCompositeBuilder { domainComposite.getIncludes().addAll(workspace.getDeployables()); // Build the domain composite and wire the components included in it - domainCompositeBuilder.build(domainComposite); + domainCompositeBuilder.build(domainComposite, null, monitor); } public void readContribution(String compositeURL, String sourceURI, String sourceURL) throws Exception { |