diff options
author | rfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68> | 2008-12-12 00:50:31 +0000 |
---|---|---|
committer | rfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68> | 2008-12-12 00:50:31 +0000 |
commit | 5539c56151df288a5754f61dde6d9008df7f0b26 (patch) | |
tree | 603921c5f06051eea5dfa27a478bab92f367038e /java/sca/modules/assembly-xml/src/main/java | |
parent | 22dd2ce77421ca588d903c6af921ef0daa1be37a (diff) |
Pass the DocumentBuilderFactory around to work with OSGi
Remove unused constructors
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@725871 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/sca/modules/assembly-xml/src/main/java')
8 files changed, 48 insertions, 141 deletions
diff --git a/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/BaseAssemblyProcessor.java b/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/BaseAssemblyProcessor.java index edcbd13465..bf331f5422 100644 --- a/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/BaseAssemblyProcessor.java +++ b/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/BaseAssemblyProcessor.java @@ -67,7 +67,6 @@ import org.apache.tuscany.sca.assembly.Multiplicity; import org.apache.tuscany.sca.assembly.OperationsConfigurator; import org.apache.tuscany.sca.assembly.Reference; import org.apache.tuscany.sca.assembly.Service; -import org.apache.tuscany.sca.contribution.ContributionFactory; import org.apache.tuscany.sca.contribution.processor.BaseStAXArtifactProcessor; import org.apache.tuscany.sca.contribution.processor.ContributionReadException; import org.apache.tuscany.sca.contribution.processor.ContributionResolveException; @@ -75,6 +74,7 @@ import org.apache.tuscany.sca.contribution.processor.ContributionWriteException; import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor; import org.apache.tuscany.sca.contribution.processor.StAXAttributeProcessor; import org.apache.tuscany.sca.contribution.resolver.ModelResolver; +import org.apache.tuscany.sca.core.FactoryExtensionPoint; import org.apache.tuscany.sca.interfacedef.InterfaceContract; import org.apache.tuscany.sca.monitor.Monitor; import org.apache.tuscany.sca.monitor.Problem; @@ -109,40 +109,37 @@ abstract class BaseAssemblyProcessor extends BaseStAXArtifactProcessor { /** * Constructs a new BaseArtifactProcessor. - * @param contribFactory * @param factory * @param policyFactory */ @SuppressWarnings("unchecked") - public BaseAssemblyProcessor(ContributionFactory contribFactory, - AssemblyFactory factory, + protected BaseAssemblyProcessor(AssemblyFactory factory, PolicyFactory policyFactory, + DocumentBuilderFactory documentBuilderFactory, StAXArtifactProcessor extensionProcessor, Monitor monitor) { this.assemblyFactory = factory; this.policyFactory = policyFactory; + this.documentBuilderFactory = documentBuilderFactory; this.extensionProcessor = (StAXArtifactProcessor<Object>)extensionProcessor; this.policyProcessor = new PolicyAttachPointProcessor(policyFactory); this.monitor = monitor; } - + /** - * Constructs a new BaseArtifactProcessor. - * @param factory - * @param policyFactory + * @param modelFactories + * @param staxProcessor + * @param monitor */ - @SuppressWarnings("unchecked") - public BaseAssemblyProcessor(AssemblyFactory factory, - PolicyFactory policyFactory, - StAXArtifactProcessor extensionProcessor, - Monitor monitor) { - this.assemblyFactory = factory; - this.policyFactory = policyFactory; - this.extensionProcessor = (StAXArtifactProcessor<Object>)extensionProcessor; + protected BaseAssemblyProcessor(FactoryExtensionPoint modelFactories, + StAXArtifactProcessor staxProcessor, + Monitor monitor) { + this.assemblyFactory = modelFactories.getFactory(AssemblyFactory.class); + this.policyFactory = modelFactories.getFactory(PolicyFactory.class); + this.documentBuilderFactory = modelFactories.getFactory(DocumentBuilderFactory.class); + this.extensionProcessor = (StAXArtifactProcessor<Object>)staxProcessor; this.policyProcessor = new PolicyAttachPointProcessor(policyFactory); this.monitor = monitor; - - //TODO - this constructor should take a monitor too. } /** diff --git a/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/ComponentTypeDocumentProcessor.java b/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/ComponentTypeDocumentProcessor.java index 629a0b6cae..969115cf4c 100644 --- a/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/ComponentTypeDocumentProcessor.java +++ b/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/ComponentTypeDocumentProcessor.java @@ -30,7 +30,6 @@ import javax.xml.stream.XMLStreamException; import javax.xml.stream.XMLStreamReader; import org.apache.tuscany.sca.assembly.ComponentType; -import org.apache.tuscany.sca.monitor.Monitor; import org.apache.tuscany.sca.contribution.processor.ContributionReadException; import org.apache.tuscany.sca.contribution.processor.ContributionResolveException; import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor; @@ -38,6 +37,7 @@ import org.apache.tuscany.sca.contribution.processor.URLArtifactProcessor; import org.apache.tuscany.sca.contribution.processor.ValidatingXMLInputFactory; import org.apache.tuscany.sca.contribution.resolver.ModelResolver; import org.apache.tuscany.sca.core.FactoryExtensionPoint; +import org.apache.tuscany.sca.monitor.Monitor; /** * A componentType processor. @@ -49,26 +49,13 @@ public class ComponentTypeDocumentProcessor extends BaseAssemblyProcessor implem /** * Constructs a new componentType processor. - * @param factory - * @param policyFactory - * @param registry - */ - public ComponentTypeDocumentProcessor(StAXArtifactProcessor staxProcessor, - XMLInputFactory inputFactory, - Monitor monitor) { - super(null, null, staxProcessor, monitor); - this.inputFactory = inputFactory; - } - - /** - * Constructs a new componentType processor. * @param modelFactories * @param staxProcessor */ - public ComponentTypeDocumentProcessor(FactoryExtensionPoint modelFactories, - StAXArtifactProcessor staxProcessor, - Monitor monitor) { - super(null, null, staxProcessor, monitor); + public ComponentTypeDocumentProcessor(FactoryExtensionPoint modelFactories, + StAXArtifactProcessor staxProcessor, + Monitor monitor) { + super(modelFactories, staxProcessor, monitor); this.inputFactory = modelFactories.getFactory(ValidatingXMLInputFactory.class); } diff --git a/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/ComponentTypeProcessor.java b/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/ComponentTypeProcessor.java index 5b5f15cb96..a8c2d6a7e9 100644 --- a/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/ComponentTypeProcessor.java +++ b/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/ComponentTypeProcessor.java @@ -44,7 +44,6 @@ import javax.xml.stream.XMLStreamException; import javax.xml.stream.XMLStreamReader; import javax.xml.stream.XMLStreamWriter; -import org.apache.tuscany.sca.assembly.AssemblyFactory; import org.apache.tuscany.sca.assembly.Binding; import org.apache.tuscany.sca.assembly.Callback; import org.apache.tuscany.sca.assembly.ComponentType; @@ -65,7 +64,6 @@ import org.apache.tuscany.sca.interfacedef.Operation; import org.apache.tuscany.sca.interfacedef.impl.OperationImpl; import org.apache.tuscany.sca.monitor.Monitor; import org.apache.tuscany.sca.policy.IntentAttachPoint; -import org.apache.tuscany.sca.policy.PolicyFactory; import org.apache.tuscany.sca.policy.PolicySetAttachPoint; import org.w3c.dom.Document; @@ -78,27 +76,17 @@ public class ComponentTypeProcessor extends BaseAssemblyProcessor implements StA /** * Constructs a new componentType processor. - * @param factory - * @param policyFactory - * @param registry - */ - public ComponentTypeProcessor(AssemblyFactory factory, PolicyFactory policyFactory, - StAXArtifactProcessor extensionProcessor, StAXAttributeProcessor extensionAttributeProcessor, Monitor monitor) { - super(factory, policyFactory, extensionProcessor, monitor); - } - - /** - * Constructs a new componentType processor. * * @param modelFactories * @param extensionProcessor + * @param extensionAttributeProcessor + * @param monitor */ - public ComponentTypeProcessor(FactoryExtensionPoint modelFactories, - StAXArtifactProcessor extensionProcessor, - StAXAttributeProcessor extensionAttributeProcessor, - Monitor monitor) { - super(modelFactories.getFactory(AssemblyFactory.class), - modelFactories.getFactory(PolicyFactory.class), extensionProcessor, monitor); + public ComponentTypeProcessor(FactoryExtensionPoint modelFactories, + StAXArtifactProcessor extensionProcessor, + StAXAttributeProcessor extensionAttributeProcessor, + Monitor monitor) { + super(modelFactories, extensionProcessor, monitor); } public ComponentType read(XMLStreamReader reader) throws ContributionReadException { diff --git a/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/CompositeDocumentProcessor.java b/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/CompositeDocumentProcessor.java index 57d2330210..476a5fe08c 100644 --- a/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/CompositeDocumentProcessor.java +++ b/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/CompositeDocumentProcessor.java @@ -62,44 +62,14 @@ public class CompositeDocumentProcessor extends BaseAssemblyProcessor implements private int scaDefnsCount = 0; /** - * Construct a new composite processor - * @param assemblyFactory - * @param policyFactory - * @param staxProcessor - */ - @Deprecated - public CompositeDocumentProcessor(StAXArtifactProcessor staxProcessor, - XMLInputFactory inputFactory, - List scaDefnsSink, Monitor monitor) { - super(null, null, staxProcessor, monitor); - this.inputFactory = inputFactory; - this.scaDefnSink = scaDefnsSink; - } - - /** - * Construct a new composite processor - * @param assemblyFactory - * @param policyFactory - * @param staxProcessor - */ - public CompositeDocumentProcessor(StAXArtifactProcessor staxProcessor, - XMLInputFactory inputFactory, - DocumentBuilderFactory documentBuilderFactory, - List scaDefnsSink, Monitor monitor) { - super(null, null, staxProcessor, monitor); - this.documentBuilderFactory = documentBuilderFactory; - this.inputFactory = inputFactory; - this.scaDefnSink = scaDefnsSink; - } - - /** * Constructs a new composite processor. * @param modelFactories * @param staxProcessor */ - public CompositeDocumentProcessor(FactoryExtensionPoint modelFactories, - StAXArtifactProcessor staxProcessor, Monitor monitor) { - super(null, null, staxProcessor, monitor); + public CompositeDocumentProcessor(FactoryExtensionPoint modelFactories, + StAXArtifactProcessor staxProcessor, + Monitor monitor) { + super(modelFactories, staxProcessor, monitor); this.inputFactory = modelFactories.getFactory(ValidatingXMLInputFactory.class); this.documentBuilderFactory = modelFactories.getFactory(DocumentBuilderFactory.class); } diff --git a/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/CompositeProcessor.java b/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/CompositeProcessor.java index f6db3fe94c..652d668577 100644 --- a/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/CompositeProcessor.java +++ b/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/CompositeProcessor.java @@ -70,7 +70,6 @@ import javax.xml.xpath.XPath; import javax.xml.xpath.XPathExpressionException; import javax.xml.xpath.XPathFactory; -import org.apache.tuscany.sca.assembly.AssemblyFactory; import org.apache.tuscany.sca.assembly.Binding; import org.apache.tuscany.sca.assembly.Callback; import org.apache.tuscany.sca.assembly.Component; @@ -107,7 +106,6 @@ import org.apache.tuscany.sca.monitor.MonitorFactory; import org.apache.tuscany.sca.policy.Intent; import org.apache.tuscany.sca.policy.IntentAttachPointType; import org.apache.tuscany.sca.policy.IntentAttachPointTypeFactory; -import org.apache.tuscany.sca.policy.PolicyFactory; import org.apache.tuscany.sca.policy.PolicySet; import org.apache.tuscany.sca.policy.PolicySetAttachPoint; import org.apache.tuscany.sca.policy.util.PolicyComputationUtils; @@ -158,11 +156,7 @@ public class CompositeProcessor extends BaseAssemblyProcessor implements StAXArt StAXAttributeProcessor extensionAttributeProcessor, Monitor monitor) { - super(modelFactories.getFactory(ContributionFactory.class), - modelFactories.getFactory(AssemblyFactory.class), - modelFactories.getFactory(PolicyFactory.class), - extensionProcessor, - monitor); + super(modelFactories, extensionProcessor, monitor); this.intentAttachPointTypeFactory = modelFactories.getFactory(IntentAttachPointTypeFactory.class); this.xPathFactory = modelFactories.getFactory(XPathFactory.class); this.contributionFactory = modelFactories.getFactory(ContributionFactory.class); diff --git a/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/ConstrainingTypeDocumentProcessor.java b/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/ConstrainingTypeDocumentProcessor.java index f04d27491f..401fa7123e 100644 --- a/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/ConstrainingTypeDocumentProcessor.java +++ b/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/ConstrainingTypeDocumentProcessor.java @@ -48,27 +48,14 @@ public class ConstrainingTypeDocumentProcessor extends BaseAssemblyProcessor imp private XMLInputFactory inputFactory; /** - * Construct a new constrainingType processor. - * @param factory - * @param policyFactory - * @param staxProcessor - */ - public ConstrainingTypeDocumentProcessor(StAXArtifactProcessor staxProcessor, - XMLInputFactory inputFactory, - Monitor monitor) { - super(null, null, staxProcessor, monitor); - this.inputFactory = inputFactory; - } - - /** * Constructs a new constrainingType processor. * @param modelFactories * @param staxProcessor */ - public ConstrainingTypeDocumentProcessor(FactoryExtensionPoint modelFactories, - StAXArtifactProcessor staxProcessor, - Monitor monitor) { - super(null, null, staxProcessor, monitor); + public ConstrainingTypeDocumentProcessor(FactoryExtensionPoint modelFactories, + StAXArtifactProcessor staxProcessor, + Monitor monitor) { + super(modelFactories, staxProcessor, monitor); this.inputFactory = modelFactories.getFactory(ValidatingXMLInputFactory.class); } diff --git a/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/ConstrainingTypeProcessor.java b/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/ConstrainingTypeProcessor.java index 8b187960c5..d6c1b278bb 100644 --- a/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/ConstrainingTypeProcessor.java +++ b/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/ConstrainingTypeProcessor.java @@ -46,7 +46,6 @@ import org.apache.tuscany.sca.assembly.AbstractContract; import org.apache.tuscany.sca.assembly.AbstractProperty; import org.apache.tuscany.sca.assembly.AbstractReference; import org.apache.tuscany.sca.assembly.AbstractService; -import org.apache.tuscany.sca.assembly.AssemblyFactory; import org.apache.tuscany.sca.assembly.ConstrainingType; import org.apache.tuscany.sca.contribution.processor.ContributionReadException; import org.apache.tuscany.sca.contribution.processor.ContributionResolveException; @@ -58,7 +57,6 @@ import org.apache.tuscany.sca.interfacedef.InterfaceContract; import org.apache.tuscany.sca.interfacedef.Operation; import org.apache.tuscany.sca.interfacedef.impl.OperationImpl; import org.apache.tuscany.sca.monitor.Monitor; -import org.apache.tuscany.sca.policy.PolicyFactory; import org.w3c.dom.Document; /** @@ -69,27 +67,15 @@ import org.w3c.dom.Document; public class ConstrainingTypeProcessor extends BaseAssemblyProcessor implements StAXArtifactProcessor<ConstrainingType> { /** - * Construct a new constrainingType processor. - * @param factory - * @param policyFactory - * @param extensionProcessor - */ - public ConstrainingTypeProcessor(AssemblyFactory factory, PolicyFactory policyFactory, - StAXArtifactProcessor extensionProcessor, Monitor monitor) { - super(factory, policyFactory, extensionProcessor, monitor); - } - - /** * Constructs a new constrainingType processor. * * @param modelFactories * @param extensionProcessor */ - public ConstrainingTypeProcessor(FactoryExtensionPoint modelFactories, - StAXArtifactProcessor extensionProcessor, - Monitor monitor) { - super(modelFactories.getFactory(AssemblyFactory.class), - modelFactories.getFactory(PolicyFactory.class), extensionProcessor, monitor); + public ConstrainingTypeProcessor(FactoryExtensionPoint modelFactories, + StAXArtifactProcessor extensionProcessor, + Monitor monitor) { + super(modelFactories, extensionProcessor, monitor); } public ConstrainingType read(XMLStreamReader reader) throws ContributionReadException { diff --git a/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/DefaultBeanModelProcessor.java b/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/DefaultBeanModelProcessor.java index 890cf36b26..b29910e215 100644 --- a/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/DefaultBeanModelProcessor.java +++ b/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/DefaultBeanModelProcessor.java @@ -32,17 +32,16 @@ import javax.xml.stream.XMLStreamException; import javax.xml.stream.XMLStreamReader; import javax.xml.stream.XMLStreamWriter; -import org.apache.tuscany.sca.assembly.AssemblyFactory; import org.apache.tuscany.sca.assembly.Base; import org.apache.tuscany.sca.assembly.ComponentType; import org.apache.tuscany.sca.assembly.Implementation; -import org.apache.tuscany.sca.monitor.Monitor; import org.apache.tuscany.sca.contribution.processor.ContributionReadException; import org.apache.tuscany.sca.contribution.processor.ContributionResolveException; import org.apache.tuscany.sca.contribution.processor.ContributionWriteException; import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor; import org.apache.tuscany.sca.contribution.resolver.ModelResolver; -import org.apache.tuscany.sca.policy.PolicyFactory; +import org.apache.tuscany.sca.core.FactoryExtensionPoint; +import org.apache.tuscany.sca.monitor.Monitor; import org.apache.tuscany.sca.policy.PolicySetAttachPoint; /** @@ -59,13 +58,12 @@ public class DefaultBeanModelProcessor extends BaseAssemblyProcessor implements private Map<String, Method> setterMethods = new HashMap<String, Method>(); private Map<String, Method> getterMethods = new HashMap<String, Method>(); - public DefaultBeanModelProcessor(AssemblyFactory assemblyFactory, - PolicyFactory policyFactory, - QName artifactType, - Class<Implementation> modelClass, - Object modelFactory, - Monitor monitor) { - super(assemblyFactory, policyFactory, null, monitor); + public DefaultBeanModelProcessor(FactoryExtensionPoint modeFactories, + QName artifactType, + Class<Implementation> modelClass, + Object modelFactory, + Monitor monitor) { + super(modeFactories, null, monitor); this.artifactType = artifactType; this.modelClass = modelClass; this.modelFactory = modelFactory; |