diff options
author | jsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68> | 2008-10-06 08:32:38 +0000 |
---|---|---|
committer | jsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68> | 2008-10-06 08:32:38 +0000 |
commit | 9fb2fb275d3f69a287ac4f1c7d55190fb7a7bb3b (patch) | |
tree | 40a3b6e43c677e8e9321921b95668eba4c75163a /branches/sca-equinox/itest/validation | |
parent | 4f6fd64d654fec9afb231dd41af9c7d6e41d382f (diff) |
Work in progress. Started to clean up cross-bundle dependencies on ContributionService implementation class, the various CompositeBuilder implementation classes and the ContributionDependencyBuilder implementation class. Added extension points for ContributionBuilders and CompositeBuilders to have them discovered and loaded by the Equinox ServiceDiscovery like other extension points. Moved injection of monitors and SCA definitions to the build methods instead of the constructors to remove references to these implementation constructors. Simplified NodeImpl a bit to remove references to other runtime implementation classes.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@702000 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'branches/sca-equinox/itest/validation')
-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 { |