From 9fb2fb275d3f69a287ac4f1c7d55190fb7a7bb3b Mon Sep 17 00:00:00 2001 From: jsdelfino Date: Mon, 6 Oct 2008 08:32:38 +0000 Subject: 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 --- .../impl/CompositeConfigurationServiceImpl.java | 53 ++++++++++------------ .../impl/CompositeGeneratorServiceImpl.java | 6 +-- .../manager/impl/ContributionCollectionImpl.java | 44 ++++++++++++------ .../impl/DeployableCompositeCollectionImpl.java | 16 ++++--- .../impl/DeployedCompositeCollectionImpl.java | 6 +-- .../impl/NodeProcessCollectionFacadeImpl.java | 4 +- 6 files changed, 72 insertions(+), 57 deletions(-) (limited to 'branches/sca-equinox/modules/domain-manager/src') diff --git a/branches/sca-equinox/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/impl/CompositeConfigurationServiceImpl.java b/branches/sca-equinox/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/impl/CompositeConfigurationServiceImpl.java index 09bb05cf87..32f4882e11 100644 --- a/branches/sca-equinox/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/impl/CompositeConfigurationServiceImpl.java +++ b/branches/sca-equinox/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/impl/CompositeConfigurationServiceImpl.java @@ -40,25 +40,20 @@ import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.xml.namespace.QName; -import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.ParserConfigurationException; import javax.xml.stream.XMLInputFactory; import javax.xml.stream.XMLOutputFactory; import javax.xml.stream.XMLStreamWriter; -import javax.xml.transform.TransformerFactory; import org.apache.tuscany.sca.assembly.AssemblyFactory; import org.apache.tuscany.sca.assembly.Component; 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.CompositeBuilderException; -import org.apache.tuscany.sca.assembly.builder.impl.CompositeBuilderImpl; -import org.apache.tuscany.sca.assembly.builder.impl.CompositeIncludeBuilderImpl; +import org.apache.tuscany.sca.assembly.builder.CompositeBuilderExtensionPoint; import org.apache.tuscany.sca.assembly.xml.Constants; import org.apache.tuscany.sca.contribution.Artifact; 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.ExtensibleURLArtifactProcessor; import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor; @@ -70,21 +65,20 @@ import org.apache.tuscany.sca.contribution.resolver.ModelResolverExtensionPoint; import org.apache.tuscany.sca.contribution.service.ContributionReadException; import org.apache.tuscany.sca.contribution.service.ContributionResolveException; import org.apache.tuscany.sca.core.ExtensionPointRegistry; +import org.apache.tuscany.sca.core.FactoryExtensionPoint; import org.apache.tuscany.sca.core.UtilityExtensionPoint; import org.apache.tuscany.sca.data.collection.Entry; import org.apache.tuscany.sca.data.collection.Item; import org.apache.tuscany.sca.data.collection.LocalItemCollection; import org.apache.tuscany.sca.data.collection.NotFoundException; import org.apache.tuscany.sca.implementation.node.NodeImplementation; -import org.apache.tuscany.sca.implementation.node.builder.impl.NodeCompositeBuilderImpl; -import org.apache.tuscany.sca.interfacedef.InterfaceContractMapper; import org.apache.tuscany.sca.monitor.Monitor; 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.impl.ContributionDependencyBuilderImpl; +import org.apache.tuscany.sca.workspace.builder.ContributionBuilder; +import org.apache.tuscany.sca.workspace.builder.ContributionBuilderException; +import org.apache.tuscany.sca.workspace.builder.ContributionBuilderExtensionPoint; import org.apache.tuscany.sca.workspace.processor.impl.ContributionContentProcessor; import org.osoa.sca.annotations.Init; import org.osoa.sca.annotations.Reference; @@ -115,7 +109,7 @@ public class CompositeConfigurationServiceImpl extends HttpServlet implements Se @Reference public LocalItemCollection cloudCollection; - private ModelFactoryExtensionPoint modelFactories; + private FactoryExtensionPoint modelFactories; private ModelResolverExtensionPoint modelResolvers; private AssemblyFactory assemblyFactory; private WorkspaceFactory workspaceFactory; @@ -123,7 +117,7 @@ public class CompositeConfigurationServiceImpl extends HttpServlet implements Se private StAXArtifactProcessorExtensionPoint staxProcessors; private StAXArtifactProcessor compositeProcessor; private XMLOutputFactory outputFactory; - private ContributionDependencyBuilder contributionDependencyBuilder; + private ContributionBuilder contributionDependencyBuilder; private CompositeBuilder compositeBuilder; private CompositeBuilder compositeIncludeBuilder; private CompositeBuilder nodeConfigurationBuilder; @@ -143,7 +137,7 @@ public class CompositeConfigurationServiceImpl extends HttpServlet implements Se monitor = monitorFactory.createMonitor(); // Get model factories - modelFactories = extensionPoints.getExtensionPoint(ModelFactoryExtensionPoint.class); + modelFactories = extensionPoints.getExtensionPoint(FactoryExtensionPoint.class); assemblyFactory = modelFactories.getFactory(AssemblyFactory.class); XMLInputFactory inputFactory = modelFactories.getFactory(XMLInputFactory.class); outputFactory = modelFactories.getFactory(XMLOutputFactory.class); @@ -162,16 +156,16 @@ public class CompositeConfigurationServiceImpl extends HttpServlet implements Se modelResolvers = extensionPoints.getExtensionPoint(ModelResolverExtensionPoint.class); contributionProcessor = new ContributionContentProcessor(modelFactories, modelResolvers, urlProcessor, staxProcessor, monitor); - // Create contribution and composite builders - DocumentBuilderFactory documentBuilderFactory = modelFactories.getFactory(DocumentBuilderFactory.class); - TransformerFactory transformerFactory = modelFactories.getFactory(TransformerFactory.class); - contributionDependencyBuilder = new ContributionDependencyBuilderImpl(monitor); - SCABindingFactory scaBindingFactory = modelFactories.getFactory(SCABindingFactory.class); - IntentAttachPointTypeFactory intentAttachPointTypeFactory = modelFactories.getFactory(IntentAttachPointTypeFactory.class); - InterfaceContractMapper contractMapper = utilities.getUtility(InterfaceContractMapper.class); - compositeBuilder = new CompositeBuilderImpl(assemblyFactory, scaBindingFactory, intentAttachPointTypeFactory, documentBuilderFactory, transformerFactory, contractMapper, monitor); - compositeIncludeBuilder = new CompositeIncludeBuilderImpl(monitor); - nodeConfigurationBuilder = new NodeCompositeBuilderImpl(assemblyFactory, scaBindingFactory, documentBuilderFactory, transformerFactory, contractMapper, null, monitor); + // Get a contribution dependency builder + ContributionBuilderExtensionPoint contributionBuilders = extensionPoints.getExtensionPoint(ContributionBuilderExtensionPoint.class); + contributionDependencyBuilder = contributionBuilders.getContributionBuilder("org.apache.tuscany.sca.workspace.builder.ContributionDependencyBuilder"); + + // Get composite builders + CompositeBuilderExtensionPoint compositeBuilders = extensionPoints.getExtensionPoint(CompositeBuilderExtensionPoint.class); + compositeBuilder = compositeBuilders.getCompositeBuilder("org.apache.tuscany.sca.assembly.builder.CompositeBuilder"); + nodeConfigurationBuilder = compositeBuilders.getCompositeBuilder("org.apache.tuscany.sca.implementation.node.builder.NodeCompositeBuilder"); + compositeIncludeBuilder = compositeBuilders.getCompositeBuilder("org.apache.tuscany.sca.assembly.builder.CompositeIncludeBuilder"); + nodeConfigurationBuilder = compositeBuilders.getCompositeBuilder("org.apache.tuscany.sca.implementation.node.builder.NodeCompositeBuilder"); } @Override @@ -281,7 +275,7 @@ public class CompositeConfigurationServiceImpl extends HttpServlet implements Se // Fuse includes into the deployable composite try { - compositeIncludeBuilder.build(deployable); + compositeIncludeBuilder.build(deployable, null, monitor); } catch (CompositeBuilderException e) { response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, e.toString()); } @@ -338,7 +332,7 @@ public class CompositeConfigurationServiceImpl extends HttpServlet implements Se Composite nodeComposite = assemblyFactory.createComposite(); nodeComposite.setName(nodeCompositeName); nodeComposite.getComponents().add(nodeComponent); - nodeConfigurationBuilder.build(nodeComposite); + nodeConfigurationBuilder.build(nodeComposite, null, monitor); } catch (CompositeBuilderException e) { throw new ServletException(e); } @@ -347,7 +341,7 @@ public class CompositeConfigurationServiceImpl extends HttpServlet implements Se // Build the domain composite try { - compositeBuilder.build(domainComposite); + compositeBuilder.build(domainComposite, null, monitor); } catch (CompositeBuilderException e) { response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, e.toString()); return; @@ -501,7 +495,10 @@ public class CompositeConfigurationServiceImpl extends HttpServlet implements Se Contribution contribution = (Contribution)contributionProcessor.read(null, uri, location); // Resolve the contribution dependencies - contributionDependencyBuilder.buildContributionDependencies(contribution, workspace); + try { + contributionDependencyBuilder.build(contribution, workspace, monitor); + } catch (ContributionBuilderException e) { + } contributionProcessor.resolve(contribution, workspace.getModelResolver()); return contribution; diff --git a/branches/sca-equinox/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/impl/CompositeGeneratorServiceImpl.java b/branches/sca-equinox/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/impl/CompositeGeneratorServiceImpl.java index 9e024d2d6b..d1d590d4ac 100644 --- a/branches/sca-equinox/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/impl/CompositeGeneratorServiceImpl.java +++ b/branches/sca-equinox/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/impl/CompositeGeneratorServiceImpl.java @@ -47,7 +47,6 @@ import javax.xml.stream.XMLStreamException; import org.apache.tuscany.sca.assembly.Composite; 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.ExtensibleURLArtifactProcessor; import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor; @@ -60,6 +59,7 @@ import org.apache.tuscany.sca.contribution.service.ContributionReadException; import org.apache.tuscany.sca.contribution.service.ContributionResolveException; import org.apache.tuscany.sca.contribution.service.ContributionWriteException; import org.apache.tuscany.sca.core.ExtensionPointRegistry; +import org.apache.tuscany.sca.core.FactoryExtensionPoint; import org.apache.tuscany.sca.core.UtilityExtensionPoint; import org.apache.tuscany.sca.data.collection.Item; import org.apache.tuscany.sca.data.collection.LocalItemCollection; @@ -91,7 +91,7 @@ public class CompositeGeneratorServiceImpl extends HttpServlet implements Servle @Reference public DomainManagerConfiguration domainManagerConfiguration; - private ModelFactoryExtensionPoint modelFactories; + private FactoryExtensionPoint modelFactories; private ModelResolverExtensionPoint modelResolvers; private URLArtifactProcessor contributionProcessor; private StAXArtifactProcessor compositeProcessor; @@ -124,7 +124,7 @@ public class CompositeGeneratorServiceImpl extends HttpServlet implements Servle Monitor monitor = monitorFactory.createMonitor(); // Get model factories - modelFactories = extensionPoints.getExtensionPoint(ModelFactoryExtensionPoint.class); + modelFactories = extensionPoints.getExtensionPoint(FactoryExtensionPoint.class); XMLInputFactory inputFactory = modelFactories.getFactory(XMLInputFactory.class); outputFactory = modelFactories.getFactory(XMLOutputFactory.class); outputFactory.setProperty(XMLOutputFactory.IS_REPAIRING_NAMESPACES, true); diff --git a/branches/sca-equinox/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/impl/ContributionCollectionImpl.java b/branches/sca-equinox/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/impl/ContributionCollectionImpl.java index d642244f2c..9e10a25885 100644 --- a/branches/sca-equinox/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/impl/ContributionCollectionImpl.java +++ b/branches/sca-equinox/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/impl/ContributionCollectionImpl.java @@ -59,7 +59,6 @@ import org.apache.tuscany.sca.contribution.DefaultExport; import org.apache.tuscany.sca.contribution.DefaultImport; import org.apache.tuscany.sca.contribution.Export; import org.apache.tuscany.sca.contribution.Import; -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; @@ -67,6 +66,7 @@ import org.apache.tuscany.sca.contribution.processor.URLArtifactProcessor; import org.apache.tuscany.sca.contribution.processor.URLArtifactProcessorExtensionPoint; import org.apache.tuscany.sca.contribution.service.ContributionReadException; import org.apache.tuscany.sca.core.ExtensionPointRegistry; +import org.apache.tuscany.sca.core.FactoryExtensionPoint; import org.apache.tuscany.sca.core.UtilityExtensionPoint; import org.apache.tuscany.sca.data.collection.Entry; import org.apache.tuscany.sca.data.collection.Item; @@ -80,7 +80,9 @@ import org.apache.tuscany.sca.monitor.Problem; import org.apache.tuscany.sca.monitor.Problem.Severity; 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.ContributionBuilderException; +import org.apache.tuscany.sca.workspace.builder.ContributionBuilderExtensionPoint; import org.apache.tuscany.sca.workspace.builder.impl.ContributionDependencyBuilderImpl; import org.apache.xml.serialize.OutputFormat; import org.apache.xml.serialize.XMLSerializer; @@ -120,6 +122,7 @@ public class ContributionCollectionImpl implements ItemCollection, LocalItemColl private XMLInputFactory inputFactory; private XMLOutputFactory outputFactory; private DocumentBuilder documentBuilder; + private ContributionBuilder contributionDependencyBuilder; /** * Cache workspace and contribution models. @@ -151,7 +154,7 @@ public class ContributionCollectionImpl implements ItemCollection, LocalItemColl monitor = monitorFactory.createMonitor(); // Create model factories - ModelFactoryExtensionPoint modelFactories = extensionPoints.getExtensionPoint(ModelFactoryExtensionPoint.class); + FactoryExtensionPoint modelFactories = extensionPoints.getExtensionPoint(FactoryExtensionPoint.class); outputFactory = modelFactories.getFactory(XMLOutputFactory.class); outputFactory.setProperty(XMLOutputFactory.IS_REPAIRING_NAMESPACES, true); contributionFactory = modelFactories.getFactory(ContributionFactory.class); @@ -169,6 +172,11 @@ public class ContributionCollectionImpl implements ItemCollection, LocalItemColl // Create a document builder (used to pretty print XML) documentBuilder = DocumentBuilderFactory.newInstance().newDocumentBuilder(); + + // Get contribution dependency builder + ContributionBuilderExtensionPoint contributionBuilders = extensionPoints.getExtensionPoint(ContributionBuilderExtensionPoint.class); + contributionDependencyBuilder = contributionBuilders.getContributionBuilder("org.apache.tuscany.sca.workspace.builder.ContributionDependencyBuilder"); + } public Entry[] getAll() { @@ -182,7 +190,7 @@ public class ContributionCollectionImpl implements ItemCollection, LocalItemColl if (contribution.getURI().equals(DEPLOYMENT_CONTRIBUTION_URI)) { continue; } - entries.add(entry(workspace, contribution, monitor)); + entries.add(entry(workspace, contribution, contributionDependencyBuilder, monitor)); } return entries.toArray(new Entry[entries.size()]); } @@ -194,7 +202,7 @@ public class ContributionCollectionImpl implements ItemCollection, LocalItemColl Workspace workspace = readContributions(readWorkspace()); for (Contribution contribution: workspace.getContributions()) { if (key.equals(contribution.getURI())) { - return item(workspace, contribution, monitor); + return item(workspace, contribution, contributionDependencyBuilder, monitor); } } throw new NotFoundException(key); @@ -282,8 +290,11 @@ public class ContributionCollectionImpl implements ItemCollection, LocalItemColl if (key.equals(contribution.getURI())) { // Compute the contribution dependencies - ContributionDependencyBuilder analyzer = new ContributionDependencyBuilderImpl(monitor); - List dependencies = analyzer.buildContributionDependencies(contribution, workspace); + try { + contributionDependencyBuilder.build(contribution, workspace, monitor); + } catch (ContributionBuilderException e) { + } + List dependencies = contribution.getDependencies(); // Returns entries for the dependencies // optionally skip the specified contribution @@ -293,7 +304,7 @@ public class ContributionCollectionImpl implements ItemCollection, LocalItemColl // Skip the specified contribution continue; } - entries.add(entry(workspace, dependency, monitor)); + entries.add(entry(workspace, dependency, contributionDependencyBuilder, monitor)); } break; } @@ -363,7 +374,7 @@ public class ContributionCollectionImpl implements ItemCollection, LocalItemColl Contribution contribution = contributionFactory.createContribution(); contribution.setURI(uri); contribution.setLocation(locationPath); - entries.add(entry(suggestionWorkspace, contribution, monitor)); + entries.add(entry(suggestionWorkspace, contribution, contributionDependencyBuilder, monitor)); } } @@ -379,10 +390,11 @@ public class ContributionCollectionImpl implements ItemCollection, LocalItemColl * @param contribution * @return */ - private static Entry entry(Workspace workspace, Contribution contribution, Monitor monitor) { + private static Entry entry(Workspace workspace, Contribution contribution, + ContributionBuilder contributionDependencyBuilder, Monitor monitor) { Entry entry = new Entry(); entry.setKey(contribution.getURI()); - entry.setData(item(workspace, contribution, monitor)); + entry.setData(item(workspace, contribution, contributionDependencyBuilder, monitor)); return entry; } @@ -394,7 +406,8 @@ public class ContributionCollectionImpl implements ItemCollection, LocalItemColl * @param monitor * @return */ - private static Item item(Workspace workspace, Contribution contribution, final Monitor monitor) { + private static Item item(Workspace workspace, Contribution contribution, + ContributionBuilder contributionDependencyBuilder, final Monitor monitor) { String contributionURI = contribution.getURI(); Item item = new Item(); item.setTitle(title(contributionURI)); @@ -427,8 +440,11 @@ public class ContributionCollectionImpl implements ItemCollection, LocalItemColl }; StringBuffer sb = new StringBuffer(); - ContributionDependencyBuilderImpl analyzer = new ContributionDependencyBuilderImpl(recordingMonitor); - List dependencies = analyzer.buildContributionDependencies(contribution, workspace); + try { + contributionDependencyBuilder.build(contribution, workspace, recordingMonitor); + } catch (ContributionBuilderException e) { + } + List dependencies = contribution.getDependencies(); if (dependencies.size() > 1) { sb.append("Dependencies: "); for (int i = 0, n = dependencies.size(); i < n ; i++) { diff --git a/branches/sca-equinox/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/impl/DeployableCompositeCollectionImpl.java b/branches/sca-equinox/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/impl/DeployableCompositeCollectionImpl.java index e66a8b6684..fcbe00f48a 100644 --- a/branches/sca-equinox/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/impl/DeployableCompositeCollectionImpl.java +++ b/branches/sca-equinox/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/impl/DeployableCompositeCollectionImpl.java @@ -47,7 +47,6 @@ 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.contribution.Contribution; -import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint; import org.apache.tuscany.sca.contribution.processor.ExtensibleStAXArtifactProcessor; import org.apache.tuscany.sca.contribution.processor.ExtensibleURLArtifactProcessor; import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor; @@ -59,6 +58,7 @@ import org.apache.tuscany.sca.contribution.resolver.ModelResolverExtensionPoint; import org.apache.tuscany.sca.contribution.service.ContributionReadException; import org.apache.tuscany.sca.contribution.service.ContributionResolveException; import org.apache.tuscany.sca.core.ExtensionPointRegistry; +import org.apache.tuscany.sca.core.FactoryExtensionPoint; import org.apache.tuscany.sca.core.UtilityExtensionPoint; import org.apache.tuscany.sca.data.collection.Entry; import org.apache.tuscany.sca.data.collection.Item; @@ -69,7 +69,8 @@ import org.apache.tuscany.sca.domain.manager.impl.DeployableCompositeCollectionI import org.apache.tuscany.sca.implementation.node.NodeImplementation; import org.apache.tuscany.sca.monitor.Monitor; import org.apache.tuscany.sca.monitor.MonitorFactory; -import org.apache.tuscany.sca.workspace.builder.ContributionDependencyBuilder; +import org.apache.tuscany.sca.workspace.builder.ContributionBuilder; +import org.apache.tuscany.sca.workspace.builder.ContributionBuilderExtensionPoint; import org.apache.tuscany.sca.workspace.builder.impl.ContributionDependencyBuilderImpl; import org.apache.tuscany.sca.workspace.processor.impl.ContributionContentProcessor; import org.osoa.sca.annotations.Init; @@ -94,11 +95,11 @@ public class DeployableCompositeCollectionImpl implements ItemCollection, LocalI @Reference public DomainManagerConfiguration domainManagerConfiguration; - private ModelFactoryExtensionPoint modelFactories; + private FactoryExtensionPoint modelFactories; private ModelResolverExtensionPoint modelResolvers; private URLArtifactProcessor contributionProcessor; private XMLOutputFactory outputFactory; - private ContributionDependencyBuilder contributionDependencyBuilder; + private ContributionBuilder contributionDependencyBuilder; private Monitor monitor; /** @@ -128,7 +129,7 @@ public class DeployableCompositeCollectionImpl implements ItemCollection, LocalI monitor = monitorFactory.createMonitor(); // Get model factories - modelFactories = extensionPoints.getExtensionPoint(ModelFactoryExtensionPoint.class); + modelFactories = extensionPoints.getExtensionPoint(FactoryExtensionPoint.class); XMLInputFactory inputFactory = modelFactories.getFactory(XMLInputFactory.class); outputFactory = modelFactories.getFactory(XMLOutputFactory.class); outputFactory.setProperty(XMLOutputFactory.IS_REPAIRING_NAMESPACES, true); @@ -144,8 +145,9 @@ public class DeployableCompositeCollectionImpl implements ItemCollection, LocalI modelResolvers = extensionPoints.getExtensionPoint(ModelResolverExtensionPoint.class); contributionProcessor = new ContributionContentProcessor(modelFactories, modelResolvers, urlProcessor, staxProcessor, monitor); - // Create contribution and composite builders - contributionDependencyBuilder = new ContributionDependencyBuilderImpl(monitor); + // Get a contribution dependency builder + ContributionBuilderExtensionPoint contributionBuilders = extensionPoints.getExtensionPoint(ContributionBuilderExtensionPoint.class); + contributionDependencyBuilder = contributionBuilders.getContributionBuilder("org.apache.tuscany.sca.workspace.builder.ContributionDependencyBuilder"); } public Entry[] getAll() { diff --git a/branches/sca-equinox/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/impl/DeployedCompositeCollectionImpl.java b/branches/sca-equinox/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/impl/DeployedCompositeCollectionImpl.java index e95a0cc585..d2d1e04a79 100644 --- a/branches/sca-equinox/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/impl/DeployedCompositeCollectionImpl.java +++ b/branches/sca-equinox/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/impl/DeployedCompositeCollectionImpl.java @@ -50,10 +50,10 @@ import javax.xml.stream.XMLStreamWriter; import org.apache.tuscany.sca.assembly.AssemblyFactory; import org.apache.tuscany.sca.assembly.Composite; import org.apache.tuscany.sca.assembly.xml.Constants; -import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint; import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor; import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessorExtensionPoint; import org.apache.tuscany.sca.core.ExtensionPointRegistry; +import org.apache.tuscany.sca.core.FactoryExtensionPoint; import org.apache.tuscany.sca.data.collection.Entry; import org.apache.tuscany.sca.data.collection.Item; import org.apache.tuscany.sca.data.collection.ItemCollection; @@ -94,7 +94,7 @@ public class DeployedCompositeCollectionImpl implements ItemCollection, LocalIte @Reference public DomainManagerConfiguration domainManagerConfiguration; - private ModelFactoryExtensionPoint modelFactories; + private FactoryExtensionPoint modelFactories; private AssemblyFactory assemblyFactory; private StAXArtifactProcessor compositeProcessor; private XMLOutputFactory outputFactory; @@ -118,7 +118,7 @@ public class DeployedCompositeCollectionImpl implements ItemCollection, LocalIte // Create factories ExtensionPointRegistry extensionPoints = domainManagerConfiguration.getExtensionPoints(); - modelFactories = extensionPoints.getExtensionPoint(ModelFactoryExtensionPoint.class); + modelFactories = extensionPoints.getExtensionPoint(FactoryExtensionPoint.class); assemblyFactory = modelFactories.getFactory(AssemblyFactory.class); outputFactory = modelFactories.getFactory(XMLOutputFactory.class); outputFactory.setProperty(XMLOutputFactory.IS_REPAIRING_NAMESPACES, true); diff --git a/branches/sca-equinox/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/impl/NodeProcessCollectionFacadeImpl.java b/branches/sca-equinox/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/impl/NodeProcessCollectionFacadeImpl.java index d68cfa3786..53616f3b46 100644 --- a/branches/sca-equinox/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/impl/NodeProcessCollectionFacadeImpl.java +++ b/branches/sca-equinox/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/impl/NodeProcessCollectionFacadeImpl.java @@ -31,8 +31,8 @@ import javax.xml.namespace.QName; import org.apache.tuscany.sca.assembly.AssemblyFactory; import org.apache.tuscany.sca.binding.atom.AtomBindingFactory; -import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint; import org.apache.tuscany.sca.core.ExtensionPointRegistry; +import org.apache.tuscany.sca.core.FactoryExtensionPoint; import org.apache.tuscany.sca.core.assembly.CompositeActivator; import org.apache.tuscany.sca.data.collection.Entry; import org.apache.tuscany.sca.data.collection.Item; @@ -81,7 +81,7 @@ public class NodeProcessCollectionFacadeImpl implements ItemCollection, LocalIte // Get the model factories ExtensionPointRegistry extensionPoints = domainManagerConfiguration.getExtensionPoints(); - ModelFactoryExtensionPoint modelFactories = extensionPoints.getExtensionPoint(ModelFactoryExtensionPoint.class); + FactoryExtensionPoint modelFactories = extensionPoints.getExtensionPoint(FactoryExtensionPoint.class); assemblyFactory = modelFactories.getFactory(AssemblyFactory.class); atomBindingFactory = modelFactories.getFactory(AtomBindingFactory.class); } -- cgit v1.2.3