From 12d8f48de74ae491dfe6e0a510bd943785b268b0 Mon Sep 17 00:00:00 2001 From: rfeng Date: Mon, 5 Oct 2009 19:06:38 +0000 Subject: Use ExtensionPointRegistry to pass arguments git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@821967 13f79535-47bb-0310-9956-ffa450edef68 --- java/sca/modules/core-databinding/META-INF/MANIFEST.MF | 2 -- .../databinding/module/DataBindingModuleActivator.java | 7 ++----- .../wire/DataBindingRuntimeWireProcessor.java | 17 ++++++++--------- .../java/jaxws/JAXWSJavaInterfaceProcessor.java | 8 ++++++++ 4 files changed, 18 insertions(+), 16 deletions(-) (limited to 'java/sca/modules') diff --git a/java/sca/modules/core-databinding/META-INF/MANIFEST.MF b/java/sca/modules/core-databinding/META-INF/MANIFEST.MF index b109725d55..7f15944428 100644 --- a/java/sca/modules/core-databinding/META-INF/MANIFEST.MF +++ b/java/sca/modules/core-databinding/META-INF/MANIFEST.MF @@ -25,7 +25,6 @@ Import-Package: javax.xml.bind.annotation.adapters, org.apache.tuscany.sca.databinding.annotation;version="2.0.0", org.apache.tuscany.sca.databinding.impl;version="2.0.0", org.apache.tuscany.sca.databinding.javabeans;version="2.0.0", - org.apache.tuscany.sca.databinding.jaxb;version="2.0.0", org.apache.tuscany.sca.databinding.xml;version="2.0.0", org.apache.tuscany.sca.interfacedef;version="2.0.0", org.apache.tuscany.sca.interfacedef.impl;version="2.0.0", @@ -37,7 +36,6 @@ Import-Package: javax.xml.bind.annotation.adapters, org.apache.tuscany.sca.policy;version="2.0.0", org.apache.tuscany.sca.runtime;version="2.0.0", org.apache.tuscany.sca.xsd;version="2.0.0", - org.oasisopen.sca;version="2.0.0", org.oasisopen.sca.annotation;version="2.0.0", org.w3c.dom;resolution:=optional diff --git a/java/sca/modules/core-databinding/src/main/java/org/apache/tuscany/sca/core/databinding/module/DataBindingModuleActivator.java b/java/sca/modules/core-databinding/src/main/java/org/apache/tuscany/sca/core/databinding/module/DataBindingModuleActivator.java index 88e7354b54..fd41a7f113 100644 --- a/java/sca/modules/core-databinding/src/main/java/org/apache/tuscany/sca/core/databinding/module/DataBindingModuleActivator.java +++ b/java/sca/modules/core-databinding/src/main/java/org/apache/tuscany/sca/core/databinding/module/DataBindingModuleActivator.java @@ -34,7 +34,6 @@ import org.apache.tuscany.sca.databinding.DataBindingExtensionPoint; import org.apache.tuscany.sca.databinding.Mediator; import org.apache.tuscany.sca.databinding.TransformerExtensionPoint; import org.apache.tuscany.sca.databinding.impl.Group2GroupTransformer; -import org.apache.tuscany.sca.databinding.jaxb.XMLAdapterExtensionPoint; import org.apache.tuscany.sca.interfacedef.FaultExceptionMapper; import org.apache.tuscany.sca.interfacedef.java.JavaInterfaceFactory; import org.apache.tuscany.sca.interfacedef.java.jaxws.JAXWSJavaInterfaceProcessor; @@ -50,8 +49,6 @@ public class DataBindingModuleActivator implements ModuleActivator { DataBindingExtensionPoint dataBindings = registry.getExtensionPoint(DataBindingExtensionPoint.class); TransformerExtensionPoint transformers = registry.getExtensionPoint(TransformerExtensionPoint.class); - XMLAdapterExtensionPoint xmlAdapterExtensionPoint = registry.getExtensionPoint(XMLAdapterExtensionPoint.class); - FaultExceptionMapper faultExceptionMapper = registry.getExtensionPoint(UtilityExtensionPoint.class).getUtility(FaultExceptionMapper.class); Mediator mediator = registry.getExtensionPoint(UtilityExtensionPoint.class).getUtility(Mediator.class); @@ -85,12 +82,12 @@ public class DataBindingModuleActivator implements ModuleActivator { javaFactory.addInterfaceVisitor(new WebServiceInterfaceProcessor()); // Introspect the data types javaFactory.addInterfaceVisitor(new DataBindingJavaInterfaceProcessor(dataBindings)); - javaFactory.addInterfaceVisitor(new JAXWSJavaInterfaceProcessor(dataBindings, faultExceptionMapper, xmlAdapterExtensionPoint)); + javaFactory.addInterfaceVisitor(new JAXWSJavaInterfaceProcessor(registry)); javaFactory.addInterfaceVisitor(new WrapperJavaInterfaceProcessor(dataBindings)); RuntimeWireProcessorExtensionPoint wireProcessorExtensionPoint = registry.getExtensionPoint(RuntimeWireProcessorExtensionPoint.class); if (wireProcessorExtensionPoint != null) { - wireProcessorExtensionPoint.addWireProcessor(new DataBindingRuntimeWireProcessor(mediator, dataBindings, faultExceptionMapper)); + wireProcessorExtensionPoint.addWireProcessor(new DataBindingRuntimeWireProcessor(mediator)); } } diff --git a/java/sca/modules/core-databinding/src/main/java/org/apache/tuscany/sca/core/databinding/wire/DataBindingRuntimeWireProcessor.java b/java/sca/modules/core-databinding/src/main/java/org/apache/tuscany/sca/core/databinding/wire/DataBindingRuntimeWireProcessor.java index 90b6f24872..4b64b29e7b 100644 --- a/java/sca/modules/core-databinding/src/main/java/org/apache/tuscany/sca/core/databinding/wire/DataBindingRuntimeWireProcessor.java +++ b/java/sca/modules/core-databinding/src/main/java/org/apache/tuscany/sca/core/databinding/wire/DataBindingRuntimeWireProcessor.java @@ -22,10 +22,10 @@ package org.apache.tuscany.sca.core.databinding.wire; import java.util.List; import org.apache.tuscany.sca.assembly.ComponentReference; -import org.apache.tuscany.sca.databinding.DataBindingExtensionPoint; +import org.apache.tuscany.sca.core.ExtensionPointRegistry; +import org.apache.tuscany.sca.core.UtilityExtensionPoint; import org.apache.tuscany.sca.databinding.Mediator; import org.apache.tuscany.sca.interfacedef.DataType; -import org.apache.tuscany.sca.interfacedef.FaultExceptionMapper; import org.apache.tuscany.sca.interfacedef.InterfaceContract; import org.apache.tuscany.sca.interfacedef.Operation; import org.apache.tuscany.sca.invocation.Interceptor; @@ -42,16 +42,15 @@ import org.apache.tuscany.sca.runtime.RuntimeWireProcessor; */ public class DataBindingRuntimeWireProcessor implements RuntimeWireProcessor { private Mediator mediator; - private DataBindingExtensionPoint dataBindings; - private FaultExceptionMapper faultExceptionMapper; - public DataBindingRuntimeWireProcessor(Mediator mediator, - DataBindingExtensionPoint dataBindings, - FaultExceptionMapper faultExceptionMapper) { + public DataBindingRuntimeWireProcessor(Mediator mediator) { super(); this.mediator = mediator; - this.dataBindings = dataBindings; - this.faultExceptionMapper = faultExceptionMapper; + } + + public DataBindingRuntimeWireProcessor(ExtensionPointRegistry registry) { + super(); + this.mediator = registry.getExtensionPoint(UtilityExtensionPoint.class).getUtility(Mediator.class); } public boolean isTransformationRequired(DataType source, DataType target) { diff --git a/java/sca/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/JAXWSJavaInterfaceProcessor.java b/java/sca/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/JAXWSJavaInterfaceProcessor.java index 50cdde658e..3d7d72d03f 100644 --- a/java/sca/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/JAXWSJavaInterfaceProcessor.java +++ b/java/sca/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/JAXWSJavaInterfaceProcessor.java @@ -39,6 +39,8 @@ import javax.xml.namespace.QName; import javax.xml.ws.RequestWrapper; import javax.xml.ws.ResponseWrapper; +import org.apache.tuscany.sca.core.ExtensionPointRegistry; +import org.apache.tuscany.sca.core.UtilityExtensionPoint; import org.apache.tuscany.sca.databinding.DataBindingExtensionPoint; import org.apache.tuscany.sca.databinding.javabeans.JavaExceptionDataBinding; import org.apache.tuscany.sca.databinding.jaxb.JAXBDataBinding; @@ -70,6 +72,12 @@ public class JAXWSJavaInterfaceProcessor implements JavaInterfaceVisitor { private XMLAdapterExtensionPoint xmlAdapterExtensionPoint; + public JAXWSJavaInterfaceProcessor(ExtensionPointRegistry registry) { + dataBindingExtensionPoint = registry.getExtensionPoint(DataBindingExtensionPoint.class); + faultExceptionMapper = registry.getExtensionPoint(UtilityExtensionPoint.class).getUtility(FaultExceptionMapper.class); + xmlAdapterExtensionPoint = registry.getExtensionPoint(XMLAdapterExtensionPoint.class); + } + public JAXWSJavaInterfaceProcessor(DataBindingExtensionPoint dataBindingExtensionPoint, FaultExceptionMapper faultExceptionMapper, XMLAdapterExtensionPoint xmlAdapters) { -- cgit v1.2.3