diff options
Diffstat (limited to 'branches/sca-java-1.x/modules/core-databinding/src/main/java/org/apache/tuscany/sca/core/databinding')
-rw-r--r-- | branches/sca-java-1.x/modules/core-databinding/src/main/java/org/apache/tuscany/sca/core/databinding/module/DataBindingModuleActivator.java | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/branches/sca-java-1.x/modules/core-databinding/src/main/java/org/apache/tuscany/sca/core/databinding/module/DataBindingModuleActivator.java b/branches/sca-java-1.x/modules/core-databinding/src/main/java/org/apache/tuscany/sca/core/databinding/module/DataBindingModuleActivator.java index 19e05d4df9..9e926506f4 100644 --- a/branches/sca-java-1.x/modules/core-databinding/src/main/java/org/apache/tuscany/sca/core/databinding/module/DataBindingModuleActivator.java +++ b/branches/sca-java-1.x/modules/core-databinding/src/main/java/org/apache/tuscany/sca/core/databinding/module/DataBindingModuleActivator.java @@ -6,22 +6,24 @@ * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations - * under the License. + * under the License. */ package org.apache.tuscany.sca.core.databinding.module; +import org.apache.axiom.om.OMElement; import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint; import org.apache.tuscany.sca.core.ExtensionPointRegistry; import org.apache.tuscany.sca.core.ModuleActivator; +import org.apache.tuscany.sca.core.UtilityExtensionPoint; import org.apache.tuscany.sca.core.databinding.processor.DataBindingJavaInterfaceProcessor; import org.apache.tuscany.sca.core.databinding.processor.WrapperJavaInterfaceProcessor; import org.apache.tuscany.sca.core.databinding.transformers.Array2ArrayTransformer; @@ -30,14 +32,14 @@ import org.apache.tuscany.sca.core.databinding.transformers.CallableReferenceDat import org.apache.tuscany.sca.core.databinding.transformers.CallableReferenceXMLAdapter; import org.apache.tuscany.sca.core.databinding.transformers.Exception2ExceptionTransformer; import org.apache.tuscany.sca.core.databinding.transformers.Input2InputTransformer; +import org.apache.tuscany.sca.core.databinding.transformers.OMElementXMLAdapter; import org.apache.tuscany.sca.core.databinding.transformers.Output2OutputTransformer; import org.apache.tuscany.sca.core.databinding.transformers.XMLStreamReader2CallableReference; -import org.apache.tuscany.sca.core.databinding.transformers.OMElementXMLAdapter; import org.apache.tuscany.sca.core.databinding.wire.DataBindingRuntimeWireProcessor; 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.impl.MediatorImpl; import org.apache.tuscany.sca.databinding.jaxb.XMLAdapterExtensionPoint; import org.apache.tuscany.sca.interfacedef.FaultExceptionMapper; import org.apache.tuscany.sca.interfacedef.java.JavaInterfaceFactory; @@ -46,7 +48,6 @@ import org.apache.tuscany.sca.interfacedef.java.jaxws.JAXWSJavaInterfaceProcesso import org.apache.tuscany.sca.interfacedef.java.jaxws.WebServiceInterfaceProcessor; import org.apache.tuscany.sca.runtime.RuntimeWireProcessorExtensionPoint; import org.osoa.sca.CallableReference; -import org.apache.axiom.om.OMElement; /** * @version $Rev$ $Date$ @@ -61,8 +62,9 @@ public class DataBindingModuleActivator implements ModuleActivator { xmlAdapterExtensionPoint.addAdapter(CallableReference.class, CallableReferenceXMLAdapter.class); xmlAdapterExtensionPoint.addAdapter(OMElement.class, OMElementXMLAdapter.class); FaultExceptionMapper faultExceptionMapper = new JAXWSFaultExceptionMapper(dataBindings, xmlAdapterExtensionPoint); - - MediatorImpl mediator = new MediatorImpl(dataBindings, transformers); + + Mediator mediator = registry.getExtensionPoint(UtilityExtensionPoint.class).getUtility(Mediator.class); + Input2InputTransformer input2InputTransformer = new Input2InputTransformer(); input2InputTransformer.setMediator(mediator); transformers.addTransformer(input2InputTransformer, true); @@ -73,7 +75,7 @@ public class DataBindingModuleActivator implements ModuleActivator { Exception2ExceptionTransformer exception2ExceptionTransformer = new Exception2ExceptionTransformer(mediator, faultExceptionMapper); transformers.addTransformer(exception2ExceptionTransformer, false); - + Array2ArrayTransformer array2ArrayTransformer = new Array2ArrayTransformer(); array2ArrayTransformer.setMediator(mediator); transformers.addTransformer(array2ArrayTransformer, true); @@ -81,14 +83,14 @@ public class DataBindingModuleActivator implements ModuleActivator { Group2GroupTransformer group2GroupTransformer = new Group2GroupTransformer(); group2GroupTransformer.setMediator(mediator); transformers.addTransformer(group2GroupTransformer, true); - + dataBindings.addDataBinding(new CallableReferenceDataBinding()); transformers.addTransformer(new CallableReference2XMLStreamReader(), true); transformers.addTransformer(new XMLStreamReader2CallableReference(), false); ModelFactoryExtensionPoint modelFactories = registry.getExtensionPoint(ModelFactoryExtensionPoint.class); JavaInterfaceFactory javaFactory = modelFactories.getFactory(JavaInterfaceFactory.class); - // Add the WebServiceInterfaceProcessor to mark the interface remotable + // Add the WebServiceInterfaceProcessor to mark the interface remotable javaFactory.addInterfaceVisitor(new WebServiceInterfaceProcessor()); // Introspect the data types javaFactory.addInterfaceVisitor(new DataBindingJavaInterfaceProcessor(dataBindings)); @@ -100,7 +102,7 @@ public class DataBindingModuleActivator implements ModuleActivator { if (wireProcessorExtensionPoint != null) { wireProcessorExtensionPoint.addWireProcessor(new DataBindingRuntimeWireProcessor(mediator, dataBindings, faultExceptionMapper)); } - + } public void stop(ExtensionPointRegistry registry) { |