summaryrefslogtreecommitdiffstats
path: root/tags/java/sca/0.91-rc2-incubating/modules/databinding-sdo/src
diff options
context:
space:
mode:
Diffstat (limited to 'tags/java/sca/0.91-rc2-incubating/modules/databinding-sdo/src')
-rwxr-xr-xtags/java/sca/0.91-rc2-incubating/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/DataObject2String.java58
-rwxr-xr-xtags/java/sca/0.91-rc2-incubating/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/DataObject2XMLStreamReader.java68
-rw-r--r--tags/java/sca/0.91-rc2-incubating/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/DuplicateHelperContextException.java37
-rw-r--r--tags/java/sca/0.91-rc2-incubating/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/HelperContextProcessor.java110
-rw-r--r--tags/java/sca/0.91-rc2-incubating/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/HelperContextRegistry.java52
-rw-r--r--tags/java/sca/0.91-rc2-incubating/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/HelperContextRegistryImpl.java49
-rw-r--r--tags/java/sca/0.91-rc2-incubating/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/ImportSDO.java78
-rwxr-xr-xtags/java/sca/0.91-rc2-incubating/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/ImportSDOProcessor.java193
-rw-r--r--tags/java/sca/0.91-rc2-incubating/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/SDOContextHelper.java106
-rw-r--r--tags/java/sca/0.91-rc2-incubating/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/SDODataBinding.java122
-rw-r--r--tags/java/sca/0.91-rc2-incubating/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/SDOExceptionHandler.java124
-rw-r--r--tags/java/sca/0.91-rc2-incubating/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/SDOSimpleTypeMapper.java67
-rw-r--r--tags/java/sca/0.91-rc2-incubating/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/SDOWrapperHandler.java99
-rwxr-xr-xtags/java/sca/0.91-rc2-incubating/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/String2DataObject.java55
-rw-r--r--tags/java/sca/0.91-rc2-incubating/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/XMLDocument2String.java59
-rwxr-xr-xtags/java/sca/0.91-rc2-incubating/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/XMLDocument2XMLStreamReader.java64
-rwxr-xr-xtags/java/sca/0.91-rc2-incubating/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/XMLStreamReader2DataObject.java64
-rwxr-xr-xtags/java/sca/0.91-rc2-incubating/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/XMLStreamReader2XMLDocument.java59
-rw-r--r--tags/java/sca/0.91-rc2-incubating/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/api/HelperContext.java37
-rw-r--r--tags/java/sca/0.91-rc2-incubating/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/module/SDODataBindingModuleActivator.java80
-rw-r--r--tags/java/sca/0.91-rc2-incubating/modules/databinding-sdo/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.ModuleActivator18
-rw-r--r--tags/java/sca/0.91-rc2-incubating/modules/databinding-sdo/src/test/java/com/example/stock/sdo/fault/InvalidSymbolFault_Exception.java67
-rw-r--r--tags/java/sca/0.91-rc2-incubating/modules/databinding-sdo/src/test/java/org/apache/tuscany/sca/databinding/sdo/DataObject2StringTestCase.java64
-rw-r--r--tags/java/sca/0.91-rc2-incubating/modules/databinding-sdo/src/test/java/org/apache/tuscany/sca/databinding/sdo/DataObject2XMLStreamReaderTestCase.java58
-rw-r--r--tags/java/sca/0.91-rc2-incubating/modules/databinding-sdo/src/test/java/org/apache/tuscany/sca/databinding/sdo/HelperContextProcessorTestCase.java83
-rwxr-xr-xtags/java/sca/0.91-rc2-incubating/modules/databinding-sdo/src/test/java/org/apache/tuscany/sca/databinding/sdo/ImportSDOProcessorTestCase.java85
-rw-r--r--tags/java/sca/0.91-rc2-incubating/modules/databinding-sdo/src/test/java/org/apache/tuscany/sca/databinding/sdo/SDODataBindingTestCase.java110
-rw-r--r--tags/java/sca/0.91-rc2-incubating/modules/databinding-sdo/src/test/java/org/apache/tuscany/sca/databinding/sdo/SDOExceptionHandlerTestCase.java82
-rw-r--r--tags/java/sca/0.91-rc2-incubating/modules/databinding-sdo/src/test/java/org/apache/tuscany/sca/databinding/sdo/SDOTransformerTestCaseBase.java79
-rw-r--r--tags/java/sca/0.91-rc2-incubating/modules/databinding-sdo/src/test/java/org/apache/tuscany/sca/databinding/sdo/SDOWrapperHandlerTestCase.java61
-rw-r--r--tags/java/sca/0.91-rc2-incubating/modules/databinding-sdo/src/test/java/org/apache/tuscany/sca/databinding/sdo/TestModelResolver.java63
-rw-r--r--tags/java/sca/0.91-rc2-incubating/modules/databinding-sdo/src/test/java/org/apache/tuscany/sca/databinding/sdo/XMLDocument2XMLStreamReaderTestCase.java61
-rwxr-xr-xtags/java/sca/0.91-rc2-incubating/modules/databinding-sdo/src/test/resources/ipo.xsd136
-rwxr-xr-xtags/java/sca/0.91-rc2-incubating/modules/databinding-sdo/src/test/resources/model/sca-core.xsd233
-rwxr-xr-xtags/java/sca/0.91-rc2-incubating/modules/databinding-sdo/src/test/resources/model/sca-implementation-mock.xsd43
-rw-r--r--tags/java/sca/0.91-rc2-incubating/modules/databinding-sdo/src/test/resources/stock.xsd33
-rw-r--r--tags/java/sca/0.91-rc2-incubating/modules/databinding-sdo/src/test/resources/wrapper.xml27
-rw-r--r--tags/java/sca/0.91-rc2-incubating/modules/databinding-sdo/src/test/resources/wrapper.xsd38
38 files changed, 0 insertions, 2922 deletions
diff --git a/tags/java/sca/0.91-rc2-incubating/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/DataObject2String.java b/tags/java/sca/0.91-rc2-incubating/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/DataObject2String.java
deleted file mode 100755
index 405de57ab3..0000000000
--- a/tags/java/sca/0.91-rc2-incubating/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/DataObject2String.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * 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.
- */
-package org.apache.tuscany.sca.databinding.sdo;
-
-import javax.xml.namespace.QName;
-
-import org.apache.tuscany.sca.databinding.PullTransformer;
-import org.apache.tuscany.sca.databinding.TransformationContext;
-import org.apache.tuscany.sca.databinding.TransformationException;
-import org.apache.tuscany.sca.databinding.impl.BaseTransformer;
-
-import commonj.sdo.DataObject;
-import commonj.sdo.helper.HelperContext;
-import commonj.sdo.helper.XMLHelper;
-
-public class DataObject2String extends BaseTransformer<DataObject, String> implements
- PullTransformer<DataObject, String> {
-
- public String transform(DataObject source, TransformationContext context) {
- try {
- HelperContext helperContext = SDOContextHelper.getHelperContext(context);
- XMLHelper xmlHelper = helperContext.getXMLHelper();
- QName elementName = SDOContextHelper.getElement(context.getSourceDataType());
- return xmlHelper.save(source, elementName.getNamespaceURI(), elementName.getLocalPart());
- } catch (Exception e) {
- throw new TransformationException(e);
- }
- }
-
- public Class getSourceType() {
- return DataObject.class;
- }
-
- public Class getTargetType() {
- return String.class;
- }
-
- public int getWeight() {
- return 40;
- }
-
-}
diff --git a/tags/java/sca/0.91-rc2-incubating/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/DataObject2XMLStreamReader.java b/tags/java/sca/0.91-rc2-incubating/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/DataObject2XMLStreamReader.java
deleted file mode 100755
index 863a787362..0000000000
--- a/tags/java/sca/0.91-rc2-incubating/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/DataObject2XMLStreamReader.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * 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.
- */
-package org.apache.tuscany.sca.databinding.sdo;
-
-import javax.xml.namespace.QName;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-
-import org.apache.tuscany.sca.databinding.PullTransformer;
-import org.apache.tuscany.sca.databinding.TransformationContext;
-import org.apache.tuscany.sca.databinding.TransformationException;
-import org.apache.tuscany.sca.databinding.impl.BaseTransformer;
-import org.apache.tuscany.sdo.helper.XMLStreamHelper;
-import org.apache.tuscany.sdo.util.SDOUtil;
-
-
-import commonj.sdo.DataObject;
-import commonj.sdo.helper.HelperContext;
-import commonj.sdo.helper.XMLDocument;
-import commonj.sdo.helper.XMLHelper;
-
-public class DataObject2XMLStreamReader extends BaseTransformer<DataObject, XMLStreamReader> implements
- PullTransformer<DataObject, XMLStreamReader> {
-
- public XMLStreamReader transform(DataObject source, TransformationContext context) {
- try {
- HelperContext helperContext = SDOContextHelper.getHelperContext(context);
- XMLStreamHelper streamHelper = SDOUtil.createXMLStreamHelper(helperContext.getTypeHelper());
- QName elementName = SDOContextHelper.getElement(context.getSourceDataType());
- XMLHelper xmlHelper = helperContext.getXMLHelper();
- XMLDocument document =
- xmlHelper.createDocument(source, elementName.getNamespaceURI(), elementName.getLocalPart());
- return streamHelper.createXMLStreamReader(document);
- } catch (XMLStreamException e) {
- // TODO: Add context to the exception
- throw new TransformationException(e);
- }
- }
-
- public Class getSourceType() {
- return DataObject.class;
- }
-
- public Class getTargetType() {
- return XMLStreamReader.class;
- }
-
- public int getWeight() {
- return 10;
- }
-
-}
diff --git a/tags/java/sca/0.91-rc2-incubating/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/DuplicateHelperContextException.java b/tags/java/sca/0.91-rc2-incubating/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/DuplicateHelperContextException.java
deleted file mode 100644
index c83e93dc4e..0000000000
--- a/tags/java/sca/0.91-rc2-incubating/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/DuplicateHelperContextException.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * 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.
- */
-package org.apache.tuscany.sca.databinding.sdo;
-
-
-/**
- * @version $Rev$ $Date$
- */
-public class DuplicateHelperContextException extends RuntimeException {
- private static final long serialVersionUID = -5229624905543066038L;
-
- /**
- * Constructor specifying message and the ID of the duplicate HelperContext.
- *
- * @param message exception message
- * @param identifier the id of the HelperContext that is already present
- */
- public DuplicateHelperContextException(String message) {
- super(message);
- }
-}
diff --git a/tags/java/sca/0.91-rc2-incubating/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/HelperContextProcessor.java b/tags/java/sca/0.91-rc2-incubating/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/HelperContextProcessor.java
deleted file mode 100644
index 561e5f3b39..0000000000
--- a/tags/java/sca/0.91-rc2-incubating/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/HelperContextProcessor.java
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
- * 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.
- */
-package org.apache.tuscany.sca.databinding.sdo;
-
-import java.beans.Introspector;
-import java.lang.reflect.Field;
-import java.lang.reflect.Method;
-
-import org.apache.tuscany.sca.assembly.AssemblyFactory;
-import org.apache.tuscany.sca.implementation.java.JavaImplementation;
-import org.apache.tuscany.sca.implementation.java.impl.JavaElementImpl;
-import org.apache.tuscany.sca.implementation.java.impl.JavaResourceImpl;
-import org.apache.tuscany.sca.implementation.java.introspect.IntrospectionException;
-import org.apache.tuscany.sca.implementation.java.introspect.impl.BaseJavaClassVisitor;
-
-import commonj.sdo.helper.HelperContext;
-
-/**
- * Processes {@link @HelperContext} annotations on a component implementation
- * and adds a {@link JavaMappedProperty} to the component type which will be
- * used to inject the appropriate context
- *
- * @version $Rev$ $Date$
- */
-public class HelperContextProcessor extends BaseJavaClassVisitor {
- private HelperContextRegistry registry;
-
- /**
- * @param registry
- */
- public HelperContextProcessor(AssemblyFactory assemblyFactory, HelperContextRegistry registry) {
- super(assemblyFactory);
- this.registry = registry;
- }
-
- /**
- * Takes a setter or getter method name and converts it to a property name
- * according to JavaBean conventions. For example, <code>setFoo(var)</code>
- * is returned as property <code>foo<code>
- */
- public static String toPropertyName(String name) {
- if (!name.startsWith("set")) {
- return name;
- }
- return Introspector.decapitalize(name.substring(3));
- }
-
- public void visitMethod(Method method,
- JavaImplementation type) throws IntrospectionException {
- if (!method.isAnnotationPresent(org.apache.tuscany.sca.databinding.sdo.api.HelperContext.class)) {
- return;
- }
- if (method.getParameterTypes().length != 1) {
- throw new IllegalArgumentException("HelperContext setter must have one parameter: " + method);
- }
- Class<?> paramType = method.getParameterTypes()[0];
- if (HelperContext.class == paramType) {
- String name = toPropertyName(method.getName());
- JavaResourceImpl resource = new JavaResourceImpl(new JavaElementImpl(method, 0));
-// resource.setObjectFactory(new HelperContextFactory(context.getComponentId()));
- type.getResources().put(name, resource);
- }
- }
-
- public void visitField(Field field,
- JavaImplementation type) throws IntrospectionException {
- if (!field.isAnnotationPresent(org.apache.tuscany.sca.databinding.sdo.api.HelperContext.class)) {
- return;
- }
- Class<?> paramType = field.getType();
- if (HelperContext.class == paramType) {
- String name = field.getName();
- JavaResourceImpl resource = new JavaResourceImpl(new JavaElementImpl(field));
-// resource.setObjectFactory(new HelperContextFactory(context.getComponentId()));
- type.getResources().put(name, resource);
- }
- }
-
- /*
- private class HelperContextFactory implements ObjectFactory<HelperContext> {
- private URI id;
-
- public HelperContextFactory(URI id) {
- super();
- this.id = id;
- }
-
- public HelperContext getInstance() throws ObjectCreationException {
- return registry.getHelperContext(id);
- }
-
- }
- */
-}
diff --git a/tags/java/sca/0.91-rc2-incubating/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/HelperContextRegistry.java b/tags/java/sca/0.91-rc2-incubating/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/HelperContextRegistry.java
deleted file mode 100644
index 75d9d33cbb..0000000000
--- a/tags/java/sca/0.91-rc2-incubating/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/HelperContextRegistry.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * 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.
- */
-
-package org.apache.tuscany.sca.databinding.sdo;
-
-import commonj.sdo.helper.HelperContext;
-
-/**
- * A registry for SDO HelperContext
- *
- * @version $Rev$ $Date$
- */
-public interface HelperContextRegistry {
- /**
- * Register a HelperContext with the id
- *
- * @param id
- * @param context
- */
- void register(Object id, HelperContext context) throws DuplicateHelperContextException;
-
- /**
- * Unregister the HelperContext
- *
- * @param id
- */
- void unregister(Object id);
-
- /**
- * Get the HelperContext associated with the id
- *
- * @param id The URI of the HelperContext
- * @return
- */
- HelperContext getHelperContext(Object id);
-}
diff --git a/tags/java/sca/0.91-rc2-incubating/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/HelperContextRegistryImpl.java b/tags/java/sca/0.91-rc2-incubating/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/HelperContextRegistryImpl.java
deleted file mode 100644
index 429946f78d..0000000000
--- a/tags/java/sca/0.91-rc2-incubating/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/HelperContextRegistryImpl.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * 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.
- */
-
-package org.apache.tuscany.sca.databinding.sdo;
-
-import java.util.Map;
-import java.util.concurrent.ConcurrentHashMap;
-
-import commonj.sdo.helper.HelperContext;
-
-/**
- * A registry for SDO HelperContext
- *
- * @version $Rev$ $Date$
- */
-public class HelperContextRegistryImpl implements HelperContextRegistry {
- private final Map<Object, HelperContext> registry = new ConcurrentHashMap<Object, HelperContext>();
-
- public synchronized void register(Object id, HelperContext context) {
- if (registry.containsKey(id)) {
- throw new DuplicateHelperContextException("Duplicate HelperContext: " + id);
- }
- registry.put(id, context);
- }
-
- public void unregister(Object id) {
- registry.remove(id);
- }
-
- public HelperContext getHelperContext(Object id) {
- return registry.get(id);
- }
-}
diff --git a/tags/java/sca/0.91-rc2-incubating/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/ImportSDO.java b/tags/java/sca/0.91-rc2-incubating/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/ImportSDO.java
deleted file mode 100644
index 30a3e1c3a9..0000000000
--- a/tags/java/sca/0.91-rc2-incubating/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/ImportSDO.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * 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.
- */
-
-package org.apache.tuscany.sca.databinding.sdo;
-
-import javax.xml.namespace.QName;
-
-import org.apache.tuscany.sca.assembly.impl.BaseImpl;
-
-import commonj.sdo.helper.HelperContext;
-
-/**
- * The model object for import.sdo
- *
- * @version $Rev$ $Date$
- */
-public class ImportSDO extends BaseImpl {
- public static final QName IMPORT_SDO =
- new QName("http://tuscany.apache.org/xmlns/sca/databinding/sdo/1.0", "import.sdo");
-
- private HelperContext helperContext;
- private String factoryClassName;
- private String schemaLocation;
-
- public ImportSDO(HelperContext helperContext) {
- super();
- this.helperContext = helperContext;
- setUnresolved(true);
- }
-
- public HelperContext getHelperContext() {
- return helperContext;
- }
-
- /**
- * @return the factoryClassName
- */
- public String getFactoryClassName() {
- return factoryClassName;
- }
-
- /**
- * @param factoryClassName the factoryClassName to set
- */
- public void setFactoryClassName(String factoryClassName) {
- this.factoryClassName = factoryClassName;
- }
-
- /**
- * @return the schemaLocation
- */
- public String getSchemaLocation() {
- return schemaLocation;
- }
-
- /**
- * @param schemaLocation the schemaLocation to set
- */
- public void setSchemaLocation(String schemaLocation) {
- this.schemaLocation = schemaLocation;
- }
-} \ No newline at end of file
diff --git a/tags/java/sca/0.91-rc2-incubating/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/ImportSDOProcessor.java b/tags/java/sca/0.91-rc2-incubating/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/ImportSDOProcessor.java
deleted file mode 100755
index 32019ef760..0000000000
--- a/tags/java/sca/0.91-rc2-incubating/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/ImportSDOProcessor.java
+++ /dev/null
@@ -1,193 +0,0 @@
-/*
- * 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.
- */
-package org.apache.tuscany.sca.databinding.sdo;
-
-import static javax.xml.stream.XMLStreamConstants.END_ELEMENT;
-import static org.apache.tuscany.sca.databinding.sdo.ImportSDO.IMPORT_SDO;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.lang.reflect.Field;
-import java.lang.reflect.Method;
-import java.net.URI;
-import java.net.URL;
-
-import javax.xml.namespace.QName;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-import javax.xml.stream.XMLStreamWriter;
-
-import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor;
-import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
-import org.apache.tuscany.sca.contribution.service.ContributionReadException;
-import org.apache.tuscany.sca.contribution.service.ContributionResolveException;
-import org.apache.tuscany.sca.contribution.service.ContributionWriteException;
-import org.apache.tuscany.sdo.util.SDOUtil;
-
-import commonj.sdo.helper.HelperContext;
-import commonj.sdo.helper.XSDHelper;
-import commonj.sdo.impl.HelperProvider;
-
-
-/**
- * Loader that handles &lt;import.sdo&gt; elements.
- *
- * @version $Rev$ $Date$
- */
-public class ImportSDOProcessor implements StAXArtifactProcessor<ImportSDO> {
- private HelperContextRegistry helperContextRegistry;
-
- public ImportSDOProcessor(HelperContextRegistry helperContextRegistry) {
- super();
- this.helperContextRegistry = helperContextRegistry;
- }
-
- public QName getXMLType() {
- return IMPORT_SDO;
- }
-
- public ImportSDO read(XMLStreamReader reader) throws ContributionReadException {
- assert IMPORT_SDO.equals(reader.getName());
-
- HelperContext helperContext = null;
-
- // FIXME: [rfeng] How to get the enclosing composite?
- int id = System.identityHashCode(reader);
- // FIXME: [rfeng] How to associate the TypeHelper with deployment
- // context?
- synchronized (helperContextRegistry) {
- helperContext = helperContextRegistry.getHelperContext(id);
- if (helperContext == null) {
- helperContext = SDOUtil.createHelperContext();
- helperContextRegistry.register(id, helperContext);
- }
- }
-
- ImportSDO importSDO = new ImportSDO(helperContext);
- String factoryName = reader.getAttributeValue(null, "factory");
- if (factoryName != null) {
- importSDO.setFactoryClassName(factoryName);
- }
- String location = reader.getAttributeValue(null, "location");
- if (location != null) {
- importSDO.setSchemaLocation(location);
- }
-
- // Skip to end element
- try {
- while (reader.hasNext()) {
- if (reader.next() == END_ELEMENT && ImportSDO.IMPORT_SDO.equals(reader.getName())) {
- break;
- }
- }
- } catch (XMLStreamException e) {
- throw new ContributionReadException(e);
- }
- return importSDO;
- }
-
- private void importFactory(ImportSDO importSDO) throws ContributionResolveException {
- String factoryName = importSDO.getFactoryClassName();
- if (factoryName != null) {
- ClassLoader cl = Thread.currentThread().getContextClassLoader();
- try {
- Class<?> factoryClass = cl.loadClass(factoryName);
- register(factoryClass, importSDO.getHelperContext());
- } catch (Exception e) {
- throw new ContributionResolveException(e);
- }
- importSDO.setUnresolved(false);
- }
- }
-
- private static void register(Class factoryClass, HelperContext helperContext) throws Exception {
- Field field = factoryClass.getField("INSTANCE");
- Object factory = field.get(null);
- Method method = factory.getClass().getMethod("register", new Class[] {HelperContext.class});
- method.invoke(factory, new Object[] {helperContext});
-
- // FIXME: How do we associate the application HelperContext with the one
- // imported by the composite
- HelperContext defaultContext = HelperProvider.getDefaultContext();
- method.invoke(factory, new Object[] {defaultContext});
- }
-
- private void importWSDL(ImportSDO importSDO) throws ContributionResolveException {
- String location = importSDO.getSchemaLocation();
- if (location != null) {
- try {
- URL wsdlURL = null;
- URI uri = URI.create(location);
- if (uri.isAbsolute()) {
- wsdlURL = uri.toURL();
- }
- wsdlURL = Thread.currentThread().getContextClassLoader().getResource(location);
- if (null == wsdlURL) {
- ContributionResolveException loaderException = new ContributionResolveException(
- "WSDL location error");
- throw loaderException;
- }
- InputStream xsdInputStream = wsdlURL.openStream();
- try {
- XSDHelper xsdHelper = importSDO.getHelperContext().getXSDHelper();
- xsdHelper.define(xsdInputStream, wsdlURL.toExternalForm());
- } finally {
- xsdInputStream.close();
- }
- // FIXME: How do we associate the application HelperContext with
- // the one
- // imported by the composite
- HelperContext defaultContext = HelperProvider.getDefaultContext();
- xsdInputStream = wsdlURL.openStream();
- try {
- XSDHelper xsdHelper = defaultContext.getXSDHelper();
- ClassLoader cl = Thread.currentThread().getContextClassLoader();
- xsdHelper.define(xsdInputStream, wsdlURL.toExternalForm());
- } finally {
- xsdInputStream.close();
- }
- } catch (IOException e) {
- throw new ContributionResolveException(e);
- }
- importSDO.setUnresolved(false);
- }
- }
-
- public QName getArtifactType() {
- return ImportSDO.IMPORT_SDO;
- }
-
- public void write(ImportSDO model, XMLStreamWriter outputSource) throws ContributionWriteException {
- // TODO Auto-generated method stub
-
- }
-
- public Class<ImportSDO> getModelType() {
- return ImportSDO.class;
- }
-
- public void resolve(ImportSDO importSDO, ModelResolver resolver) throws ContributionResolveException {
- importFactory(importSDO);
- importWSDL(importSDO);
- if (!importSDO.isUnresolved()) {
- resolver.addModel(importSDO);
- }
- }
-
-}
diff --git a/tags/java/sca/0.91-rc2-incubating/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/SDOContextHelper.java b/tags/java/sca/0.91-rc2-incubating/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/SDOContextHelper.java
deleted file mode 100644
index 78058a5969..0000000000
--- a/tags/java/sca/0.91-rc2-incubating/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/SDOContextHelper.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- * 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.
- */
-
-package org.apache.tuscany.sca.databinding.sdo;
-
-import java.awt.Component;
-
-import javax.xml.namespace.QName;
-
-import org.apache.tuscany.sca.assembly.Composite;
-import org.apache.tuscany.sca.databinding.TransformationContext;
-import org.apache.tuscany.sca.interfacedef.DataType;
-import org.apache.tuscany.sca.interfacedef.util.XMLType;
-import org.apache.tuscany.sdo.util.SDOUtil;
-
-import commonj.sdo.helper.HelperContext;
-import commonj.sdo.impl.HelperProvider;
-
-/**
- * Helper class to get TypeHelper from the context
- */
-public final class SDOContextHelper {
- private SDOContextHelper() {
- }
-
- public static HelperContext getHelperContext(TransformationContext context) {
- if (context == null || context.getMetadata() == null) {
- return getDefaultHelperContext();
- }
- HelperContext helperContext = null;
- Component composite = (Component)context.getMetadata().get(Component.class);
- if (composite != null) {
- // SDOHelperContext sdoContext =
- // (SDOHelperContext)composite.getExtensions().get(HelperContext.class.getName());
- // if (sdoContext != null) {
- // helperContext = sdoContext.getHelperContext();
- // }
- // AtomicComponent child =
- // (AtomicComponent)composite.getSystemChild(HelperContext.class.getName());
- // try {
- // helperContext = (HelperContext)child.getTargetInstance();
- // } catch (TargetResolutionException e) {
- // helperContext = null;
- // }
- }
- if (helperContext == null) {
- return getDefaultHelperContext();
- } else {
- return helperContext;
- }
- }
-
- public static HelperContext getHelperContext(Composite model) {
- HelperContext helperContext = null;
- for (Object ext : model.getExtensions()) {
- if (ext instanceof HelperContext) {
- helperContext = (HelperContext)ext;
- break;
- }
- }
- if (helperContext == null) {
- helperContext = SDOUtil.createHelperContext();
- model.getExtensions().add(helperContext);
- }
-
- if (helperContext == null) {
- helperContext = getDefaultHelperContext();
- }
-
- return helperContext;
- }
-
- protected static HelperContext getDefaultHelperContext() {
- // SDOUtil.createHelperContext();
- return HelperProvider.getDefaultContext();
- }
-
- public static QName getElement(DataType<?> dataType) {
- Object logical = dataType.getLogical();
- QName elementName = SDODataBinding.ROOT_ELEMENT;
- if (logical instanceof XMLType) {
- XMLType xmlType = (XMLType)logical;
- QName element = xmlType.getElementName();
- if (element != null) {
- elementName = element;
- }
- }
- return elementName;
- }
-}
diff --git a/tags/java/sca/0.91-rc2-incubating/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/SDODataBinding.java b/tags/java/sca/0.91-rc2-incubating/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/SDODataBinding.java
deleted file mode 100644
index 2736d4bbde..0000000000
--- a/tags/java/sca/0.91-rc2-incubating/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/SDODataBinding.java
+++ /dev/null
@@ -1,122 +0,0 @@
-/*
- * 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.
- */
-
-package org.apache.tuscany.sca.databinding.sdo;
-
-import java.lang.annotation.Annotation;
-
-import javax.xml.namespace.QName;
-
-import org.apache.tuscany.sca.databinding.ExceptionHandler;
-import org.apache.tuscany.sca.databinding.SimpleTypeMapper;
-import org.apache.tuscany.sca.databinding.WrapperHandler;
-import org.apache.tuscany.sca.databinding.impl.BaseDataBinding;
-import org.apache.tuscany.sca.interfacedef.DataType;
-import org.apache.tuscany.sca.interfacedef.util.XMLType;
-
-import commonj.sdo.DataObject;
-import commonj.sdo.Type;
-import commonj.sdo.helper.CopyHelper;
-import commonj.sdo.helper.HelperContext;
-import commonj.sdo.helper.XMLDocument;
-import commonj.sdo.impl.HelperProvider;
-
-/**
- * SDO Databinding
- *
- * @version $Reve$ $Date$
- */
-public class SDODataBinding extends BaseDataBinding {
- public static final String NAME = DataObject.class.getName();
- public static final String[] ALIASES = new String[] {"sdo"};
-
- public static final String ROOT_NAMESPACE = "commonj.sdo";
- public static final QName ROOT_ELEMENT = new QName(ROOT_NAMESPACE, "dataObject");
-
- private WrapperHandler<Object> wrapperHandler;
-
- public SDODataBinding() {
- super(NAME, ALIASES, DataObject.class);
- wrapperHandler = new SDOWrapperHandler();
- }
-
- @Override
- public boolean introspect(DataType dataType, Annotation[] annotations) {
- Object physical = dataType.getPhysical();
- if (!(physical instanceof Class)) {
- return false;
- }
- Class javaType = (Class)physical;
- HelperContext context = HelperProvider.getDefaultContext();
- // FIXME: Need a better to test dynamic SDO
- if (DataObject.class.isAssignableFrom(javaType)) {
- // Dynamic SDO
- dataType.setDataBinding(getName());
- dataType.setLogical(XMLType.UNKNOWN);
- return true;
- }
- // FIXME: We need to access HelperContext
- Type type = context.getTypeHelper().getType(javaType);
- if (type == null) {
- return false;
- }
- if (type.isDataType()) {
- // FIXME: Ignore simple types?
- return false;
- }
- String namespace = type.getURI();
- String name = context.getXSDHelper().getLocalName(type);
- QName xmlType = new QName(namespace, name);
- dataType.setDataBinding(getName());
- dataType.setLogical(new XMLType(null, xmlType));
- return true;
- }
-
- @Override
- public WrapperHandler getWrapperHandler() {
- return wrapperHandler;
- }
-
- public SimpleTypeMapper getSimpleTypeMapper() {
- return new SDOSimpleTypeMapper();
- }
-
- @Override
- public Object copy(Object arg) {
- HelperContext context = HelperProvider.getDefaultContext();
- CopyHelper copyHelper = context.getCopyHelper();
- if (arg instanceof XMLDocument) {
- XMLDocument document = (XMLDocument)arg;
- DataObject dataObject = copyHelper.copy(document.getRootObject());
- return context.getXMLHelper().createDocument(dataObject,
- document.getRootElementURI(),
- document.getRootElementName());
- } else if (arg instanceof DataObject) {
- return context.getCopyHelper().copy((DataObject)arg);
- } else {
- return super.copy(arg);
- }
- }
-
- @Override
- public ExceptionHandler getExceptionHandler() {
- return new SDOExceptionHandler();
- }
-
-}
diff --git a/tags/java/sca/0.91-rc2-incubating/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/SDOExceptionHandler.java b/tags/java/sca/0.91-rc2-incubating/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/SDOExceptionHandler.java
deleted file mode 100644
index 1056d2ec38..0000000000
--- a/tags/java/sca/0.91-rc2-incubating/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/SDOExceptionHandler.java
+++ /dev/null
@@ -1,124 +0,0 @@
-/*
- * 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.
- */
-
-package org.apache.tuscany.sca.databinding.sdo;
-
-import java.lang.reflect.Constructor;
-import java.lang.reflect.Field;
-import java.lang.reflect.Method;
-
-import javax.xml.namespace.QName;
-
-import org.apache.tuscany.sca.databinding.ExceptionHandler;
-import org.apache.tuscany.sca.interfacedef.DataType;
-import org.apache.tuscany.sca.interfacedef.impl.DataTypeImpl;
-import org.apache.tuscany.sca.interfacedef.util.XMLType;
-
-import commonj.sdo.Type;
-import commonj.sdo.helper.HelperContext;
-import commonj.sdo.impl.HelperProvider;
-
-/**
- * SDO implementation of ExceptionHandler
- *
- * @version $Rev$ $Date$
- */
-public class SDOExceptionHandler implements ExceptionHandler {
- private static final Class[] EMPTY_CLASS_ARRAY = new Class[0];
-
- // FIXME: Need a way to pass in the HelperContext
- private HelperContext helperContext = HelperProvider.getDefaultContext();
-
- /**
- * <ul>
- * <li>WrapperException(String message, FaultBean faultInfo) <br>
- * A constructor where WrapperException is replaced with the name of the
- * generated wrapper exception and FaultBean is replaced by the name of the
- * generated fault bean.
- * <li> WrapperException(String message, FaultBean faultInfo, Throwable
- * cause) <br>
- * A constructor whereWrapperException is replaced with the name of the
- * generated wrapper exception and FaultBean is replaced by the name of the
- * generated fault bean. The last argument, cause, may be used to convey
- * protocol specific fault information
- * </ul>
- */
- public Exception createException(DataType<DataType> exceptionType, String message, Object faultInfo, Throwable cause) {
- Class exceptionClass = (Class)exceptionType.getPhysical();
- DataType<?> faultBeanType = exceptionType.getLogical();
- Class faultBeanClass = (Class)faultBeanType.getPhysical();
- try {
- Constructor constructor =
- exceptionClass.getConstructor(new Class[] {String.class, faultBeanClass, Throwable.class});
- return (Exception)constructor.newInstance(new Object[] {message, faultInfo, cause});
- } catch (Throwable e) {
- throw new IllegalArgumentException(e);
- }
- }
-
- public Object getFaultInfo(Exception exception) {
- if (exception == null) {
- return null;
- }
- try {
- Method method = exception.getClass().getMethod("getFaultInfo", EMPTY_CLASS_ARRAY);
- return method.invoke(exception, (Object[])null);
- } catch (Throwable e) {
- throw new IllegalArgumentException(e);
- }
- }
-
- public DataType<?> getFaultType(DataType exceptionDataType) {
- Class exceptionType = (Class) exceptionDataType.getPhysical();
- Class faultBeanClass = null;
- try {
- Method method = exceptionType.getMethod("getFaultInfo", EMPTY_CLASS_ARRAY);
- faultBeanClass = method.getReturnType();
- } catch (NoSuchMethodException e) {
- faultBeanClass = null;
- }
- if (faultBeanClass == null) {
- return null;
- }
-
- QName faultElement = null;
- try {
- Field field = exceptionType.getField("FAULT_ELEMENT");
- faultElement = (QName)field.get(null);
- } catch (NoSuchFieldException e) {
- // Fall back to type inspection
- Type type = helperContext.getTypeHelper().getType(faultBeanClass);
- if (type != null) {
- String ns = type.getURI();
- String name = helperContext.getXSDHelper().getLocalName(type);
- faultElement = new QName(ns, name);
- }
- } catch (Throwable e) {
- // Ignore
- }
- if (faultElement == null) {
- return null;
- }
- DataType<XMLType> faultType =
- new DataTypeImpl<XMLType>(SDODataBinding.NAME, faultBeanClass, new XMLType(faultElement, null));
- return faultType;
-
- }
-
-}
diff --git a/tags/java/sca/0.91-rc2-incubating/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/SDOSimpleTypeMapper.java b/tags/java/sca/0.91-rc2-incubating/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/SDOSimpleTypeMapper.java
deleted file mode 100644
index 752120c889..0000000000
--- a/tags/java/sca/0.91-rc2-incubating/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/SDOSimpleTypeMapper.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * 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.
- */
-
-package org.apache.tuscany.sca.databinding.sdo;
-
-import javax.xml.namespace.QName;
-
-import org.apache.tuscany.sca.databinding.SimpleTypeMapper;
-import org.apache.tuscany.sca.databinding.TransformationContext;
-import org.apache.tuscany.sdo.util.SDOUtil;
-
-
-import commonj.sdo.Type;
-import commonj.sdo.helper.HelperContext;
-import commonj.sdo.helper.TypeHelper;
-
-/**
- * SDO Java/XML mapping for simple XSD types
- */
-public class SDOSimpleTypeMapper implements SimpleTypeMapper {
- public static final String URI_2001_SCHEMA_XSD = "http://www.w3.org/2001/XMLSchema";
-
- public SDOSimpleTypeMapper() {
- super();
- }
-
- public Object toJavaObject(QName typeName, String value, TransformationContext context) {
- Type type = null;
- if (URI_2001_SCHEMA_XSD.equals(typeName.getNamespaceURI())) {
- type = SDOUtil.getXSDSDOType(typeName.getLocalPart());
- } else {
- HelperContext helperContext = SDOContextHelper.getHelperContext(context);
- TypeHelper typeHelper = helperContext.getTypeHelper();
- type = typeHelper.getType(typeName.getNamespaceURI(), typeName.getLocalPart());
- }
- return SDOUtil.createFromString(type, value);
- }
-
- public String toXMLLiteral(QName typeName, Object obj, TransformationContext context) {
- Type type = null;
- if (URI_2001_SCHEMA_XSD.equals(typeName.getNamespaceURI())) {
- type = SDOUtil.getXSDSDOType(typeName.getLocalPart());
- } else {
- HelperContext helperContext = SDOContextHelper.getHelperContext(context);
- TypeHelper typeHelper = helperContext.getTypeHelper();
- type = typeHelper.getType(typeName.getNamespaceURI(), typeName.getLocalPart());
- }
- return SDOUtil.convertToString(type, obj);
- }
-
-}
diff --git a/tags/java/sca/0.91-rc2-incubating/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/SDOWrapperHandler.java b/tags/java/sca/0.91-rc2-incubating/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/SDOWrapperHandler.java
deleted file mode 100644
index d89627da71..0000000000
--- a/tags/java/sca/0.91-rc2-incubating/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/SDOWrapperHandler.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * 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.
- */
-
-package org.apache.tuscany.sca.databinding.sdo;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-
-import javax.xml.namespace.QName;
-
-import org.apache.tuscany.sca.databinding.TransformationContext;
-import org.apache.tuscany.sca.databinding.WrapperHandler;
-import org.apache.tuscany.sca.interfacedef.util.ElementInfo;
-
-import commonj.sdo.DataObject;
-import commonj.sdo.Property;
-import commonj.sdo.Sequence;
-import commonj.sdo.Type;
-import commonj.sdo.helper.DataFactory;
-import commonj.sdo.helper.HelperContext;
-import commonj.sdo.helper.XMLDocument;
-import commonj.sdo.helper.XMLHelper;
-
-/**
- * SDO Wrapper Handler
- */
-public class SDOWrapperHandler implements WrapperHandler<Object> {
-
- /**
- * @see org.apache.tuscany.sca.databinding.WrapperHandler#create(ElementInfo, TransformationContext)
- */
- public Object create(ElementInfo element, TransformationContext context) {
- HelperContext helperContext = SDOContextHelper.getHelperContext(context);
- QName typeName = element.getType().getQName();
- DataFactory dataFactory = helperContext.getDataFactory();
- DataObject root = dataFactory.create(typeName.getNamespaceURI(), typeName.getLocalPart());
- XMLHelper xmlHelper = helperContext.getXMLHelper();
- return xmlHelper.createDocument(root, element.getQName().getNamespaceURI(), element.getQName().getLocalPart());
- }
-
- /**
- * @see org.apache.tuscany.sca.databinding.WrapperHandler#setChild(java.lang.Object, int, ElementInfo,
- * java.lang.Object)
- */
- public void setChild(Object wrapper, int i, ElementInfo childElement, Object value) {
- DataObject wrapperDO =
- (wrapper instanceof XMLDocument) ? ((XMLDocument)wrapper).getRootObject() : (DataObject)wrapper;
- wrapperDO.set(i, value);
- }
-
- @SuppressWarnings("unchecked")
- public List getChildren(Object wrapper) {
- DataObject wrapperDO =
- (wrapper instanceof XMLDocument) ? ((XMLDocument)wrapper).getRootObject() : (DataObject)wrapper;
- List<Property> properties = wrapperDO.getInstanceProperties();
- List<Object> elements = new ArrayList<Object>();
- Type type = wrapperDO.getType();
- if (type.isSequenced()) {
- // Add values in the sequence
- Sequence sequence = wrapperDO.getSequence();
- for (int i = 0; i < sequence.size(); i++) {
- // Skip mixed text
- if (sequence.getProperty(i) != null) {
- elements.add(sequence.getValue(i));
- }
- }
- } else {
- for (Property p : properties) {
- Object child = wrapperDO.get(p);
- if (p.isMany()) {
- for (Object c : (Collection<?>)child) {
- elements.add(c);
- }
- } else {
- elements.add(child);
- }
- }
- }
- return elements;
- }
-
-}
diff --git a/tags/java/sca/0.91-rc2-incubating/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/String2DataObject.java b/tags/java/sca/0.91-rc2-incubating/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/String2DataObject.java
deleted file mode 100755
index 01ec74bb30..0000000000
--- a/tags/java/sca/0.91-rc2-incubating/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/String2DataObject.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * 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.
- */
-package org.apache.tuscany.sca.databinding.sdo;
-
-import org.apache.tuscany.sca.databinding.PullTransformer;
-import org.apache.tuscany.sca.databinding.TransformationContext;
-import org.apache.tuscany.sca.databinding.TransformationException;
-import org.apache.tuscany.sca.databinding.impl.BaseTransformer;
-
-import commonj.sdo.DataObject;
-import commonj.sdo.helper.HelperContext;
-import commonj.sdo.helper.XMLHelper;
-
-public class String2DataObject extends BaseTransformer<String, DataObject> implements
- PullTransformer<String, DataObject> {
-
- public DataObject transform(String source, TransformationContext context) {
- try {
- HelperContext helperContext = SDOContextHelper.getHelperContext(context);
- XMLHelper xmlHelper = helperContext.getXMLHelper();
- return xmlHelper.load(source).getRootObject();
- } catch (Exception e) {
- throw new TransformationException(e);
- }
- }
-
- public Class getSourceType() {
- return String.class;
- }
-
- public Class getTargetType() {
- return DataObject.class;
- }
-
- public int getWeight() {
- return 50;
- }
-
-}
diff --git a/tags/java/sca/0.91-rc2-incubating/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/XMLDocument2String.java b/tags/java/sca/0.91-rc2-incubating/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/XMLDocument2String.java
deleted file mode 100644
index d11e6e46d9..0000000000
--- a/tags/java/sca/0.91-rc2-incubating/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/XMLDocument2String.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * 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.
- */
-package org.apache.tuscany.sca.databinding.sdo;
-
-import java.io.StringWriter;
-
-import org.apache.tuscany.sca.databinding.PullTransformer;
-import org.apache.tuscany.sca.databinding.TransformationContext;
-import org.apache.tuscany.sca.databinding.TransformationException;
-import org.apache.tuscany.sca.databinding.impl.BaseTransformer;
-
-import commonj.sdo.helper.HelperContext;
-import commonj.sdo.helper.XMLDocument;
-import commonj.sdo.helper.XMLHelper;
-
-public class XMLDocument2String extends BaseTransformer<XMLDocument, String> implements
- PullTransformer<XMLDocument, String> {
-
- public String transform(XMLDocument source, TransformationContext context) {
- try {
- HelperContext helperContext = SDOContextHelper.getHelperContext(context);
- XMLHelper xmlHelper = helperContext.getXMLHelper();
- StringWriter writer = new StringWriter();
- xmlHelper.save(source, writer, null);
- return writer.toString();
- } catch (Exception e) {
- throw new TransformationException(e);
- }
- }
-
- public Class getSourceType() {
- return XMLDocument.class;
- }
-
- public Class getTargetType() {
- return String.class;
- }
-
- public int getWeight() {
- return 40;
- }
-
-}
diff --git a/tags/java/sca/0.91-rc2-incubating/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/XMLDocument2XMLStreamReader.java b/tags/java/sca/0.91-rc2-incubating/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/XMLDocument2XMLStreamReader.java
deleted file mode 100755
index 0ea20bdee3..0000000000
--- a/tags/java/sca/0.91-rc2-incubating/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/XMLDocument2XMLStreamReader.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * 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.
- */
-package org.apache.tuscany.sca.databinding.sdo;
-
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-
-import org.apache.tuscany.sca.databinding.PullTransformer;
-import org.apache.tuscany.sca.databinding.TransformationContext;
-import org.apache.tuscany.sca.databinding.TransformationException;
-import org.apache.tuscany.sca.databinding.impl.BaseTransformer;
-import org.apache.tuscany.sdo.helper.XMLStreamHelper;
-import org.apache.tuscany.sdo.util.SDOUtil;
-
-
-import commonj.sdo.helper.HelperContext;
-import commonj.sdo.helper.XMLDocument;
-
-public class XMLDocument2XMLStreamReader extends BaseTransformer<XMLDocument, XMLStreamReader> implements
- PullTransformer<XMLDocument, XMLStreamReader> {
- /**
- * @param source
- * @param context
- * @return
- */
- public XMLStreamReader transform(XMLDocument source, TransformationContext context) {
- try {
- HelperContext helperContext = SDOContextHelper.getHelperContext(context);
- XMLStreamHelper streamHelper = SDOUtil.createXMLStreamHelper(helperContext.getTypeHelper());
- return streamHelper.createXMLStreamReader(source);
- } catch (XMLStreamException e) {
- throw new TransformationException(e);
- }
- }
-
- public Class getSourceType() {
- return XMLDocument.class;
- }
-
- public Class getTargetType() {
- return XMLStreamReader.class;
- }
-
- public int getWeight() {
- return 10;
- }
-
-}
diff --git a/tags/java/sca/0.91-rc2-incubating/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/XMLStreamReader2DataObject.java b/tags/java/sca/0.91-rc2-incubating/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/XMLStreamReader2DataObject.java
deleted file mode 100755
index 8797ed1f28..0000000000
--- a/tags/java/sca/0.91-rc2-incubating/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/XMLStreamReader2DataObject.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * 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.
- */
-package org.apache.tuscany.sca.databinding.sdo;
-
-import javax.xml.stream.XMLStreamConstants;
-import javax.xml.stream.XMLStreamReader;
-
-import org.apache.tuscany.sca.databinding.PullTransformer;
-import org.apache.tuscany.sca.databinding.TransformationContext;
-import org.apache.tuscany.sca.databinding.TransformationException;
-import org.apache.tuscany.sca.databinding.impl.BaseTransformer;
-import org.apache.tuscany.sdo.helper.XMLStreamHelper;
-import org.apache.tuscany.sdo.util.SDOUtil;
-
-import commonj.sdo.DataObject;
-import commonj.sdo.helper.HelperContext;
-
-public class XMLStreamReader2DataObject extends BaseTransformer<XMLStreamReader, DataObject> implements
- PullTransformer<XMLStreamReader, DataObject> {
-
- public DataObject transform(XMLStreamReader source, TransformationContext context) {
- try {
- HelperContext helperContext = SDOContextHelper.getHelperContext(context);
- XMLStreamHelper streamHelper = SDOUtil.createXMLStreamHelper(helperContext.getTypeHelper());
- // The XMLStreamHelper requires that the reader is posistioned at
- // START_ELEMENT
- while (source.getEventType() != XMLStreamConstants.START_ELEMENT && source.hasNext()) {
- source.next();
- }
- return streamHelper.loadObject(source);
- } catch (Exception e) {
- throw new TransformationException(e);
- }
- }
-
- public Class getTargetType() {
- return DataObject.class;
- }
-
- public Class getSourceType() {
- return XMLStreamReader.class;
- }
-
- public int getWeight() {
- return 15;
- }
-
-}
diff --git a/tags/java/sca/0.91-rc2-incubating/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/XMLStreamReader2XMLDocument.java b/tags/java/sca/0.91-rc2-incubating/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/XMLStreamReader2XMLDocument.java
deleted file mode 100755
index 759da7c4ab..0000000000
--- a/tags/java/sca/0.91-rc2-incubating/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/XMLStreamReader2XMLDocument.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * 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.
- */
-package org.apache.tuscany.sca.databinding.sdo;
-
-import javax.xml.stream.XMLStreamReader;
-
-import org.apache.tuscany.sca.databinding.PullTransformer;
-import org.apache.tuscany.sca.databinding.TransformationContext;
-import org.apache.tuscany.sca.databinding.TransformationException;
-import org.apache.tuscany.sca.databinding.impl.BaseTransformer;
-import org.apache.tuscany.sdo.helper.XMLStreamHelper;
-import org.apache.tuscany.sdo.util.SDOUtil;
-
-
-import commonj.sdo.helper.HelperContext;
-import commonj.sdo.helper.XMLDocument;
-
-public class XMLStreamReader2XMLDocument extends BaseTransformer<XMLStreamReader, XMLDocument> implements
- PullTransformer<XMLStreamReader, XMLDocument> {
-
- public XMLDocument transform(XMLStreamReader source, TransformationContext context) {
- try {
- HelperContext helperContext = SDOContextHelper.getHelperContext(context);
- XMLStreamHelper streamHelper = SDOUtil.createXMLStreamHelper(helperContext.getTypeHelper());
- return streamHelper.load(source);
- } catch (Exception e) {
- throw new TransformationException(e);
- }
- }
-
- public Class getTargetType() {
- return XMLDocument.class;
- }
-
- public Class getSourceType() {
- return XMLStreamReader.class;
- }
-
- public int getWeight() {
- return 15;
- }
-
-}
diff --git a/tags/java/sca/0.91-rc2-incubating/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/api/HelperContext.java b/tags/java/sca/0.91-rc2-incubating/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/api/HelperContext.java
deleted file mode 100644
index 9b6beead14..0000000000
--- a/tags/java/sca/0.91-rc2-incubating/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/api/HelperContext.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * 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.
- */
-package org.apache.tuscany.sca.databinding.sdo.api;
-
-import static java.lang.annotation.ElementType.FIELD;
-import static java.lang.annotation.ElementType.METHOD;
-import static java.lang.annotation.RetentionPolicy.RUNTIME;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.Target;
-
-/**
- * This annotation can be used by component implementation class to receive the
- * SDO HelperContext.
- *
- * @version $Rev$ $Date$
- */
-@Target({METHOD, FIELD})
-@Retention(RUNTIME)
-public @interface HelperContext {
-}
diff --git a/tags/java/sca/0.91-rc2-incubating/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/module/SDODataBindingModuleActivator.java b/tags/java/sca/0.91-rc2-incubating/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/module/SDODataBindingModuleActivator.java
deleted file mode 100644
index 4f6caa6ec0..0000000000
--- a/tags/java/sca/0.91-rc2-incubating/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/module/SDODataBindingModuleActivator.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * 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.
- */
-
-package org.apache.tuscany.sca.databinding.sdo.module;
-
-import org.apache.tuscany.sca.assembly.AssemblyFactory;
-import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessorExtensionPoint;
-import org.apache.tuscany.sca.core.ExtensionPointRegistry;
-import org.apache.tuscany.sca.core.ModelFactoryExtensionPoint;
-import org.apache.tuscany.sca.core.ModuleActivator;
-import org.apache.tuscany.sca.databinding.DataBindingExtensionPoint;
-import org.apache.tuscany.sca.databinding.TransformerExtensionPoint;
-import org.apache.tuscany.sca.databinding.sdo.DataObject2String;
-import org.apache.tuscany.sca.databinding.sdo.DataObject2XMLStreamReader;
-import org.apache.tuscany.sca.databinding.sdo.HelperContextProcessor;
-import org.apache.tuscany.sca.databinding.sdo.HelperContextRegistry;
-import org.apache.tuscany.sca.databinding.sdo.HelperContextRegistryImpl;
-import org.apache.tuscany.sca.databinding.sdo.ImportSDOProcessor;
-import org.apache.tuscany.sca.databinding.sdo.SDODataBinding;
-import org.apache.tuscany.sca.databinding.sdo.String2DataObject;
-import org.apache.tuscany.sca.databinding.sdo.XMLDocument2String;
-import org.apache.tuscany.sca.databinding.sdo.XMLDocument2XMLStreamReader;
-import org.apache.tuscany.sca.databinding.sdo.XMLStreamReader2DataObject;
-import org.apache.tuscany.sca.databinding.sdo.XMLStreamReader2XMLDocument;
-import org.apache.tuscany.sca.implementation.java.introspect.JavaClassIntrospectorExtensionPoint;
-
-/**
- * @version $Rev$ $Date$
- */
-public class SDODataBindingModuleActivator implements ModuleActivator {
-
- public Object[] getExtensionPoints() {
- return null;
- }
-
- public void start(ExtensionPointRegistry registry) {
- ModelFactoryExtensionPoint factories = registry.getExtensionPoint(ModelFactoryExtensionPoint.class);
- AssemblyFactory assemblyFactory = factories.getFactory(AssemblyFactory.class);
-
- DataBindingExtensionPoint dataBindings = registry.getExtensionPoint(DataBindingExtensionPoint.class);
- dataBindings.addDataBinding(new SDODataBinding());
-
- StAXArtifactProcessorExtensionPoint processors = registry.getExtensionPoint(StAXArtifactProcessorExtensionPoint.class);
- HelperContextRegistry contextRegistry = new HelperContextRegistryImpl();
- processors.addArtifactProcessor(new ImportSDOProcessor(contextRegistry));
-
- TransformerExtensionPoint transformers = registry.getExtensionPoint(TransformerExtensionPoint.class);
- transformers.addTransformer(new DataObject2String());
- transformers.addTransformer(new DataObject2XMLStreamReader());
- transformers.addTransformer(new XMLDocument2String());
- transformers.addTransformer(new String2DataObject());
- transformers.addTransformer(new XMLDocument2XMLStreamReader());
- transformers.addTransformer(new XMLStreamReader2DataObject());
- transformers.addTransformer(new XMLStreamReader2XMLDocument());
-
- JavaClassIntrospectorExtensionPoint introspectors = registry.getExtensionPoint(JavaClassIntrospectorExtensionPoint.class);
- introspectors.addClassVisitor(new HelperContextProcessor(assemblyFactory, contextRegistry));
-
- }
-
- public void stop(ExtensionPointRegistry registry) {
- }
-
-}
diff --git a/tags/java/sca/0.91-rc2-incubating/modules/databinding-sdo/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.ModuleActivator b/tags/java/sca/0.91-rc2-incubating/modules/databinding-sdo/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.ModuleActivator
deleted file mode 100644
index b39b5ae567..0000000000
--- a/tags/java/sca/0.91-rc2-incubating/modules/databinding-sdo/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.ModuleActivator
+++ /dev/null
@@ -1,18 +0,0 @@
-# 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.
-# Implementation class for the ExtensionActivator
-org.apache.tuscany.sca.databinding.sdo.module.SDODataBindingModuleActivator
diff --git a/tags/java/sca/0.91-rc2-incubating/modules/databinding-sdo/src/test/java/com/example/stock/sdo/fault/InvalidSymbolFault_Exception.java b/tags/java/sca/0.91-rc2-incubating/modules/databinding-sdo/src/test/java/com/example/stock/sdo/fault/InvalidSymbolFault_Exception.java
deleted file mode 100644
index 8c4f243df5..0000000000
--- a/tags/java/sca/0.91-rc2-incubating/modules/databinding-sdo/src/test/java/com/example/stock/sdo/fault/InvalidSymbolFault_Exception.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * 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.
- */
-
-package com.example.stock.sdo.fault;
-
-import javax.xml.namespace.QName;
-
-import com.example.stock.sdo.InvalidSymbolFault;
-
-/**
- * Hand-crafted java exception for SDO fault
- *
- */
-public class InvalidSymbolFault_Exception extends Exception {
- /**
- * Generated QName for the fault element
- */
- public static final QName FAULT_ELEMENT = new QName("http://www.example.com/stock", "InvalidSymbolFault");
- /**
- * Java type that goes as soapenv:Fault detail element.
- */
- private InvalidSymbolFault faultInfo;
-
- /**
- * @param faultInfo
- * @param message
- */
- public InvalidSymbolFault_Exception(String message, InvalidSymbolFault faultInfo) {
- super(message);
- this.faultInfo = faultInfo;
- }
-
- /**
- * @param faultInfo
- * @param message
- * @param cause
- */
- public InvalidSymbolFault_Exception(String message, InvalidSymbolFault faultInfo, Throwable cause) {
- super(message, cause);
- this.faultInfo = faultInfo;
- }
-
- /**
- * @return returns fault bean:
- * org.apache.tuscany.sca.test.exceptions.impl.jaxb.InvalidSymbolFault
- */
- public InvalidSymbolFault getFaultInfo() {
- return faultInfo;
- }
-
-}
diff --git a/tags/java/sca/0.91-rc2-incubating/modules/databinding-sdo/src/test/java/org/apache/tuscany/sca/databinding/sdo/DataObject2StringTestCase.java b/tags/java/sca/0.91-rc2-incubating/modules/databinding-sdo/src/test/java/org/apache/tuscany/sca/databinding/sdo/DataObject2StringTestCase.java
deleted file mode 100644
index 3665434cee..0000000000
--- a/tags/java/sca/0.91-rc2-incubating/modules/databinding-sdo/src/test/java/org/apache/tuscany/sca/databinding/sdo/DataObject2StringTestCase.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * 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.
- */
-
-package org.apache.tuscany.sca.databinding.sdo;
-
-import junit.framework.Assert;
-
-import org.apache.tuscany.sca.interfacedef.DataType;
-import org.apache.tuscany.sca.interfacedef.impl.DataTypeImpl;
-import org.apache.tuscany.sca.interfacedef.util.XMLType;
-
-import com.example.ipo.sdo.PurchaseOrderType;
-import commonj.sdo.DataObject;
-
-/**
- *
- */
-public class DataObject2StringTestCase extends SDOTransformerTestCaseBase {
- @Override
- protected DataType<?> getSourceDataType() {
- return new DataTypeImpl<XMLType>(binding, PurchaseOrderType.class, new XMLType(ORDER_QNAME, null));
- }
-
- @Override
- protected DataType<?> getTargetDataType() {
- return new DataTypeImpl<Class<String>>(String.class, String.class);
- }
-
- public final void testTransform() {
- String xml = new DataObject2String().transform(dataObject, context);
- Assert.assertTrue(xml.indexOf("<city>San Jose</city>") != -1);
- DataObject po = new String2DataObject().transform(xml, reversedContext);
- Assert.assertTrue(po instanceof PurchaseOrderType);
- PurchaseOrderType orderType = (PurchaseOrderType)po;
- Assert.assertEquals("San Jose", orderType.getBillTo().getCity());
- }
-
- public final void testXML() {
- String xml =
- "<foo xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" "
- + "xmlns:ipo=\"http://www.example.com/IPO\" xsi:type=\"ipo:USAddress\"/>";
- DataObject dataObject = new String2DataObject().transform(xml, reversedContext);
- context.setSourceDataType(new DataTypeImpl<XMLType>(DataObject.class.getName(), DataObject.class, null));
- xml = new DataObject2String().transform(dataObject, context);
- Assert.assertTrue(xml.contains("xsi:type=\"ipo:USAddress\""));
- }
-
-}
diff --git a/tags/java/sca/0.91-rc2-incubating/modules/databinding-sdo/src/test/java/org/apache/tuscany/sca/databinding/sdo/DataObject2XMLStreamReaderTestCase.java b/tags/java/sca/0.91-rc2-incubating/modules/databinding-sdo/src/test/java/org/apache/tuscany/sca/databinding/sdo/DataObject2XMLStreamReaderTestCase.java
deleted file mode 100644
index 369912f115..0000000000
--- a/tags/java/sca/0.91-rc2-incubating/modules/databinding-sdo/src/test/java/org/apache/tuscany/sca/databinding/sdo/DataObject2XMLStreamReaderTestCase.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * 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.
- */
-
-package org.apache.tuscany.sca.databinding.sdo;
-
-import javax.xml.stream.XMLStreamConstants;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-
-import org.apache.tuscany.sca.interfacedef.DataType;
-import org.apache.tuscany.sca.interfacedef.impl.DataTypeImpl;
-import org.apache.tuscany.sca.interfacedef.util.XMLType;
-
-import com.example.ipo.sdo.PurchaseOrderType;
-
-/**
- *
- */
-public class DataObject2XMLStreamReaderTestCase extends SDOTransformerTestCaseBase {
-
- @Override
- protected DataType<?> getSourceDataType() {
- return new DataTypeImpl<XMLType>(binding, PurchaseOrderType.class, new XMLType(ORDER_QNAME, null));
- }
-
- @Override
- protected DataType<?> getTargetDataType() {
- return new DataTypeImpl<Class<XMLStreamReader>>(XMLStreamReader.class, XMLStreamReader.class);
- }
-
- public final void testTransform() throws XMLStreamException {
- XMLStreamReader reader = new DataObject2XMLStreamReader().transform(dataObject, context);
- while (reader.hasNext()) {
- int event = reader.next();
- if (event == XMLStreamConstants.START_ELEMENT) {
- break;
- }
- }
- new XMLStreamReader2DataObject().transform(reader, reversedContext);
- }
-
-}
diff --git a/tags/java/sca/0.91-rc2-incubating/modules/databinding-sdo/src/test/java/org/apache/tuscany/sca/databinding/sdo/HelperContextProcessorTestCase.java b/tags/java/sca/0.91-rc2-incubating/modules/databinding-sdo/src/test/java/org/apache/tuscany/sca/databinding/sdo/HelperContextProcessorTestCase.java
deleted file mode 100644
index c6fc6813e0..0000000000
--- a/tags/java/sca/0.91-rc2-incubating/modules/databinding-sdo/src/test/java/org/apache/tuscany/sca/databinding/sdo/HelperContextProcessorTestCase.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * 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.
- */
-
-package org.apache.tuscany.sca.databinding.sdo;
-
-import java.lang.reflect.Field;
-import java.lang.reflect.Method;
-import java.net.URI;
-
-import javax.xml.stream.XMLInputFactory;
-
-import junit.framework.TestCase;
-
-import org.apache.tuscany.sca.assembly.AssemblyFactory;
-import org.apache.tuscany.sca.assembly.DefaultAssemblyFactory;
-import org.apache.tuscany.sca.implementation.java.DefaultJavaImplementationFactory;
-import org.apache.tuscany.sca.implementation.java.JavaImplementation;
-import org.apache.tuscany.sca.implementation.java.JavaImplementationFactory;
-import org.apache.tuscany.sca.implementation.java.impl.JavaResourceImpl;
-
-import commonj.sdo.helper.HelperContext;
-
-/**
- * @version $Rev$ $Date$
- */
-public class HelperContextProcessorTestCase extends TestCase {
-
- @SuppressWarnings("unchecked")
- public void testProcessor() throws Exception {
- HelperContextRegistry registry = new HelperContextRegistryImpl();
- HelperContextProcessor processor = new HelperContextProcessor(new DefaultAssemblyFactory(), registry);
- URI id = URI.create("/composite1/");
- XMLInputFactory xmlFactory = XMLInputFactory.newInstance();
-
- AssemblyFactory assemblyFactory = new DefaultAssemblyFactory();
- JavaImplementationFactory javaImplementationFactory = new DefaultJavaImplementationFactory();
- JavaImplementation componentType = javaImplementationFactory.createJavaImplementation();
- componentType.setJavaClass(FooImpl.class);
- for (Field f : FooImpl.class.getDeclaredFields()) {
- processor.visitField(f, componentType);
-
- }
- for (Method m : FooImpl.class.getMethods()) {
- processor.visitMethod(m, componentType);
- }
-
- JavaResourceImpl r1 = (JavaResourceImpl)componentType.getResources().get("context");
- assertNotNull(r1);
- JavaResourceImpl r2 = (JavaResourceImpl)componentType.getResources().get("context2");
- assertNotNull(r2);
-// HelperContext c1 = (HelperContext)r1.getObjectFactory().getInstance();
-// HelperContext c2 = (HelperContext)r2.getObjectFactory().getInstance();
-// assertSame(c1, c2);
- }
-
- private static class FooImpl {
- @org.apache.tuscany.sca.databinding.sdo.api.HelperContext
- protected HelperContext context2;
-
- private HelperContext context;
-
- @org.apache.tuscany.sca.databinding.sdo.api.HelperContext
- public void setContext(HelperContext context1) {
- this.context = context1;
- }
- }
-}
diff --git a/tags/java/sca/0.91-rc2-incubating/modules/databinding-sdo/src/test/java/org/apache/tuscany/sca/databinding/sdo/ImportSDOProcessorTestCase.java b/tags/java/sca/0.91-rc2-incubating/modules/databinding-sdo/src/test/java/org/apache/tuscany/sca/databinding/sdo/ImportSDOProcessorTestCase.java
deleted file mode 100755
index cd7a02cb88..0000000000
--- a/tags/java/sca/0.91-rc2-incubating/modules/databinding-sdo/src/test/java/org/apache/tuscany/sca/databinding/sdo/ImportSDOProcessorTestCase.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * 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.
- */
-package org.apache.tuscany.sca.databinding.sdo;
-
-import java.io.StringReader;
-import java.net.URI;
-
-import javax.xml.stream.XMLInputFactory;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-
-import junit.framework.TestCase;
-
-import com.example.ipo.sdo.SdoFactory;
-
-/**
- * @version $Rev$ $Date$
- */
-public class ImportSDOProcessorTestCase extends TestCase {
- private static boolean inited;
-
- private ImportSDOProcessor loader;
- private XMLInputFactory xmlFactory;
-
- public void testMinimal() throws Exception {
- String xml = "<import.sdo xmlns='http://tuscany.apache.org/xmlns/sca/databinding/sdo/1.0'/>";
- XMLStreamReader reader = getReader(xml);
- assertTrue(loader.read(reader) instanceof ImportSDO);
- }
-
- public void testLocation() throws Exception {
- String xml = "<import.sdo xmlns='http://tuscany.apache.org/xmlns/sca/databinding/sdo/1.0' location='ipo.xsd'/>";
- XMLStreamReader reader = getReader(xml);
- assertTrue(loader.read(reader) instanceof ImportSDO);
- }
-
- public void testFactory() throws Exception {
- String xml = "<import.sdo xmlns='http://tuscany.apache.org/xmlns/sca/databinding/sdo/1.0' " + "factory='"
- + MockFactory.class.getName()
- + "'/>";
- XMLStreamReader reader = getReader(xml);
- assertFalse(inited);
- ImportSDO importSDO = loader.read(reader);
- assertNotNull(importSDO);
- loader.resolve(importSDO, new TestModelResolver(getClass().getClassLoader()));
- assertTrue(inited);
- }
-
- protected void setUp() throws Exception {
- super.setUp();
- URI id = URI.create("/composite1/");
- loader = new ImportSDOProcessor(new HelperContextRegistryImpl());
- xmlFactory = XMLInputFactory.newInstance();
- }
-
- protected XMLStreamReader getReader(String xml) throws XMLStreamException {
- XMLStreamReader reader = xmlFactory.createXMLStreamReader(new StringReader(xml));
- reader.next();
- return reader;
- }
-
- public static class MockFactory {
- public static final Object INSTANCE = SdoFactory.INSTANCE;
-
- static {
- ImportSDOProcessorTestCase.inited = true;
- }
- }
-}
diff --git a/tags/java/sca/0.91-rc2-incubating/modules/databinding-sdo/src/test/java/org/apache/tuscany/sca/databinding/sdo/SDODataBindingTestCase.java b/tags/java/sca/0.91-rc2-incubating/modules/databinding-sdo/src/test/java/org/apache/tuscany/sca/databinding/sdo/SDODataBindingTestCase.java
deleted file mode 100644
index 17e4901cc2..0000000000
--- a/tags/java/sca/0.91-rc2-incubating/modules/databinding-sdo/src/test/java/org/apache/tuscany/sca/databinding/sdo/SDODataBindingTestCase.java
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
- * 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.
- */
-
-package org.apache.tuscany.sca.databinding.sdo;
-
-import javax.xml.namespace.QName;
-
-import junit.framework.TestCase;
-
-import org.apache.tuscany.sca.interfacedef.DataType;
-import org.apache.tuscany.sca.interfacedef.impl.DataTypeImpl;
-import org.apache.tuscany.sca.interfacedef.util.XMLType;
-
-import com.example.ipo.sdo.PurchaseOrderType;
-import com.example.ipo.sdo.SdoFactory;
-import com.example.ipo.sdo.USAddress;
-import commonj.sdo.DataObject;
-import commonj.sdo.helper.HelperContext;
-import commonj.sdo.helper.XMLDocument;
-import commonj.sdo.impl.HelperProvider;
-
-/**
- *
- */
-public class SDODataBindingTestCase extends TestCase {
- protected static final QName ORDER_QNAME = new QName("http://www.example.com/IPO", "purchaseOrder");
- private SDODataBinding binding;
- private HelperContext context;
-
- /**
- * @see junit.framework.TestCase#setUp()
- */
- protected void setUp() throws Exception {
- super.setUp();
- binding = new SDODataBinding();
- context = HelperProvider.getDefaultContext();
- SdoFactory.INSTANCE.register(context);
- }
-
- public final void testIntrospect() {
- DataType dataType = new DataTypeImpl<Class>(DataObject.class, null);
- boolean yes = binding.introspect(dataType, null);
- assertTrue(yes);
- assertTrue(dataType.getDataBinding().equals(binding.getName()));
- assertTrue(dataType.getPhysical() == DataObject.class && dataType.getLogical() == XMLType.UNKNOWN);
- dataType = new DataTypeImpl<Class>(PurchaseOrderType.class, null);
- yes = binding.introspect(dataType, null);
- assertTrue(yes);
- assertEquals(PurchaseOrderType.class, dataType.getPhysical());
- assertEquals(new QName("http://www.example.com/IPO", "PurchaseOrderType"), ((XMLType)dataType.getLogical())
- .getTypeName());
- dataType = new DataTypeImpl<Class>(USAddress.class, null);
- yes = binding.introspect(dataType, null);
- assertTrue(yes);
- assertEquals(USAddress.class, dataType.getPhysical());
- assertEquals(new QName("http://www.example.com/IPO", "USAddress"), ((XMLType)dataType.getLogical())
- .getTypeName());
- }
-
- public final void testCopyRoot() {
- PurchaseOrderType po = SdoFactory.INSTANCE.createPurchaseOrderType();
- po.setComment("Comment");
- Object copy = binding.copy(po);
- assertTrue(copy instanceof PurchaseOrderType);
- assertTrue(po != copy);
- assertTrue(context.getEqualityHelper().equal((DataObject)po, (DataObject)copy));
- assertEquals("Comment", ((PurchaseOrderType)copy).getComment());
- }
-
- public final void testCopyNonRoot() {
- USAddress address = SdoFactory.INSTANCE.createUSAddress();
- address.setCity("San Jose");
- Object copy = binding.copy(address);
- assertTrue(copy instanceof USAddress);
- assertTrue(address != copy);
- assertTrue(context.getEqualityHelper().equal((DataObject)address, (DataObject)copy));
- assertEquals("San Jose", ((USAddress)copy).getCity());
- }
-
- public final void testCopyXMLDocument() {
- PurchaseOrderType po = SdoFactory.INSTANCE.createPurchaseOrderType();
- po.setComment("Comment");
- XMLDocument doc =
- context.getXMLHelper().createDocument((DataObject)po,
- ORDER_QNAME.getNamespaceURI(),
- ORDER_QNAME.getLocalPart());
- Object copy = binding.copy(doc);
- assertTrue(copy instanceof XMLDocument);
- XMLDocument docCopy = (XMLDocument)copy;
- assertTrue(doc != copy);
- assertTrue(context.getEqualityHelper().equal((DataObject)po, docCopy.getRootObject()));
- assertEquals("Comment", ((PurchaseOrderType)docCopy.getRootObject()).getComment());
- }
-}
diff --git a/tags/java/sca/0.91-rc2-incubating/modules/databinding-sdo/src/test/java/org/apache/tuscany/sca/databinding/sdo/SDOExceptionHandlerTestCase.java b/tags/java/sca/0.91-rc2-incubating/modules/databinding-sdo/src/test/java/org/apache/tuscany/sca/databinding/sdo/SDOExceptionHandlerTestCase.java
deleted file mode 100644
index f8373cfd1c..0000000000
--- a/tags/java/sca/0.91-rc2-incubating/modules/databinding-sdo/src/test/java/org/apache/tuscany/sca/databinding/sdo/SDOExceptionHandlerTestCase.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * 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.
- */
-
-package org.apache.tuscany.sca.databinding.sdo;
-
-import junit.framework.TestCase;
-
-import org.apache.tuscany.sca.interfacedef.DataType;
-import org.apache.tuscany.sca.interfacedef.impl.DataTypeImpl;
-import org.apache.tuscany.sca.interfacedef.util.XMLType;
-
-import com.example.stock.sdo.InvalidSymbolFault;
-import com.example.stock.sdo.StockFactory;
-import com.example.stock.sdo.fault.InvalidSymbolFault_Exception;
-import commonj.sdo.impl.HelperProvider;
-
-/**
- * Test case for SDOExceptionHandler
- */
-public class SDOExceptionHandlerTestCase extends TestCase {
- // FIXME: Tuscany SDO impl uses _._type for anonymouse type, by the SDO
- // spec, it should be same as the
- // enclosing element/attribute name
- private SDOExceptionHandler handler;
-
- /**
- * @see junit.framework.TestCase#setUp()
- */
- protected void setUp() throws Exception {
- super.setUp();
- this.handler = new SDOExceptionHandler();
- StockFactory.INSTANCE.register(HelperProvider.getDefaultContext());
- }
-
- public void testGetFaultType() {
- DataType execType = new DataTypeImpl<XMLType>(InvalidSymbolFault_Exception.class, XMLType.UNKNOWN);
- DataType<?> dataType = handler.getFaultType(execType);
- assertEquals(InvalidSymbolFault.class, dataType.getPhysical());
- assertEquals(InvalidSymbolFault_Exception.FAULT_ELEMENT, ((XMLType) dataType.getLogical()).getElementName());
- assertEquals(SDODataBinding.NAME, dataType.getDataBinding());
- }
-
- public void testCreate() {
- DataType execType = new DataTypeImpl<XMLType>(InvalidSymbolFault_Exception.class, XMLType.UNKNOWN);
- DataType<?> faultType = handler.getFaultType(execType);
- InvalidSymbolFault fault = StockFactory.INSTANCE.createInvalidSymbolFault();
- fault.setMessage("ABC");
- fault.setSymbol("IBM0");
- DataType<DataType> exType = new DataTypeImpl<DataType>(InvalidSymbolFault_Exception.class, faultType);
- Exception ex = handler.createException(exType, "Invalid symbol", fault, null);
- assertTrue(ex instanceof InvalidSymbolFault_Exception);
- InvalidSymbolFault_Exception exception = (InvalidSymbolFault_Exception)ex;
- assertEquals("Invalid symbol", exception.getMessage());
- assertSame(fault, exception.getFaultInfo());
- }
-
- public void testGetFaultInfo() {
- InvalidSymbolFault fault = StockFactory.INSTANCE.createInvalidSymbolFault();
- fault.setMessage("ABC");
- fault.setSymbol("IBM0");
- InvalidSymbolFault_Exception exception = new InvalidSymbolFault_Exception("Invalid symbol", fault);
- Object faultInfo = handler.getFaultInfo(exception);
- assertSame(fault, faultInfo);
- }
-
-}
diff --git a/tags/java/sca/0.91-rc2-incubating/modules/databinding-sdo/src/test/java/org/apache/tuscany/sca/databinding/sdo/SDOTransformerTestCaseBase.java b/tags/java/sca/0.91-rc2-incubating/modules/databinding-sdo/src/test/java/org/apache/tuscany/sca/databinding/sdo/SDOTransformerTestCaseBase.java
deleted file mode 100644
index ff1ac633a8..0000000000
--- a/tags/java/sca/0.91-rc2-incubating/modules/databinding-sdo/src/test/java/org/apache/tuscany/sca/databinding/sdo/SDOTransformerTestCaseBase.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * 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.
- */
-
-package org.apache.tuscany.sca.databinding.sdo;
-
-import javax.xml.namespace.QName;
-
-import junit.framework.TestCase;
-
-import org.apache.tuscany.sca.databinding.TransformationContext;
-import org.apache.tuscany.sca.databinding.impl.TransformationContextImpl;
-import org.apache.tuscany.sca.interfacedef.DataType;
-
-import com.example.ipo.sdo.PurchaseOrderType;
-import com.example.ipo.sdo.SdoFactory;
-import com.example.ipo.sdo.USAddress;
-import commonj.sdo.DataObject;
-import commonj.sdo.helper.HelperContext;
-import commonj.sdo.impl.HelperProvider;
-
-/**
- * The base class for SDO-related test cases
- */
-public abstract class SDOTransformerTestCaseBase extends TestCase {
- protected static final QName ORDER_QNAME = new QName("http://www.example.com/IPO", "purchaseOrder");
-
- protected HelperContext helperContext;
- protected String binding = DataObject.class.getName();
- protected TransformationContext context;
- protected TransformationContext reversedContext;
- protected DataObject dataObject;
-
- /**
- * @see junit.framework.TestCase#setUp()
- */
- protected void setUp() throws Exception {
- super.setUp();
- helperContext = HelperProvider.getDefaultContext();
- SdoFactory.INSTANCE.register(helperContext);
-
- context = new TransformationContextImpl();
- context.setSourceDataType(getSourceDataType());
- context.setTargetDataType(getTargetDataType());
-
- reversedContext = new TransformationContextImpl();
- reversedContext.setSourceDataType(getTargetDataType());
- reversedContext.setTargetDataType(getSourceDataType());
-
- PurchaseOrderType po = SdoFactory.INSTANCE.createPurchaseOrderType();
- USAddress address = SdoFactory.INSTANCE.createUSAddress();
- address.setCity("San Jose");
- address.setStreet("123 ABC St");
- address.setState("CA");
- address.setStreet("95131");
- po.setBillTo(address);
- dataObject = (DataObject) po;
- }
-
- protected abstract DataType<?> getSourceDataType();
-
- protected abstract DataType<?> getTargetDataType();
-
-}
diff --git a/tags/java/sca/0.91-rc2-incubating/modules/databinding-sdo/src/test/java/org/apache/tuscany/sca/databinding/sdo/SDOWrapperHandlerTestCase.java b/tags/java/sca/0.91-rc2-incubating/modules/databinding-sdo/src/test/java/org/apache/tuscany/sca/databinding/sdo/SDOWrapperHandlerTestCase.java
deleted file mode 100644
index ed57e81ee7..0000000000
--- a/tags/java/sca/0.91-rc2-incubating/modules/databinding-sdo/src/test/java/org/apache/tuscany/sca/databinding/sdo/SDOWrapperHandlerTestCase.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * 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.
- */
-package org.apache.tuscany.sca.databinding.sdo;
-
-import java.util.List;
-
-import junit.framework.TestCase;
-
-import org.apache.tuscany.sdo.util.SDOUtil;
-
-
-import commonj.sdo.helper.HelperContext;
-import commonj.sdo.helper.XMLDocument;
-import commonj.sdo.helper.XMLHelper;
-import commonj.sdo.helper.XSDHelper;
-
-/**
- * @version $Rev$ $Date$
- */
-public class SDOWrapperHandlerTestCase extends TestCase {
- private HelperContext context;
- private SDOWrapperHandler handler;
-
- public void setUp() throws Exception {
- context = SDOUtil.createHelperContext();
- handler = new SDOWrapperHandler();
- }
-
- public void testWrapperAnyType() throws Exception {
- XMLHelper xmlHelper = context.getXMLHelper();
- XMLDocument document = xmlHelper.load(getClass().getResourceAsStream("/wrapper.xml"));
- List children = handler.getChildren(document);
- assertEquals(5, children.size());
- }
-
- public void testWrapper() throws Exception {
- XSDHelper xsdHelper = context.getXSDHelper();
- xsdHelper.define(getClass().getResourceAsStream("/wrapper.xsd"), null);
- XMLHelper xmlHelper = context.getXMLHelper();
- XMLDocument document = xmlHelper.load(getClass().getResourceAsStream("/wrapper.xml"));
- List children = handler.getChildren(document);
- assertEquals(5, children.size());
- }
-
-}
diff --git a/tags/java/sca/0.91-rc2-incubating/modules/databinding-sdo/src/test/java/org/apache/tuscany/sca/databinding/sdo/TestModelResolver.java b/tags/java/sca/0.91-rc2-incubating/modules/databinding-sdo/src/test/java/org/apache/tuscany/sca/databinding/sdo/TestModelResolver.java
deleted file mode 100644
index f1caa4e8a7..0000000000
--- a/tags/java/sca/0.91-rc2-incubating/modules/databinding-sdo/src/test/java/org/apache/tuscany/sca/databinding/sdo/TestModelResolver.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * 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.
- */
-
-package org.apache.tuscany.sca.databinding.sdo;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
-
-
-/**
- * A default implementation of an artifact resolver, based on a map.
- *
- * @version $Rev$ $Date$
- */
-public class TestModelResolver implements ModelResolver {
- private static final long serialVersionUID = -7826976465762296634L;
-
- private Map<Object, Object> map = new HashMap<Object, Object>();
-
- public TestModelResolver(ClassLoader classLoader) {
- }
-
- public <T> T resolveModel(Class<T> modelClass, T unresolved) {
- Object resolved = map.get(unresolved);
- if (resolved != null) {
-
- // Return the resolved object
- return modelClass.cast(resolved);
-
- } else {
-
- // Return the unresolved object
- return unresolved;
- }
- }
-
- public void addModel(Object resolved) {
- map.put(resolved, resolved);
- }
-
- public Object removeModel(Object resolved) {
- return map.remove(resolved);
- }
-
-}
diff --git a/tags/java/sca/0.91-rc2-incubating/modules/databinding-sdo/src/test/java/org/apache/tuscany/sca/databinding/sdo/XMLDocument2XMLStreamReaderTestCase.java b/tags/java/sca/0.91-rc2-incubating/modules/databinding-sdo/src/test/java/org/apache/tuscany/sca/databinding/sdo/XMLDocument2XMLStreamReaderTestCase.java
deleted file mode 100644
index 78bc62eb3a..0000000000
--- a/tags/java/sca/0.91-rc2-incubating/modules/databinding-sdo/src/test/java/org/apache/tuscany/sca/databinding/sdo/XMLDocument2XMLStreamReaderTestCase.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * 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.
- */
-
-package org.apache.tuscany.sca.databinding.sdo;
-
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-
-import junit.framework.Assert;
-
-import org.apache.tuscany.sca.interfacedef.DataType;
-import org.apache.tuscany.sca.interfacedef.impl.DataTypeImpl;
-import org.apache.tuscany.sca.interfacedef.util.XMLType;
-
-import com.example.ipo.sdo.PurchaseOrderType;
-import commonj.sdo.helper.XMLDocument;
-
-/**
- *
- */
-public class XMLDocument2XMLStreamReaderTestCase extends SDOTransformerTestCaseBase {
-
- @Override
- protected DataType<?> getSourceDataType() {
- return new DataTypeImpl<XMLType>(XMLDocument.class.getName(), XMLDocument.class, new XMLType(ORDER_QNAME, null));
- }
-
- @Override
- protected DataType<?> getTargetDataType() {
- return new DataTypeImpl<Class<XMLStreamReader>>(XMLStreamReader.class, XMLStreamReader.class);
- }
-
- public final void testTransform() throws XMLStreamException {
- XMLDocument document =
- helperContext.getXMLHelper().createDocument(dataObject,
- ORDER_QNAME.getNamespaceURI(),
- ORDER_QNAME.getLocalPart());
- XMLStreamReader reader = new XMLDocument2XMLStreamReader().transform(document, context);
- XMLDocument document2 = new XMLStreamReader2XMLDocument().transform(reader, reversedContext);
- Assert.assertEquals(ORDER_QNAME.getNamespaceURI(), document2.getRootElementURI());
- Assert.assertEquals(ORDER_QNAME.getLocalPart(), document2.getRootElementName());
- Assert.assertTrue(document2.getRootObject() instanceof PurchaseOrderType);
- }
-
-}
diff --git a/tags/java/sca/0.91-rc2-incubating/modules/databinding-sdo/src/test/resources/ipo.xsd b/tags/java/sca/0.91-rc2-incubating/modules/databinding-sdo/src/test/resources/ipo.xsd
deleted file mode 100755
index 241ec15d36..0000000000
--- a/tags/java/sca/0.91-rc2-incubating/modules/databinding-sdo/src/test/resources/ipo.xsd
+++ /dev/null
@@ -1,136 +0,0 @@
-<!--
- * 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.
--->
-<schema targetNamespace="http://www.example.com/IPO"
- xmlns="http://www.w3.org/2001/XMLSchema"
- xmlns:ipo="http://www.example.com/IPO">
-
- <annotation>
- <documentation xml:lang="en">
- International Purchase order schema for Example.com
- Copyright 2000 Example.com. All rights reserved.
- </documentation>
- </annotation>
-
-
- <element name="purchaseOrder" type="ipo:PurchaseOrderType" />
-
- <element name="comment" type="string" />
-
- <complexType name="PurchaseOrderType">
- <sequence>
- <element name="shipTo" type="ipo:Address" />
- <element name="billTo" type="ipo:Address" />
- <element ref="ipo:comment" minOccurs="0" />
- <element name="items" type="ipo:Items" />
- </sequence>
- <attribute name="orderDate" type="date" />
- </complexType>
-
- <complexType name="Items">
- <sequence>
- <element name="item" minOccurs="0" maxOccurs="unbounded">
- <complexType>
- <sequence>
- <element name="productName" type="string" />
- <element name="quantity">
- <simpleType>
- <restriction base="positiveInteger">
- <maxExclusive value="100" />
- </restriction>
- </simpleType>
- </element>
- <element name="USPrice" type="decimal" />
- <element ref="ipo:comment" minOccurs="0" />
- <element name="shipDate" type="date"
- minOccurs="0" />
- </sequence>
- <attribute name="partNum" type="ipo:SKU"
- use="required" />
- </complexType>
- </element>
- </sequence>
- </complexType>
-
- <simpleType name="SKU">
- <restriction base="string">
- <pattern value="\d{3}-[A-Z]{2}" />
- </restriction>
- </simpleType>
-
- <complexType name="Address">
- <sequence>
- <element name="name" type="string" />
- <element name="street" type="string" />
- <element name="city" type="string" />
- </sequence>
- </complexType>
-
- <complexType name="USAddress">
- <complexContent>
- <extension base="ipo:Address">
- <sequence>
- <element name="state" type="ipo:USState" />
- <element name="zip" type="positiveInteger" />
- </sequence>
- </extension>
- </complexContent>
- </complexType>
-
- <complexType name="UKAddress">
- <complexContent>
- <extension base="ipo:Address">
- <sequence>
- <element name="postcode" type="ipo:UKPostcode" />
- </sequence>
- <attribute name="exportCode" type="positiveInteger"
- fixed="1" />
- </extension>
- </complexContent>
- </complexType>
-
- <!-- other Address derivations for more countries -->
-
- <simpleType name="USState">
- <restriction base="string">
- <enumeration value="AK" />
- <enumeration value="AL" />
- <enumeration value="AR" />
- <enumeration value="CA" />
- <enumeration value="PA" />
- <!-- and so on ... -->
- </restriction>
- </simpleType>
-
- <simpleType name="Postcode">
- <restriction base="string">
- <length value="7" fixed="true" />
- </restriction>
- </simpleType>
-
-
- <simpleType name="UKPostcode">
- <restriction base="ipo:Postcode">
- <pattern value="[A-Z]{2}\d\s\d[A-Z]{2}" />
- </restriction>
- </simpleType>
-
-
-
-</schema>
-
diff --git a/tags/java/sca/0.91-rc2-incubating/modules/databinding-sdo/src/test/resources/model/sca-core.xsd b/tags/java/sca/0.91-rc2-incubating/modules/databinding-sdo/src/test/resources/model/sca-core.xsd
deleted file mode 100755
index 56c6977254..0000000000
--- a/tags/java/sca/0.91-rc2-incubating/modules/databinding-sdo/src/test/resources/model/sca-core.xsd
+++ /dev/null
@@ -1,233 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * 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.
--->
-<schema xmlns="http://www.w3.org/2001/XMLSchema"
- targetNamespace="http://www.osoa.org/xmlns/sca/0.9"
- xmlns:sca="http://www.osoa.org/xmlns/sca/0.9"
- elementFormDefault="qualified">
-
- <element name="componentType" type="sca:ComponentType"/>
- <complexType name="ComponentType">
- <sequence>
- <element minOccurs="0" maxOccurs="unbounded" name="service" type="sca:Service"/>
- <element minOccurs="0" maxOccurs="unbounded" name="reference" type="sca:Reference"/>
- <element minOccurs="0" maxOccurs="unbounded" name="property" type="sca:Property"/>
- <any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- <anyAttribute namespace="##any" processContents="lax"/>
- </complexType>
-
- <complexType name="Service">
- <sequence>
- <element minOccurs="1" maxOccurs="1" ref="sca:interface"/>
- <any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="name" type="NCName" use="required"/>
- <anyAttribute namespace="##any" processContents="lax"/>
- </complexType>
-
- <element name="interface" type="sca:Interface"/>
- <complexType name="Interface"/>
-
- <complexType name="Reference">
- <sequence>
- <element minOccurs="1" maxOccurs="1" ref="sca:interface"/>
- <any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="name" type="NCName" use="required"/>
- <attribute name="multiplicity" type="sca:Multiplicity" use="optional" default="1..1"/>
- <anyAttribute namespace="##any" processContents="lax"/>
- </complexType>
-
- <complexType name="Property">
- <sequence>
- <any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="name" type="NCName" use="required"/>
- <attribute name="type" type="QName" use="required"/>
- <attribute name="many" type="boolean" default="false" use="optional"/>
- <attribute name="required" type="boolean" default="false" use="optional"/>
- <attribute name="default" type="string" use="optional"/>
- <anyAttribute namespace="##any" processContents="lax"/>
- </complexType>
-
-
- <element name="moduleFragment" type="sca:ModuleFragment"/>
- <complexType name="ModuleFragment">
- <sequence>
- <element minOccurs="0" maxOccurs="unbounded" name="entryPoint" type="sca:EntryPoint"/>
- <element minOccurs="0" maxOccurs="unbounded" name="component" type="sca:Component"/>
- <element minOccurs="0" maxOccurs="unbounded" name="externalService" type="sca:ExternalService"/>
- <element minOccurs="0" maxOccurs="unbounded" name="wire" type="sca:ModuleWire"/>
- <any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="name" type="NCName" use="required"/>
- <anyAttribute namespace="##any" processContents="lax"/>
- </complexType>
-
- <element name="module" type="sca:Module"/>
- <complexType name="Module">
- <complexContent>
- <extension base="sca:ModuleFragment"/>
- </complexContent>
- </complexType>
-
- <complexType name="EntryPoint">
- <sequence>
- <element minOccurs="0" maxOccurs="1" ref="sca:interface"/>
- <element minOccurs="1" maxOccurs="unbounded" ref="sca:binding"/>
- <element minOccurs="1" maxOccurs="unbounded" name="reference" type="anyURI"/>
- <any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="name" type="NCName" use="required"/>
- <attribute name="multiplicity" type="sca:Multiplicity" use="optional" default="1..1"/>
- <anyAttribute namespace="##any" processContents="lax"/>
- </complexType>
- <!-- a multiplicity 1..1 or 0..n sample
- <reference>StockQuoteComponent</reference> - type must be URI
- a multiplicity 1..n or 0..n sample
- <reference>StockQuoteComponent1</reference> - type must be URI
- <reference>StockQuoteComponent2</reference>
- -->
-
- <element name="binding" type="sca:Binding"/>
- <complexType name="Binding">
- <attribute name="uri" type="anyURI" use="optional"/>
- </complexType>
-
- <complexType name="Component">
- <sequence>
- <element minOccurs="1" maxOccurs="1" ref="sca:implementation"/>
- <element minOccurs="0" maxOccurs="1" name="properties" type="sca:PropertyValues"/>
- <element minOccurs="0" maxOccurs="1" name="references" type="sca:ReferenceValues"/>
- <any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="name" type="NCName" use="required"/>
- <anyAttribute namespace="##any" processContents="lax"/>
- </complexType>
- <!-- a multiplicity 1..1 or 0..1 sample
- <references>
- <v:stockQuote>StockQuoteComponent</v:stockquote> - type must be URI
- </references>
- a multiplicity 1..n or 0..n sample
- <references>
- <v:stockQuote>StockQuoteComponent1</v:stockQuote> - type must be URI
- <v:stockQuote>StockQuoteComponent2</v:stockQuote>
- </references>
- -->
-
- <element name="implementation" type="sca:Implementation"/>
- <complexType name="Implementation"/>
-
- <complexType name="PropertyValues">
- <sequence>
- <any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- <anyAttribute namespace="##any" processContents="lax"/>
- </complexType>
-
- <complexType name="ReferenceValues">
- <sequence>
- <any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- <anyAttribute namespace="##any" processContents="lax"/>
- </complexType>
-
-
- <complexType name="ExternalService">
- <sequence>
- <element minOccurs="1" maxOccurs="1" ref="sca:interface"/>
- <element minOccurs="0" maxOccurs="unbounded" ref="sca:binding"/>
- </sequence>
- <attribute name="name" type="NCName" use="required"/>
- <attribute name="overridable" type="sca:OverrideOptions" default="may" use="optional"/>
- <anyAttribute namespace="##any" processContents="lax"/>
- </complexType>
-
-
- <complexType name="ModuleWire">
- <sequence>
- <element minOccurs="1" maxOccurs="1" ref="sca:source.uri"/>
- <element minOccurs="1" maxOccurs="1" ref="sca:target.uri"/>
- <any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- <anyAttribute namespace="##any" processContents="lax"/>
- </complexType>
-
- <element name="source" type="anyType"/>
- <element name="target" type="anyType"/>
-
- <element name="source.uri" type="anyURI" substitutionGroup="sca:source"/>
- <element name="target.uri" type="anyURI" substitutionGroup="sca:target"/>
-
- <element name="subsystem" type="sca:Subsystem"/>
- <complexType name="Subsystem">
- <sequence>
- <element minOccurs="0" maxOccurs="unbounded" name="entryPoint" type="sca:EntryPoint"/>
- <element minOccurs="0" maxOccurs="unbounded" name="moduleComponent" type="sca:ModuleComponent"/>
- <element minOccurs="0" maxOccurs="unbounded" name="externalService" type="sca:ExternalService"/>
- <element minOccurs="0" maxOccurs="unbounded" name="wire" type="sca:SystemWire"/>
- <any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="name" type="NCName" use="required"/>
- <attribute name="uri" type="anyURI" use="optional"/>
- <anyAttribute namespace="##any" processContents="lax"/>
- </complexType>
-
- <complexType name="ModuleComponent">
- <sequence>
- <element minOccurs="0" maxOccurs="1" name="properties" type="sca:PropertyValues"/>
- <element minOccurs="0" maxOccurs="1" name="references" type="sca:ReferenceValues"/>
- <any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="name" type="NCName" use="required"/>
- <attribute name="module" type="NCName" use="required"/>
- <attribute name="uri" type="anyURI" use="optional"/>
- <anyAttribute namespace="##any" processContents="lax"/>
- </complexType>
-
- <complexType name="SystemWire">
- <sequence>
- <element minOccurs="1" maxOccurs="1" ref="sca:source"/>
- <element minOccurs="1" maxOccurs="1" ref="sca:target"/>
- <any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- </complexType>
-
- <element name="source.epr" type="anyType" substitutionGroup="sca:source"/>
- <element name="target.epr" type="anyType" substitutionGroup="sca:target"/>
-
- <simpleType name="Multiplicity">
- <restriction base="string">
- <enumeration value="0..1"/>
- <enumeration value="1..1"/>
- <enumeration value="0..n"/>
- <enumeration value="1..n"/>
- </restriction>
- </simpleType>
-
- <simpleType name="OverrideOptions">
- <restriction base="string">
- <enumeration value="no"/>
- <enumeration value="may"/>
- <enumeration value="must"/>
- </restriction>
- </simpleType>
-
-</schema>
diff --git a/tags/java/sca/0.91-rc2-incubating/modules/databinding-sdo/src/test/resources/model/sca-implementation-mock.xsd b/tags/java/sca/0.91-rc2-incubating/modules/databinding-sdo/src/test/resources/model/sca-implementation-mock.xsd
deleted file mode 100755
index bbaf58f00c..0000000000
--- a/tags/java/sca/0.91-rc2-incubating/modules/databinding-sdo/src/test/resources/model/sca-implementation-mock.xsd
+++ /dev/null
@@ -1,43 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * 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.
--->
-<schema xmlns="http://www.w3.org/2001/XMLSchema"
- targetNamespace="http://www.osoa.org/xmlns/mock/0.9"
- elementFormDefault="qualified"
- xmlns:mock="http://www.osoa.org/xmlns/mock/0.9"
- xmlns:sca="http://www.osoa.org/xmlns/sca/0.9">
-
- <import namespace="http://www.osoa.org/xmlns/sca/0.9"
- schemaLocation="sca-core.xsd" />
-
- <element name="implementation.mock" type="mock:MockImplementation"
- substitutionGroup="sca:implementation" />
- <complexType name="MockImplementation">
- <complexContent>
- <extension base="sca:Implementation">
- <sequence>
- <any namespace="##other" processContents="lax"
- minOccurs="0" maxOccurs="unbounded" />
- </sequence>
- <attribute name="myAttr" type="NCName" use="required" />
- <anyAttribute namespace="##any" processContents="lax" />
- </extension>
- </complexContent>
- </complexType>
-</schema>
diff --git a/tags/java/sca/0.91-rc2-incubating/modules/databinding-sdo/src/test/resources/stock.xsd b/tags/java/sca/0.91-rc2-incubating/modules/databinding-sdo/src/test/resources/stock.xsd
deleted file mode 100644
index a0a6717371..0000000000
--- a/tags/java/sca/0.91-rc2-incubating/modules/databinding-sdo/src/test/resources/stock.xsd
+++ /dev/null
@@ -1,33 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * 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.
--->
-<schema targetNamespace="http://www.example.com/stock" xmlns="http://www.w3.org/2001/XMLSchema">
- <!-- Faults -->
- <element name="InvalidSymbolFault">
- <complexType>
- <sequence>
- <element name="message" minOccurs="1" type="string" />
- <element name="symbol" minOccurs="1" type="string" />
- </sequence>
- </complexType>
- </element>
-
- <element name="MarketClosedFault" type="string" />
-
-</schema> \ No newline at end of file
diff --git a/tags/java/sca/0.91-rc2-incubating/modules/databinding-sdo/src/test/resources/wrapper.xml b/tags/java/sca/0.91-rc2-incubating/modules/databinding-sdo/src/test/resources/wrapper.xml
deleted file mode 100644
index 2526629409..0000000000
--- a/tags/java/sca/0.91-rc2-incubating/modules/databinding-sdo/src/test/resources/wrapper.xml
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * 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.
--->
-<p:op xmlns:p="http://www.example.com/wrapper" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.example.com/wrapper wrapper.xsd ">
- <message>message</message>
- <symbol>symbol</symbol>
- <message>message1</message>
- <symbol>symbol1</symbol>
- <symbol>symbol2</symbol>
-</p:op>
diff --git a/tags/java/sca/0.91-rc2-incubating/modules/databinding-sdo/src/test/resources/wrapper.xsd b/tags/java/sca/0.91-rc2-incubating/modules/databinding-sdo/src/test/resources/wrapper.xsd
deleted file mode 100644
index ea4dc5f7f3..0000000000
--- a/tags/java/sca/0.91-rc2-incubating/modules/databinding-sdo/src/test/resources/wrapper.xsd
+++ /dev/null
@@ -1,38 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * 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.
--->
-<schema targetNamespace="http://www.example.com/wrapper" xmlns="http://www.w3.org/2001/XMLSchema">
- <!-- Faults -->
- <element name="op">
- <complexType>
- <sequence maxOccurs="unbounded">
- <element name="message" minOccurs="1" type="string" />
- <element name="symbol" minOccurs="1" maxOccurs="3" type="string" />
- </sequence>
- </complexType>
- </element>
-
- <element name="opResponse">
- <complexType>
- <sequence maxOccurs="1">
- <element name="price" minOccurs="1" maxOccurs="unbounded" type="string" />
- </sequence>
- </complexType>
- </element>
-</schema> \ No newline at end of file