diff options
Diffstat (limited to 'branches/sca-equinox')
3 files changed, 16 insertions, 37 deletions
diff --git a/branches/sca-equinox/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/BaseAssemblyProcessor.java b/branches/sca-equinox/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/BaseAssemblyProcessor.java index cc8b30b88b..8ac9386e19 100644 --- a/branches/sca-equinox/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/BaseAssemblyProcessor.java +++ b/branches/sca-equinox/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/BaseAssemblyProcessor.java @@ -70,11 +70,9 @@ import org.apache.tuscany.sca.monitor.Problem.Severity; import org.apache.tuscany.sca.policy.Intent; import org.apache.tuscany.sca.policy.IntentAttachPoint; 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.impl.IntentAttachPointTypeFactoryImpl; import org.apache.tuscany.sca.policy.util.PolicyValidationException; import org.apache.tuscany.sca.policy.util.PolicyValidationUtils; import org.w3c.dom.Document; @@ -90,13 +88,11 @@ import org.w3c.dom.NodeList; */ abstract class BaseAssemblyProcessor extends BaseStAXArtifactProcessor implements Constants { - protected ContributionFactory contributionFactory; protected AssemblyFactory assemblyFactory; protected PolicyFactory policyFactory; protected StAXArtifactProcessor<Object> extensionProcessor; protected PolicyAttachPointProcessor policyProcessor; private DocumentBuilderFactory documentBuilderFactory; - protected IntentAttachPointTypeFactory intentAttachPointTypeFactory; private Monitor monitor; /** @@ -114,9 +110,7 @@ abstract class BaseAssemblyProcessor extends BaseStAXArtifactProcessor implement this.assemblyFactory = factory; this.policyFactory = policyFactory; this.extensionProcessor = (StAXArtifactProcessor<Object>)extensionProcessor; - this.contributionFactory = contribFactory; this.policyProcessor = new PolicyAttachPointProcessor(policyFactory); - this.intentAttachPointTypeFactory = new IntentAttachPointTypeFactoryImpl(); this.monitor = monitor; } diff --git a/branches/sca-equinox/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/CompositeProcessor.java b/branches/sca-equinox/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/CompositeProcessor.java index fd7dd3a532..b755684517 100644 --- a/branches/sca-equinox/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/CompositeProcessor.java +++ b/branches/sca-equinox/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/CompositeProcessor.java @@ -72,6 +72,7 @@ import org.apache.tuscany.sca.monitor.Monitor; 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; @@ -86,10 +87,11 @@ import org.w3c.dom.Document; * @version $Rev$ $Date$ */ public class CompositeProcessor extends BaseAssemblyProcessor implements StAXArtifactProcessor<Composite> { - // FIXME: to be refactored - private XPathFactory xPathFactory = XPathFactory.newInstance(); - - protected StAXAttributeProcessor<Object> extensionAttributeProcessor; + private XPathFactory xPathFactory; + private IntentAttachPointTypeFactory intentAttachPointTypeFactory; + private StAXAttributeProcessor<Object> extensionAttributeProcessor; + private ContributionFactory contributionFactory; + /** * Construct a new composite processor @@ -127,28 +129,13 @@ public class CompositeProcessor extends BaseAssemblyProcessor implements StAXArt modelFactories.getFactory(PolicyFactory.class), extensionProcessor, monitor); - + this.intentAttachPointTypeFactory = modelFactories.getFactory(IntentAttachPointTypeFactory.class); + this.xPathFactory = modelFactories.getFactory(XPathFactory.class); + this.contributionFactory = modelFactories.getFactory(ContributionFactory.class); this.extensionAttributeProcessor = extensionAttributeProcessor; } - /** - * Construct a new composite processor - * - * @param contributionFactory - * @param assemblyFactory - * @param policyFactory - * @param extensionProcessor - */ - public CompositeProcessor(ContributionFactory contributionFactory, - AssemblyFactory assemblyFactory, - PolicyFactory policyFactory, - StAXArtifactProcessor extensionProcessor, - StAXAttributeProcessor extensionAttributeProcessor, - Monitor monitor) { - super(contributionFactory, assemblyFactory, policyFactory, extensionProcessor, monitor); - } - public Composite read(XMLStreamReader reader) throws ContributionReadException, XMLStreamException { Composite composite = null; Composite include = null; diff --git a/branches/sca-equinox/modules/binding-gdata/src/main/java/org/apache/tuscany/sca/binding/gdata/xml/GdataBindingProcessor.java b/branches/sca-equinox/modules/binding-gdata/src/main/java/org/apache/tuscany/sca/binding/gdata/xml/GdataBindingProcessor.java index 52f36b29ad..18795837c4 100644 --- a/branches/sca-equinox/modules/binding-gdata/src/main/java/org/apache/tuscany/sca/binding/gdata/xml/GdataBindingProcessor.java +++ b/branches/sca-equinox/modules/binding-gdata/src/main/java/org/apache/tuscany/sca/binding/gdata/xml/GdataBindingProcessor.java @@ -26,7 +26,8 @@ import javax.xml.stream.XMLStreamException; import javax.xml.stream.XMLStreamReader; import javax.xml.stream.XMLStreamWriter; -//import org.apache.tuscany.sca.assembly.xml.PolicyAttachPointProcessor; +import org.apache.tuscany.sca.binding.gdata.GdataBinding; +import org.apache.tuscany.sca.binding.gdata.GdataBindingFactory; import org.apache.tuscany.sca.contribution.processor.ContributionReadException; import org.apache.tuscany.sca.contribution.processor.ContributionResolveException; import org.apache.tuscany.sca.contribution.processor.ContributionWriteException; @@ -34,13 +35,10 @@ import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor; import org.apache.tuscany.sca.contribution.resolver.ModelResolver; import org.apache.tuscany.sca.core.FactoryExtensionPoint; 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.PolicySet; import org.apache.tuscany.sca.policy.PolicySetAttachPoint; -import org.apache.tuscany.sca.policy.IntentAttachPointType; -import org.apache.tuscany.sca.policy.impl.IntentAttachPointTypeFactoryImpl; - -import org.apache.tuscany.sca.binding.gdata.GdataBinding; -import org.apache.tuscany.sca.binding.gdata.GdataBindingFactory; /** * A processor for <binding.gdata> elements. @@ -50,13 +48,13 @@ public class GdataBindingProcessor implements StAXArtifactProcessor<GdataBinding private QName BINDING_GDATA = new QName("http://tuscany.apache.org/xmlns/sca/1.0", "binding.gdata"); private final GdataBindingFactory factory; + private IntentAttachPointTypeFactory intentAttachPointTypeFactory; //private PolicyAttachPointProcessor policyProcessor; public GdataBindingProcessor(FactoryExtensionPoint modelFactories) { this.factory = modelFactories.getFactory(GdataBindingFactory.class); - System.out.println("[Debug Info]GdataBindingProcessor reached"); - //this.policyProcessor = new PolicyAttachPointProcessor(policyFactory); + this.intentAttachPointTypeFactory = modelFactories.getFactory(IntentAttachPointTypeFactory.class); } public QName getArtifactType() { @@ -69,7 +67,7 @@ public class GdataBindingProcessor implements StAXArtifactProcessor<GdataBinding public GdataBinding read(XMLStreamReader reader) throws ContributionReadException, XMLStreamException { GdataBinding gdataBinding = factory.createGdataBinding(); - IntentAttachPointType bindingType = new IntentAttachPointTypeFactoryImpl().createBindingType(); + IntentAttachPointType bindingType = intentAttachPointTypeFactory.createBindingType(); bindingType.setName(getArtifactType()); bindingType.setUnresolved(true); ((PolicySetAttachPoint)gdataBinding).setType(bindingType); |