diff options
Diffstat (limited to '')
5 files changed, 53 insertions, 13 deletions
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 b4d7bf1662..023d0b7904 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 @@ -25,7 +25,6 @@ import org.apache.tuscany.sca.core.ModuleActivator; 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.wire.DataBindingRuntimeWireProcessor; -import org.apache.tuscany.sca.databinding.DataBindingExtensionPoint; import org.apache.tuscany.sca.interfacedef.java.JavaInterfaceFactory; import org.apache.tuscany.sca.interfacedef.java.jaxws.JAXWSJavaInterfaceProcessor; import org.apache.tuscany.sca.interfacedef.java.jaxws.WebServiceInterfaceProcessor; @@ -37,7 +36,28 @@ import org.apache.tuscany.sca.runtime.RuntimeWireProcessorExtensionPoint; public class DataBindingModuleActivator implements ModuleActivator { public void start(ExtensionPointRegistry registry) { + /* DataBindingExtensionPoint dataBindings = registry.getExtensionPoint(DataBindingExtensionPoint.class); + TransformerExtensionPoint transformers = registry.getExtensionPoint(TransformerExtensionPoint.class); + */ + + /* + Input2InputTransformer input2InputTransformer = new Input2InputTransformer(registry); + transformers.addTransformer(input2InputTransformer, false); + + Output2OutputTransformer output2OutputTransformer = new Output2OutputTransformer(registry); + transformers.addTransformer(output2OutputTransformer, false); + + Exception2ExceptionTransformer exception2ExceptionTransformer = new Exception2ExceptionTransformer(registry); + transformers.addTransformer(exception2ExceptionTransformer, false); + + Array2ArrayTransformer array2ArrayTransformer = new Array2ArrayTransformer(registry); + transformers.addTransformer(array2ArrayTransformer, false); + + Group2GroupTransformer group2GroupTransformer = new Group2GroupTransformer(registry); + transformers.addTransformer(group2GroupTransformer, false); + */ + // dataBindings.addDataBinding(new CallableReferenceDataBinding()); // transformers.addTransformer(new CallableReference2XMLStreamReader(), true); // transformers.addTransformer(new XMLStreamReader2CallableReference(), false); @@ -45,17 +65,16 @@ public class DataBindingModuleActivator implements ModuleActivator { FactoryExtensionPoint modelFactories = registry.getExtensionPoint(FactoryExtensionPoint.class); JavaInterfaceFactory javaFactory = modelFactories.getFactory(JavaInterfaceFactory.class); // Add the WebServiceInterfaceProcessor to mark the interface remotable - javaFactory.addInterfaceVisitor(new WebServiceInterfaceProcessor()); + //javaFactory.addInterfaceVisitor(new WebServiceInterfaceProcessor()); // Introspect the data types - javaFactory.addInterfaceVisitor(new DataBindingJavaInterfaceProcessor(dataBindings)); - javaFactory.addInterfaceVisitor(new JAXWSJavaInterfaceProcessor(registry)); - javaFactory.addInterfaceVisitor(new WrapperJavaInterfaceProcessor(dataBindings)); + //javaFactory.addInterfaceVisitor(new DataBindingJavaInterfaceProcessor(registry)); + //javaFactory.addInterfaceVisitor(new JAXWSJavaInterfaceProcessor(registry)); + //javaFactory.addInterfaceVisitor(new WrapperJavaInterfaceProcessor(registry)); RuntimeWireProcessorExtensionPoint wireProcessorExtensionPoint = registry.getExtensionPoint(RuntimeWireProcessorExtensionPoint.class); if (wireProcessorExtensionPoint != null) { wireProcessorExtensionPoint.addWireProcessor(new DataBindingRuntimeWireProcessor(registry)); } - } public void stop(ExtensionPointRegistry registry) { diff --git a/java/sca/modules/core-databinding/src/main/java/org/apache/tuscany/sca/core/databinding/processor/DataBindingJavaInterfaceProcessor.java b/java/sca/modules/core-databinding/src/main/java/org/apache/tuscany/sca/core/databinding/processor/DataBindingJavaInterfaceProcessor.java index c915f389ea..01a3c1813c 100644 --- a/java/sca/modules/core-databinding/src/main/java/org/apache/tuscany/sca/core/databinding/processor/DataBindingJavaInterfaceProcessor.java +++ b/java/sca/modules/core-databinding/src/main/java/org/apache/tuscany/sca/core/databinding/processor/DataBindingJavaInterfaceProcessor.java @@ -25,6 +25,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import org.apache.tuscany.sca.core.ExtensionPointRegistry; import org.apache.tuscany.sca.databinding.DataBindingExtensionPoint; import org.apache.tuscany.sca.databinding.annotation.DataBinding; import org.apache.tuscany.sca.interfacedef.DataType; @@ -42,9 +43,9 @@ import org.apache.tuscany.sca.interfacedef.java.introspect.JavaInterfaceVisitor; public class DataBindingJavaInterfaceProcessor implements JavaInterfaceVisitor { private DataBindingExtensionPoint dataBindingRegistry; - public DataBindingJavaInterfaceProcessor(DataBindingExtensionPoint dataBindingRegistry) { + public DataBindingJavaInterfaceProcessor(ExtensionPointRegistry registry) { super(); - this.dataBindingRegistry = dataBindingRegistry; + this.dataBindingRegistry = registry.getExtensionPoint(DataBindingExtensionPoint.class); } public void visitInterface(JavaInterface javaInterface) throws InvalidInterfaceException { diff --git a/java/sca/modules/core-databinding/src/main/java/org/apache/tuscany/sca/core/databinding/processor/WrapperJavaInterfaceProcessor.java b/java/sca/modules/core-databinding/src/main/java/org/apache/tuscany/sca/core/databinding/processor/WrapperJavaInterfaceProcessor.java index 7f2e3fa23d..a5526ab031 100644 --- a/java/sca/modules/core-databinding/src/main/java/org/apache/tuscany/sca/core/databinding/processor/WrapperJavaInterfaceProcessor.java +++ b/java/sca/modules/core-databinding/src/main/java/org/apache/tuscany/sca/core/databinding/processor/WrapperJavaInterfaceProcessor.java @@ -24,6 +24,7 @@ import java.util.LinkedList; import java.util.List; import java.util.Set; +import org.apache.tuscany.sca.core.ExtensionPointRegistry; import org.apache.tuscany.sca.databinding.DataBindingExtensionPoint; import org.apache.tuscany.sca.databinding.WrapperHandler; import org.apache.tuscany.sca.databinding.javabeans.JavaBeansDataBinding; @@ -44,9 +45,9 @@ public class WrapperJavaInterfaceProcessor implements JavaInterfaceVisitor { private static final String JAXB_DATABINDING = "javax.xml.bind.JAXBElement"; private DataBindingExtensionPoint dataBindingRegistry; - public WrapperJavaInterfaceProcessor(DataBindingExtensionPoint dataBindingRegistry) { + public WrapperJavaInterfaceProcessor(ExtensionPointRegistry registry) { super(); - this.dataBindingRegistry = dataBindingRegistry; + this.dataBindingRegistry = registry.getExtensionPoint(DataBindingExtensionPoint.class); } public void visitInterface(JavaInterface javaInterface) throws InvalidInterfaceException { diff --git a/java/sca/modules/core-databinding/src/main/resources/META-INF/services/org.apache.tuscany.sca.interfacedef.java.introspect.JavaInterfaceVisitor b/java/sca/modules/core-databinding/src/main/resources/META-INF/services/org.apache.tuscany.sca.interfacedef.java.introspect.JavaInterfaceVisitor new file mode 100644 index 0000000000..c9620f41d5 --- /dev/null +++ b/java/sca/modules/core-databinding/src/main/resources/META-INF/services/org.apache.tuscany.sca.interfacedef.java.introspect.JavaInterfaceVisitor @@ -0,0 +1,19 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# 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. + +org.apache.tuscany.sca.core.databinding.processor.DataBindingJavaInterfaceProcessor +org.apache.tuscany.sca.core.databinding.processor.WrapperJavaInterfaceProcessor
\ No newline at end of file diff --git a/java/sca/modules/core-databinding/src/test/java/org/apache/tuscany/sca/core/databinding/processor/DataBindingJavaInterfaceProcessorTestCase.java b/java/sca/modules/core-databinding/src/test/java/org/apache/tuscany/sca/core/databinding/processor/DataBindingJavaInterfaceProcessorTestCase.java index 1905cfb217..c59b36c6c1 100644 --- a/java/sca/modules/core-databinding/src/test/java/org/apache/tuscany/sca/core/databinding/processor/DataBindingJavaInterfaceProcessorTestCase.java +++ b/java/sca/modules/core-databinding/src/test/java/org/apache/tuscany/sca/core/databinding/processor/DataBindingJavaInterfaceProcessorTestCase.java @@ -19,8 +19,8 @@ package org.apache.tuscany.sca.core.databinding.processor; -import org.apache.tuscany.sca.databinding.DataBindingExtensionPoint; -import org.apache.tuscany.sca.databinding.DefaultDataBindingExtensionPoint; +import org.apache.tuscany.sca.core.DefaultExtensionPointRegistry; +import org.apache.tuscany.sca.core.ExtensionPointRegistry; import org.apache.tuscany.sca.databinding.annotation.DataBinding; import org.apache.tuscany.sca.interfacedef.InvalidInterfaceException; import org.apache.tuscany.sca.interfacedef.Operation; @@ -44,7 +44,7 @@ public class DataBindingJavaInterfaceProcessorTestCase { */ @Test public final void testVisitInterface() throws InvalidInterfaceException { - DataBindingExtensionPoint registry = new DefaultDataBindingExtensionPoint(); + ExtensionPointRegistry registry = new DefaultExtensionPointRegistry(); DataBindingJavaInterfaceProcessor processor = new DataBindingJavaInterfaceProcessor(registry); JavaInterfaceFactory javaFactory = new DefaultJavaInterfaceFactory(); |