tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jsdelf...@apache.org
Subject svn commit: r526480 [4/4] - in /incubator/tuscany/java/sca/modules: ./ assembly-xml/src/main/java/org/apache/tuscany/assembly/xml/impl/ assembly/src/main/java/org/apache/tuscany/assembly/ assembly/src/main/java/org/apache/tuscany/assembly/impl/ assembl...
Date Sat, 07 Apr 2007 20:28:50 GMT
Added: incubator/tuscany/java/sca/modules/interface-wsdl/src/main/java/org/apache/tuscany/interfacedef/wsdl/impl/WSDLInterfaceImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/interface-wsdl/src/main/java/org/apache/tuscany/interfacedef/wsdl/impl/WSDLInterfaceImpl.java?view=auto&rev=526480
==============================================================================
--- incubator/tuscany/java/sca/modules/interface-wsdl/src/main/java/org/apache/tuscany/interfacedef/wsdl/impl/WSDLInterfaceImpl.java (added)
+++ incubator/tuscany/java/sca/modules/interface-wsdl/src/main/java/org/apache/tuscany/interfacedef/wsdl/impl/WSDLInterfaceImpl.java Sat Apr  7 13:28:42 2007
@@ -0,0 +1,78 @@
+/*
+ * 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.interfacedef.wsdl.impl;
+
+import javax.wsdl.PortType;
+import javax.xml.namespace.QName;
+
+import org.apache.tuscany.interfacedef.impl.InterfaceImpl;
+import org.apache.tuscany.interfacedef.wsdl.WSDLInterface;
+
+/**
+ * Represents a WSDL interface.
+ * 
+ * @version $Rev$ $Date$
+ */
+public class WSDLInterfaceImpl extends InterfaceImpl implements WSDLInterface {
+
+    private QName name;
+    private PortType portType;
+
+    public WSDLInterfaceImpl() {
+        setRemotable(true);
+    }
+
+    public QName getName() {
+        if (isUnresolved()) {
+            return name;
+        } else {
+            return portType.getQName();
+        }
+    }
+
+    public void setName(QName interfaceName) {
+        if (!isUnresolved()) {
+            throw new IllegalStateException();
+        }
+        this.name = interfaceName;
+    }
+
+    public PortType getPortType() {
+        return portType;
+    }
+
+    public void setPortType(PortType portType) {
+        this.portType = portType;
+    }
+
+    @Override
+    public int hashCode() {
+        return String.valueOf(name).hashCode();
+    }
+    
+    @Override
+    public boolean equals(Object obj) {
+        if (obj == this)
+            return true;
+        else if (obj instanceof WSDLInterface && name.equals(((WSDLInterface)obj).getName()))
+             return true;
+        else
+            return false;
+    }
+}

Propchange: incubator/tuscany/java/sca/modules/interface-wsdl/src/main/java/org/apache/tuscany/interfacedef/wsdl/impl/WSDLInterfaceImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/modules/interface-wsdl/src/main/java/org/apache/tuscany/interfacedef/wsdl/impl/WSDLInterfaceImpl.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/tuscany/java/sca/modules/interface/src/main/java/org/apache/tuscany/interfacedef/DataType.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/interface/src/main/java/org/apache/tuscany/interfacedef/DataType.java?view=auto&rev=526480
==============================================================================
--- incubator/tuscany/java/sca/modules/interface/src/main/java/org/apache/tuscany/interfacedef/DataType.java (added)
+++ incubator/tuscany/java/sca/modules/interface/src/main/java/org/apache/tuscany/interfacedef/DataType.java Sat Apr  7 13:28:42 2007
@@ -0,0 +1,89 @@
+/*
+ * 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.interfacedef;
+
+
+/**
+ * Representation of the type of data associated with an operation. Data is
+ * represented in two forms: the physical form used by the runtime and a logical
+ * form used by the assembly. The physical form is a Java Type because the
+ * runtime is written in Java. This may be the same form used by the application
+ * but it may not; for example, an application that is performing stream
+ * processing may want a physical form such as an
+ * {@link java.io.InputStream InputStream} to semantially operate on application
+ * data such as a purchase order. The logical description is that used by the
+ * assembly model and is an identifier into some well-known type space; examples
+ * may be a Java type represented by its Class or an XML type represented by its
+ * QName. Every data type may also contain metadata describing the expected
+ * data; for example, it could specify a preferred data binding technology or
+ * the size of a typical instance.
+ * 
+ * @version $Rev$ $Date$
+ */
+public interface DataType<L> extends Cloneable {
+    /**
+     * Set the java type for the data
+     * @param cls
+     */
+    void setPhysical(Class cls);
+
+    /**
+     * Returns the physical type used by the runtime.
+     * 
+     * @return the physical type used by the runtime
+     */
+    Class getPhysical();
+
+    /**
+     * Returns the logical identifier used by the assembly. The type of this
+     * value identifies the logical type system in use. Known values are:
+     * <ul>
+     * <li>a java.lang.reflect.Type identifies a Java type by name and
+     * ClassLoader; this includes Java Classes as they are specializations of
+     * Type</li>
+     * <li>a javax.xml.namespace.QName identifies an XML type by local name and
+     * namespace</li>
+     * </ul>
+     * 
+     * @return the logical type name
+     */
+    L getLogical();
+
+    /**
+     * @return
+     */
+    String getDataBinding();
+
+    /**
+     * @param dataBinding the dataBinding to set
+     */
+    void setDataBinding(String dataBinding);
+
+    /**
+     * @return
+     * @throws CloneNotSupportedException
+     */
+    Object clone() throws CloneNotSupportedException;
+
+    /**
+     * @param logical the logical to set
+     */
+    void setLogical(L logical);
+
+}

Propchange: incubator/tuscany/java/sca/modules/interface/src/main/java/org/apache/tuscany/interfacedef/DataType.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/modules/interface/src/main/java/org/apache/tuscany/interfacedef/DataType.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/tuscany/java/sca/modules/interface/src/main/java/org/apache/tuscany/interfacedef/Interface.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/interface/src/main/java/org/apache/tuscany/interfacedef/Interface.java?view=auto&rev=526480
==============================================================================
--- incubator/tuscany/java/sca/modules/interface/src/main/java/org/apache/tuscany/interfacedef/Interface.java (added)
+++ incubator/tuscany/java/sca/modules/interface/src/main/java/org/apache/tuscany/interfacedef/Interface.java Sat Apr  7 13:28:42 2007
@@ -0,0 +1,79 @@
+/*
+ * 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.interfacedef;
+
+import java.util.List;
+
+/**
+ * Represents a service interface. This interface will typically be extended to
+ * support concrete interface type systems, such as Java interfaces, WSDL 1.1
+ * portTypes and WSDL 2.0 interfaces.
+ */
+public interface Interface {
+
+    /**
+     * Returns true if the interface is a remotable interface..
+     * 
+     * @return true if the interface is a remotable interface
+     */
+    boolean isRemotable();
+
+    /**
+     * Sets whether the interface is a remotable or local interface.
+     * 
+     * @param remotable indicates whether the interface is remotable or local
+     */
+    void setRemotable(boolean remotable);
+    
+    
+    // FIXME: [rfeng] We need to re-consider the conversational as an intent
+    /**
+     * Test if the interface is conversational
+     * @return
+     */
+    boolean isConversational();
+    
+    /**
+     * Set whether the interface is conversational 
+     * @param conversational
+     */
+    void setConversational(boolean conversational);
+
+    /**
+     * Returns the operations defined on this interface.
+     * 
+     * @return the operations defined on this interface
+     */
+    List<Operation> getOperations();
+
+    /**
+     * Returns true if the model element is unresolved.
+     * 
+     * @return true if the model element is unresolved.
+     */
+    boolean isUnresolved();
+
+    /**
+     * Sets whether the model element is unresolved.
+     * 
+     * @param unresolved whether the model element is unresolved
+     */
+    void setUnresolved(boolean unresolved);
+
+}

Propchange: incubator/tuscany/java/sca/modules/interface/src/main/java/org/apache/tuscany/interfacedef/Interface.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/modules/interface/src/main/java/org/apache/tuscany/interfacedef/Interface.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/tuscany/java/sca/modules/interface/src/main/java/org/apache/tuscany/interfacedef/InvalidCallbackException.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/interface/src/main/java/org/apache/tuscany/interfacedef/InvalidCallbackException.java?view=auto&rev=526480
==============================================================================
--- incubator/tuscany/java/sca/modules/interface/src/main/java/org/apache/tuscany/interfacedef/InvalidCallbackException.java (added)
+++ incubator/tuscany/java/sca/modules/interface/src/main/java/org/apache/tuscany/interfacedef/InvalidCallbackException.java Sat Apr  7 13:28:42 2007
@@ -0,0 +1,34 @@
+/*
+ * 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.interfacedef;
+
+
+/**
+ * Denotes an illegal callback interface
+ *
+ * @version $Rev$ $Date$
+ */
+
+public class InvalidCallbackException extends InvalidInterfaceException {
+    private static final long serialVersionUID = 2727755895702116397L;
+
+    public InvalidCallbackException(String message) {
+        super(message);
+    }
+}

Propchange: incubator/tuscany/java/sca/modules/interface/src/main/java/org/apache/tuscany/interfacedef/InvalidCallbackException.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/modules/interface/src/main/java/org/apache/tuscany/interfacedef/InvalidCallbackException.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/tuscany/java/sca/modules/interface/src/main/java/org/apache/tuscany/interfacedef/InvalidInterfaceException.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/interface/src/main/java/org/apache/tuscany/interfacedef/InvalidInterfaceException.java?view=auto&rev=526480
==============================================================================
--- incubator/tuscany/java/sca/modules/interface/src/main/java/org/apache/tuscany/interfacedef/InvalidInterfaceException.java (added)
+++ incubator/tuscany/java/sca/modules/interface/src/main/java/org/apache/tuscany/interfacedef/InvalidInterfaceException.java Sat Apr  7 13:28:42 2007
@@ -0,0 +1,40 @@
+/*
+ * 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.interfacedef;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public abstract class InvalidInterfaceException extends Exception {
+
+    public InvalidInterfaceException() {
+    }
+
+    public InvalidInterfaceException(String message) {
+        super(message);
+    }
+
+    public InvalidInterfaceException(String message, Throwable cause) {
+        super(message, cause);
+    }
+
+    public InvalidInterfaceException(Throwable cause) {
+        super(cause);
+    }
+}

Propchange: incubator/tuscany/java/sca/modules/interface/src/main/java/org/apache/tuscany/interfacedef/InvalidInterfaceException.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/modules/interface/src/main/java/org/apache/tuscany/interfacedef/InvalidInterfaceException.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/tuscany/java/sca/modules/interface/src/main/java/org/apache/tuscany/interfacedef/InvalidOperationException.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/interface/src/main/java/org/apache/tuscany/interfacedef/InvalidOperationException.java?view=auto&rev=526480
==============================================================================
--- incubator/tuscany/java/sca/modules/interface/src/main/java/org/apache/tuscany/interfacedef/InvalidOperationException.java (added)
+++ incubator/tuscany/java/sca/modules/interface/src/main/java/org/apache/tuscany/interfacedef/InvalidOperationException.java Sat Apr  7 13:28:42 2007
@@ -0,0 +1,42 @@
+/*
+ * 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.interfacedef;
+
+import java.lang.reflect.Method;
+
+/**
+ * Denotes an invalid conversational interface definition
+ * 
+ * @version $Rev$ $Date$
+ */
+public class InvalidOperationException extends InvalidInterfaceException {
+
+    private static final long serialVersionUID = -1797615361821517091L;
+    private final Method operation;
+
+    public InvalidOperationException(String message, Method operation) {
+        super(message);
+        this.operation = operation;
+    }
+
+    public Method getOperation() {
+        return operation;
+    }
+
+}

Propchange: incubator/tuscany/java/sca/modules/interface/src/main/java/org/apache/tuscany/interfacedef/InvalidOperationException.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/modules/interface/src/main/java/org/apache/tuscany/interfacedef/InvalidOperationException.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/tuscany/java/sca/modules/interface/src/main/java/org/apache/tuscany/interfacedef/Operation.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/interface/src/main/java/org/apache/tuscany/interfacedef/Operation.java?view=auto&rev=526480
==============================================================================
--- incubator/tuscany/java/sca/modules/interface/src/main/java/org/apache/tuscany/interfacedef/Operation.java (added)
+++ incubator/tuscany/java/sca/modules/interface/src/main/java/org/apache/tuscany/interfacedef/Operation.java Sat Apr  7 13:28:42 2007
@@ -0,0 +1,122 @@
+/*
+ * 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.interfacedef;
+
+import java.util.List;
+
+/**
+ * Represents an operation on a service interface.
+ */
+public interface Operation {
+    enum ConversationSequence {
+        NO_CONVERSATION, CONVERSATION_CONTINUE, CONVERSATION_END
+    };
+
+    /**
+     * Returns the name of the operation.
+     * 
+     * @return the name of the operation
+     */
+    String getName();
+
+    /**
+     * Sets the name of the operation.
+     * 
+     * @param name the name of the operation
+     */
+    void setName(String name);
+
+    /**
+     * Returns true if the model element is unresolved.
+     * 
+     * @return true if the model element is unresolved.
+     */
+    boolean isUnresolved();
+
+    /**
+     * Sets whether the model element is unresolved.
+     * 
+     * @param unresolved whether the model element is unresolved
+     */
+    void setUnresolved(boolean unresolved);
+
+    /**
+     * Get the data type that represents the input of this operation. The logic
+     * type is a list of data types and each element represents a parameter
+     * 
+     * @return the inputType
+     */
+    DataType<List<DataType>> getInputType();
+    
+    /**
+     * @param inputType
+     */
+    void setInputType(DataType<List<DataType>> inputType);
+
+    /**
+     * Get the data type for the output
+     * 
+     * @return the outputType
+     */
+    DataType getOutputType();
+    
+    /**
+     * @param outputType
+     */
+    void setOutputType(DataType outputType);
+
+    /**
+     * Get a list of data types to represent the faults/exceptions
+     * 
+     * @return the faultTypes
+     */
+    List<DataType> getFaultTypes();
+    
+    /**
+     * @param faultTypes
+     */
+    void setFaultTypes(List<DataType> faultTypes);
+    
+    Interface getInterface();
+    void setInterface(Interface interfaze);
+    
+    /**
+     * Get the sequence of the conversation
+     * @return
+     */
+    ConversationSequence getConversationSequence();
+    
+    /**
+     * Set the sequence of conversation for the operation
+     * @param sequence
+     */
+    void setConversationSequence(ConversationSequence sequence);
+    
+    /**
+     * Indicate if the operation is non-blocking
+     * @return
+     */
+    boolean isNonBlocking();
+    
+    /**
+     * Set the operation to be non-blocking
+     */
+    void setNonBlocking(boolean nonBlocking);
+
+}

Propchange: incubator/tuscany/java/sca/modules/interface/src/main/java/org/apache/tuscany/interfacedef/Operation.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/modules/interface/src/main/java/org/apache/tuscany/interfacedef/Operation.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/tuscany/java/sca/modules/interface/src/main/java/org/apache/tuscany/interfacedef/OverloadedOperationException.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/interface/src/main/java/org/apache/tuscany/interfacedef/OverloadedOperationException.java?view=auto&rev=526480
==============================================================================
--- incubator/tuscany/java/sca/modules/interface/src/main/java/org/apache/tuscany/interfacedef/OverloadedOperationException.java (added)
+++ incubator/tuscany/java/sca/modules/interface/src/main/java/org/apache/tuscany/interfacedef/OverloadedOperationException.java Sat Apr  7 13:28:42 2007
@@ -0,0 +1,42 @@
+/*
+ * 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.interfacedef;
+
+import java.lang.reflect.Method;
+
+/**
+ * Exception thrown to indicate that a service contract specification contains
+ * an overloaded method.
+ * 
+ * @version $Rev$ $Date$
+ */
+public class OverloadedOperationException extends InvalidInterfaceException {
+    private static final long serialVersionUID = -4658711318608885638L;
+    private final Method operation;
+
+    public OverloadedOperationException(Method operation) {
+        super();
+        this.operation = operation;
+    }
+
+    public Method getOperation() {
+        return operation;
+    }
+
+}

Propchange: incubator/tuscany/java/sca/modules/interface/src/main/java/org/apache/tuscany/interfacedef/OverloadedOperationException.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/modules/interface/src/main/java/org/apache/tuscany/interfacedef/OverloadedOperationException.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/tuscany/java/sca/modules/interface/src/main/java/org/apache/tuscany/interfacedef/impl/DataTypeImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/interface/src/main/java/org/apache/tuscany/interfacedef/impl/DataTypeImpl.java?view=auto&rev=526480
==============================================================================
--- incubator/tuscany/java/sca/modules/interface/src/main/java/org/apache/tuscany/interfacedef/impl/DataTypeImpl.java (added)
+++ incubator/tuscany/java/sca/modules/interface/src/main/java/org/apache/tuscany/interfacedef/impl/DataTypeImpl.java Sat Apr  7 13:28:42 2007
@@ -0,0 +1,188 @@
+/*
+ * 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.interfacedef.impl;
+
+import org.apache.tuscany.interfacedef.DataType;
+
+/**
+ * Representation of the type of data associated with an operation. Data is
+ * represented in two forms: the physical form used by the runtime and a logical
+ * form used by the assembly. The physical form is a Java Type because the
+ * runtime is written in Java. This may be the same form used by the application
+ * but it may not; for example, an application that is performing stream
+ * processing may want a physical form such as an
+ * {@link java.io.InputStream InputStream} to semantially operate on application
+ * data such as a purchase order. The logical description is that used by the
+ * assembly model and is an identifier into some well-known type space; examples
+ * may be a Java type represented by its Class or an XML type represented by its
+ * QName. Every data type may also contain metadata describing the expected
+ * data; for example, it could specify a preferred data binding technology or
+ * the size of a typical instance.
+ * 
+ * @version $Rev$ $Date$
+ */
+public class DataTypeImpl<L> implements DataType<L> {
+    private boolean unresolved = true;
+    private String dataBinding;
+    private Class physical;
+    private L logical;
+
+    /**
+     * Construct a data type specifying the physical and logical types.
+     * 
+     * @param physical the physical class used by the runtime
+     * @param logical the logical type
+     * @see #getLogical()
+     */
+    public DataTypeImpl(Class physical, L logical) {
+        this.physical = physical;
+        this.logical = logical;
+    }
+
+    public DataTypeImpl(String dataBinding, Class physical, L logical) {
+        this.dataBinding = dataBinding;
+        this.physical = physical;
+        this.logical = logical;
+    }
+
+    /**
+     * Returns the physical type used by the runtime.
+     * 
+     * @return the physical type used by the runtime
+     */
+    public Class getPhysical() {
+        return physical;
+    }
+
+    /**
+     * Returns the logical identifier used by the assembly. The type of this
+     * value identifies the logical type system in use. Known values are:
+     * <ul>
+     * <li>a java.lang.reflect.Type identifies a Java type by name and
+     * ClassLoader; this includes Java Classes as they are specializations of
+     * Type</li>
+     * <li>a javax.xml.namespace.QName identifies an XML type by local name and
+     * namespace</li>
+     * </ul>
+     * 
+     * @return the logical type name
+     */
+    public L getLogical() {
+        return logical;
+    }
+
+    public String getDataBinding() {
+        return dataBinding;
+    }
+
+    /**
+     * @param dataBinding the dataBinding to set
+     */
+    public void setDataBinding(String dataBinding) {
+        this.dataBinding = dataBinding;
+    }
+
+    public String toString() {
+        StringBuffer sb = new StringBuffer();
+        sb.append(physical).append(" ").append(dataBinding).append(" ").append(logical);
+        return sb.toString();
+    }
+
+    @SuppressWarnings("unchecked")
+    @Override
+    public Object clone() throws CloneNotSupportedException {
+        DataTypeImpl copy = (DataTypeImpl)super.clone();
+        return copy;
+    }
+
+    /**
+     * @param logical the logical to set
+     */
+    public void setLogical(L logical) {
+        this.logical = logical;
+    }
+
+    @Override
+    public int hashCode() {
+        final int PRIME = 31;
+        int result = 1;
+        result = PRIME * result + ((dataBinding == null) ? 0 : dataBinding.hashCode());
+        result = PRIME * result + ((logical == null) ? 0 : logical.hashCode());
+        result = PRIME * result + ((physical == null) ? 0 : physical.hashCode());
+        return result;
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+        if (this == obj) {
+            return true;
+        }
+        if (obj == null) {
+            return false;
+        }
+        if (getClass() != obj.getClass()) {
+            return false;
+        }
+        final DataTypeImpl other = (DataTypeImpl)obj;
+        if (dataBinding == null) {
+            if (other.dataBinding != null) {
+                return false;
+            }
+        } else if (!dataBinding.equals(other.dataBinding)) {
+            return false;
+        }
+        if (logical == null) {
+            if (other.logical != null) {
+                return false;
+            }
+        } else if (!logical.equals(other.logical)) {
+            return false;
+        }
+        if (physical == null) {
+            if (other.physical != null) {
+                return false;
+            }
+        } else if (!physical.equals(other.physical)) {
+            return false;
+        }
+        return true;
+    }
+
+    /**
+     * @return the unresolved
+     */
+    public boolean isUnresolved() {
+        return unresolved;
+    }
+
+    /**
+     * @param unresolved the unresolved to set
+     */
+    public void setUnresolved(boolean unresolved) {
+        this.unresolved = unresolved;
+    }
+
+    /**
+     * @param physical the physical to set
+     */
+    public void setPhysical(Class physical) {
+        this.physical = physical;
+    }
+
+}

Propchange: incubator/tuscany/java/sca/modules/interface/src/main/java/org/apache/tuscany/interfacedef/impl/DataTypeImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/modules/interface/src/main/java/org/apache/tuscany/interfacedef/impl/DataTypeImpl.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/tuscany/java/sca/modules/interface/src/main/java/org/apache/tuscany/interfacedef/impl/InterfaceImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/interface/src/main/java/org/apache/tuscany/interfacedef/impl/InterfaceImpl.java?view=auto&rev=526480
==============================================================================
--- incubator/tuscany/java/sca/modules/interface/src/main/java/org/apache/tuscany/interfacedef/impl/InterfaceImpl.java (added)
+++ incubator/tuscany/java/sca/modules/interface/src/main/java/org/apache/tuscany/interfacedef/impl/InterfaceImpl.java Sat Apr  7 13:28:42 2007
@@ -0,0 +1,73 @@
+/*
+ * 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.interfacedef.impl;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.tuscany.interfacedef.Interface;
+import org.apache.tuscany.interfacedef.Operation;
+
+/**
+ * Represents a service interface.
+ * 
+ * @version $Rev$ $Date$
+ */
+public class InterfaceImpl implements Interface {
+
+    private boolean remotable;
+    private boolean conversational;
+    private List<Operation> operations = new ArrayList<Operation>();
+    private boolean unresolved;
+
+    public boolean isRemotable() {
+        return remotable;
+    }
+
+    public void setRemotable(boolean local) {
+        this.remotable = local;
+    }
+
+    public List<Operation> getOperations() {
+        return operations;
+    }
+
+    public boolean isUnresolved() {
+        return unresolved;
+    }
+
+    public void setUnresolved(boolean undefined) {
+        this.unresolved = undefined;
+    }
+
+    /**
+     * @return the conversational
+     */
+    public boolean isConversational() {
+        return conversational;
+    }
+
+    /**
+     * @param conversational the conversational to set
+     */
+    public void setConversational(boolean conversational) {
+        this.conversational = conversational;
+    }
+
+}

Propchange: incubator/tuscany/java/sca/modules/interface/src/main/java/org/apache/tuscany/interfacedef/impl/InterfaceImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/modules/interface/src/main/java/org/apache/tuscany/interfacedef/impl/InterfaceImpl.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/tuscany/java/sca/modules/interface/src/main/java/org/apache/tuscany/interfacedef/impl/OperationImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/interface/src/main/java/org/apache/tuscany/interfacedef/impl/OperationImpl.java?view=auto&rev=526480
==============================================================================
--- incubator/tuscany/java/sca/modules/interface/src/main/java/org/apache/tuscany/interfacedef/impl/OperationImpl.java (added)
+++ incubator/tuscany/java/sca/modules/interface/src/main/java/org/apache/tuscany/interfacedef/impl/OperationImpl.java Sat Apr  7 13:28:42 2007
@@ -0,0 +1,232 @@
+/*
+ * 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.interfacedef.impl;
+
+import java.util.List;
+
+import org.apache.tuscany.interfacedef.DataType;
+import org.apache.tuscany.interfacedef.Interface;
+import org.apache.tuscany.interfacedef.Operation;
+
+/**
+ * Represents an operation on a service interface.
+ * 
+ * @version $Rev$ $Date$
+ */
+public class OperationImpl implements Operation {
+
+    private String name;
+    private boolean unresolved;
+    private DataType outputType;
+    private DataType<List<DataType>> inputType;
+    private List<DataType> faultTypes;
+    private Interface interfaze;
+    private ConversationSequence conversationSequence = ConversationSequence.NO_CONVERSATION;
+    private boolean nonBlocking;
+
+    /**
+     * @param name
+     */
+    public OperationImpl() {
+        super();
+    }
+
+    /**
+     * @param name
+     */
+    public OperationImpl(String name) {
+        super();
+        this.name = name;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public boolean isUnresolved() {
+        return unresolved;
+    }
+
+    public void setUnresolved(boolean undefined) {
+        this.unresolved = undefined;
+    }
+
+    /**
+     * @return the faultTypes
+     */
+    public List<DataType> getFaultTypes() {
+        return faultTypes;
+    }
+
+    /**
+     * @param faultTypes the faultTypes to set
+     */
+    public void setFaultTypes(List<DataType> faultTypes) {
+        this.faultTypes = faultTypes;
+    }
+
+    /**
+     * @return the inputType
+     */
+    public DataType<List<DataType>> getInputType() {
+        return inputType;
+    }
+
+    /**
+     * @param inputType the inputType to set
+     */
+    public void setInputType(DataType<List<DataType>> inputType) {
+        this.inputType = inputType;
+    }
+
+    /**
+     * @return the outputType
+     */
+    public DataType getOutputType() {
+        return outputType;
+    }
+
+    /**
+     * @param outputType the outputType to set
+     */
+    public void setOutputType(DataType outputType) {
+        this.outputType = outputType;
+    }
+
+    /**
+     * @return the interfaze
+     */
+    public Interface getInterface() {
+        return interfaze;
+    }
+
+    /**
+     * @param interfaze the interfaze to set
+     */
+    public void setInterface(Interface interfaze) {
+        this.interfaze = interfaze;
+    }
+
+    /**
+     * @return the conversationSequence
+     */
+    public ConversationSequence getConversationSequence() {
+        return conversationSequence;
+    }
+
+    /**
+     * @param conversationSequence the conversationSequence to set
+     */
+    public void setConversationSequence(ConversationSequence conversationSequence) {
+        this.conversationSequence = conversationSequence;
+    }
+
+    /**
+     * @return the nonBlocking
+     */
+    public boolean isNonBlocking() {
+        return nonBlocking;
+    }
+
+    /**
+     * @param nonBlocking the nonBlocking to set
+     */
+    public void setNonBlocking(boolean nonBlocking) {
+        this.nonBlocking = nonBlocking;
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see java.lang.Object#hashCode()
+     */
+    @Override
+    public int hashCode() {
+        final int PRIME = 31;
+        int result = 1;
+        result = PRIME * result + ((conversationSequence == null) ? 0 : conversationSequence.hashCode());
+        // result = PRIME * result + ((faultTypes == null) ? 0 : faultTypes.hashCode());
+        result = PRIME * result + ((inputType == null) ? 0 : inputType.hashCode());
+        result = PRIME * result + ((name == null) ? 0 : name.hashCode());
+        result = PRIME * result + (nonBlocking ? 1231 : 1237);
+        result = PRIME * result + ((outputType == null) ? 0 : outputType.hashCode());
+        return result;
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+        if (this == obj) {
+            return true;
+        }
+        if (obj == null) {
+            return false;
+        }
+        if (getClass() != obj.getClass()) {
+            return false;
+        }
+        final OperationImpl other = (OperationImpl)obj;
+        if (conversationSequence == null) {
+            if (other.conversationSequence != null) {
+                return false;
+            }
+        } else if (!conversationSequence.equals(other.conversationSequence)) {
+            return false;
+        }
+        /*
+        if (faultTypes == null) {
+            if (other.faultTypes != null) {
+                return false;
+            }
+        } else if (!faultTypes.equals(other.faultTypes)) {
+            return false;
+        }
+        */
+        
+        if (inputType == null) {
+            if (other.inputType != null) {
+                return false;
+            }
+        } else if (!inputType.equals(other.inputType)) {
+            return false;
+        }
+        if (name == null) {
+            if (other.name != null) {
+                return false;
+            }
+        } else if (!name.equals(other.name)) {
+            return false;
+        }
+        if (nonBlocking != other.nonBlocking) {
+            return false;
+        }
+        if (outputType == null) {
+            if (other.outputType != null) {
+                return false;
+            }
+        } else if (!outputType.equals(other.outputType)) {
+            return false;
+        }
+        return true;
+    }
+
+}

Propchange: incubator/tuscany/java/sca/modules/interface/src/main/java/org/apache/tuscany/interfacedef/impl/OperationImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/modules/interface/src/main/java/org/apache/tuscany/interfacedef/impl/OperationImpl.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/tuscany/java/sca/modules/interface/src/main/java/org/apache/tuscany/interfacedef/util/ElementInfo.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/interface/src/main/java/org/apache/tuscany/interfacedef/util/ElementInfo.java?view=auto&rev=526480
==============================================================================
--- incubator/tuscany/java/sca/modules/interface/src/main/java/org/apache/tuscany/interfacedef/util/ElementInfo.java (added)
+++ incubator/tuscany/java/sca/modules/interface/src/main/java/org/apache/tuscany/interfacedef/util/ElementInfo.java Sat Apr  7 13:28:42 2007
@@ -0,0 +1,60 @@
+/*
+ * 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.interfacedef.util;
+
+import javax.xml.namespace.QName;
+
+/**
+ * An abstraction of XML schema elements
+ */
+public class ElementInfo {
+    private final QName name;
+    private final TypeInfo type;
+
+    /**
+     * @param name
+     * @param type
+     */
+    public ElementInfo(QName name, TypeInfo type) {
+        super();
+        this.name = name;
+        this.type = type;
+    }
+
+    /**
+     * @return the name
+     */
+    public QName getQName() {
+        return name;
+    }
+
+    /**
+     * @return the type
+     */
+    public TypeInfo getType() {
+        return type;
+    }
+
+    public String toString() {
+        StringBuffer sb = new StringBuffer();
+        sb.append("Element: ").append(name).append(" ").append(type);
+        return sb.toString();
+    }
+}

Propchange: incubator/tuscany/java/sca/modules/interface/src/main/java/org/apache/tuscany/interfacedef/util/ElementInfo.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/modules/interface/src/main/java/org/apache/tuscany/interfacedef/util/ElementInfo.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/tuscany/java/sca/modules/interface/src/main/java/org/apache/tuscany/interfacedef/util/FaultException.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/interface/src/main/java/org/apache/tuscany/interfacedef/util/FaultException.java?view=auto&rev=526480
==============================================================================
--- incubator/tuscany/java/sca/modules/interface/src/main/java/org/apache/tuscany/interfacedef/util/FaultException.java (added)
+++ incubator/tuscany/java/sca/modules/interface/src/main/java/org/apache/tuscany/interfacedef/util/FaultException.java Sat Apr  7 13:28:42 2007
@@ -0,0 +1,82 @@
+/*
+ * 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.interfacedef.util;
+
+import javax.xml.namespace.QName;
+
+/**
+ * The generic java exception to wrap service faults
+ * 
+ * @version $Rev$ $Date$
+ */
+public class FaultException extends Exception {
+    private static final long serialVersionUID = -8002583655240625792L;
+    private Object faultInfo;
+    private QName logical;
+
+    /**
+     * @param message
+     * @param faultInfo
+     */
+    public FaultException(String message, Object faultInfo) {
+        super(message);
+        this.faultInfo = faultInfo;
+    }
+
+    /**
+     * @param message
+     * @param faultInfo
+     * @param cause
+     */
+    public FaultException(String message, Object faultInfo, Throwable cause) {
+        super(message, cause);
+        this.faultInfo = faultInfo;
+    }
+
+    /**
+     * @return the faultInfo
+     */
+    public Object getFaultInfo() {
+        return faultInfo;
+    }
+
+    public QName getLogical() {
+        return logical;
+    }
+
+    public void setLogical(QName logical) {
+        this.logical = logical;
+    }
+
+    public boolean isMatchingType(Object type) {
+        if (logical == null) {
+            return false;
+        }
+
+        if ((type instanceof QName) && logical.equals(type)) {
+            return true;
+        }
+        if (type instanceof XMLType && logical.equals(((XMLType)type).getElementName())) {
+            return true;
+        }
+        return false;
+    }
+
+}

Propchange: incubator/tuscany/java/sca/modules/interface/src/main/java/org/apache/tuscany/interfacedef/util/FaultException.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/modules/interface/src/main/java/org/apache/tuscany/interfacedef/util/FaultException.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/tuscany/java/sca/modules/interface/src/main/java/org/apache/tuscany/interfacedef/util/JavaXMLMapper.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/interface/src/main/java/org/apache/tuscany/interfacedef/util/JavaXMLMapper.java?view=auto&rev=526480
==============================================================================
--- incubator/tuscany/java/sca/modules/interface/src/main/java/org/apache/tuscany/interfacedef/util/JavaXMLMapper.java (added)
+++ incubator/tuscany/java/sca/modules/interface/src/main/java/org/apache/tuscany/interfacedef/util/JavaXMLMapper.java Sat Apr  7 13:28:42 2007
@@ -0,0 +1,115 @@
+/*
+ * 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.interfacedef.util;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.xml.namespace.QName;
+
+public final class JavaXMLMapper {
+    public static final String URI_2001_SCHEMA_XSD = "http://www.w3.org/2001/XMLSchema";
+    private static final Map<Class, QName> JAVA2XML = new HashMap<Class, QName>();
+    private static final Map<String, Class> XML2JAVA = new HashMap<String, Class>();
+
+    private JavaXMLMapper() {
+    }
+
+    static {
+        JAVA2XML.put(boolean.class, getTypeName("boolean"));
+        JAVA2XML.put(byte.class, getTypeName("byte"));
+        JAVA2XML.put(short.class, getTypeName("short"));
+        JAVA2XML.put(int.class, getTypeName("int"));
+        JAVA2XML.put(long.class, getTypeName("long"));
+        JAVA2XML.put(float.class, getTypeName("float"));
+        JAVA2XML.put(double.class, getTypeName("double"));
+        JAVA2XML.put(Boolean.class, getTypeName("boolean"));
+        JAVA2XML.put(Byte.class, getTypeName("byte"));
+        JAVA2XML.put(Short.class, getTypeName("short"));
+        JAVA2XML.put(Integer.class, getTypeName("int"));
+        JAVA2XML.put(Long.class, getTypeName("long"));
+        JAVA2XML.put(Float.class, getTypeName("float"));
+        JAVA2XML.put(Double.class, getTypeName("double"));
+        JAVA2XML.put(java.lang.String.class, getTypeName("string"));
+        JAVA2XML.put(java.math.BigInteger.class, getTypeName("integer"));
+        JAVA2XML.put(java.math.BigDecimal.class, getTypeName("decimal"));
+        JAVA2XML.put(java.util.Calendar.class, getTypeName("dateTime"));
+        JAVA2XML.put(java.util.Date.class, getTypeName("dateTime"));
+        JAVA2XML.put(javax.xml.namespace.QName.class, getTypeName("QName"));
+        JAVA2XML.put(java.net.URI.class, getTypeName("string"));
+        JAVA2XML.put(javax.xml.datatype.XMLGregorianCalendar.class, getTypeName("anySimpleType"));
+        JAVA2XML.put(javax.xml.datatype.Duration.class, getTypeName("duration"));
+        JAVA2XML.put(java.lang.Object.class, getTypeName("anyType"));
+        JAVA2XML.put(java.awt.Image.class, getTypeName("base64Binary"));
+        JAVA2XML.put(byte[].class, getTypeName("base64Binary"));
+        // java2XSD.put(javax.activation.DataHandler.class, getTypeName("base64Binary"));
+        JAVA2XML.put(javax.xml.transform.Source.class, getTypeName("base64Binary"));
+        JAVA2XML.put(java.util.UUID.class, getTypeName("string"));
+    }
+
+    static {
+        XML2JAVA.put("string", java.lang.String.class);
+        XML2JAVA.put("integer", java.math.BigInteger.class);
+        XML2JAVA.put("int", int.class);
+        XML2JAVA.put("long", long.class);
+        XML2JAVA.put("short", short.class);
+        XML2JAVA.put("decimal", java.math.BigDecimal.class);
+        XML2JAVA.put("float", float.class);
+        XML2JAVA.put("double", double.class);
+        XML2JAVA.put("boolean", boolean.class);
+        XML2JAVA.put("byte", byte.class);
+        XML2JAVA.put("QName", javax.xml.namespace.QName.class);
+        XML2JAVA.put("dateTime", javax.xml.datatype.XMLGregorianCalendar.class);
+        XML2JAVA.put("base64Binary", byte[].class);
+        XML2JAVA.put("hexBinary", byte[].class);
+        XML2JAVA.put("unsignedInt", long.class);
+        XML2JAVA.put("unsignedShort", int.class);
+        XML2JAVA.put("unsignedByte", short.class);
+        XML2JAVA.put("time", javax.xml.datatype.XMLGregorianCalendar.class);
+        XML2JAVA.put("date", javax.xml.datatype.XMLGregorianCalendar.class);
+        XML2JAVA.put("gDay", javax.xml.datatype.XMLGregorianCalendar.class);
+        XML2JAVA.put("gMonth", javax.xml.datatype.XMLGregorianCalendar.class);
+        XML2JAVA.put("gYear", javax.xml.datatype.XMLGregorianCalendar.class);
+        XML2JAVA.put("gYearMonth", javax.xml.datatype.XMLGregorianCalendar.class);
+        XML2JAVA.put("gMonthDay", javax.xml.datatype.XMLGregorianCalendar.class);
+        XML2JAVA.put("anySimpleType", java.lang.Object.class); // For elements
+        // XML2JAVA.put("anySimpleType", java.lang.String.class); // For
+        // attributes
+        XML2JAVA.put("duration", javax.xml.datatype.Duration.class);
+        XML2JAVA.put("NOTATION", javax.xml.namespace.QName.class);
+    }
+
+    public static Class getJavaType(QName xmlType) {
+        if (URI_2001_SCHEMA_XSD.equals(xmlType.getNamespaceURI())) {
+            return XML2JAVA.get(xmlType.getLocalPart());
+        } else {
+            return null;
+        }
+    }
+
+    private static QName getTypeName(String name) {
+        return new QName(URI_2001_SCHEMA_XSD, name);
+    }
+
+    public static QName getXMLType(Class javaType) {
+        return JAVA2XML.get(javaType);
+    }
+
+}

Propchange: incubator/tuscany/java/sca/modules/interface/src/main/java/org/apache/tuscany/interfacedef/util/JavaXMLMapper.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/modules/interface/src/main/java/org/apache/tuscany/interfacedef/util/JavaXMLMapper.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/tuscany/java/sca/modules/interface/src/main/java/org/apache/tuscany/interfacedef/util/TypeInfo.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/interface/src/main/java/org/apache/tuscany/interfacedef/util/TypeInfo.java?view=auto&rev=526480
==============================================================================
--- incubator/tuscany/java/sca/modules/interface/src/main/java/org/apache/tuscany/interfacedef/util/TypeInfo.java (added)
+++ incubator/tuscany/java/sca/modules/interface/src/main/java/org/apache/tuscany/interfacedef/util/TypeInfo.java Sat Apr  7 13:28:42 2007
@@ -0,0 +1,72 @@
+/*
+ * 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.interfacedef.util;
+
+import javax.xml.namespace.QName;
+
+/**
+ * An abstraction of XML schema types
+ */
+public class TypeInfo {
+    private QName name;
+
+    private boolean isSimpleType;
+
+    private TypeInfo baseType;
+
+    /**
+     * @param name
+     * @param isSimpleType
+     */
+    public TypeInfo(QName name, boolean isSimpleType, TypeInfo baseType) {
+        super();
+        this.name = name;
+        this.isSimpleType = isSimpleType;
+        this.baseType = baseType;
+    }
+
+    /**
+     * @return the isSimpleType
+     */
+    public boolean isSimpleType() {
+        return isSimpleType;
+    }
+
+    /**
+     * @return the name
+     */
+    public QName getQName() {
+        return name;
+    }
+
+    /**
+     * @return the baseType
+     */
+    public TypeInfo getBaseType() {
+        return baseType;
+    }
+
+    public String toString() {
+        StringBuffer sb = new StringBuffer();
+        sb.append("Type: ").append(name);
+        return sb.toString();
+    }
+
+}

Propchange: incubator/tuscany/java/sca/modules/interface/src/main/java/org/apache/tuscany/interfacedef/util/TypeInfo.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/modules/interface/src/main/java/org/apache/tuscany/interfacedef/util/TypeInfo.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/tuscany/java/sca/modules/interface/src/main/java/org/apache/tuscany/interfacedef/util/WrapperInfo.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/interface/src/main/java/org/apache/tuscany/interfacedef/util/WrapperInfo.java?view=auto&rev=526480
==============================================================================
--- incubator/tuscany/java/sca/modules/interface/src/main/java/org/apache/tuscany/interfacedef/util/WrapperInfo.java (added)
+++ incubator/tuscany/java/sca/modules/interface/src/main/java/org/apache/tuscany/interfacedef/util/WrapperInfo.java Sat Apr  7 13:28:42 2007
@@ -0,0 +1,140 @@
+/*
+ * 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.interfacedef.util;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.tuscany.interfacedef.DataType;
+import org.apache.tuscany.interfacedef.impl.DataTypeImpl;
+
+/**
+ * The "Wrapper Style" WSDL operation is defined by The Java API for XML-Based
+ * Web Services (JAX-WS) 2.0 specification, section 2.3.1.2 Wrapper Style. <p/>
+ * A WSDL operation qualifies for wrapper style mapping only if the following
+ * criteria are met:
+ * <ul>
+ * <li>(i) The operation�s input and output messages (if present) each contain
+ * only a single part
+ * <li>(ii) The input message part refers to a global element declaration whose
+ * localname is equal to the operation name
+ * <li>(iii) The output message part refers to a global element declaration
+ * <li>(iv) The elements referred to by the input and output message parts
+ * (henceforth referred to as wrapper elements) are both complex types defined
+ * using the xsd:sequence compositor
+ * <li>(v) The wrapper elements only contain child elements, they must not
+ * contain other structures such as wildcards (element or attribute),
+ * xsd:choice, substitution groups (element references are not permitted) or
+ * attributes; furthermore, they must not be nillable.
+ * </ul>
+ * 
+ * @version $Rev$ $Date$
+ */
+public class WrapperInfo {
+    private ElementInfo inputWrapperElement;
+
+    private ElementInfo outputWrapperElement;
+
+    private List<ElementInfo> inputChildElements;
+
+    private List<ElementInfo> outputChildElements;
+
+    private DataType<List<DataType<XMLType>>> unwrappedInputType;
+
+    private DataType<XMLType> unwrappedOutputType;
+
+    private String dataBinding;
+
+    public WrapperInfo(String dataBinding,
+                       ElementInfo inputWrapperElement,
+                       ElementInfo outputWrapperElement,
+                       List<ElementInfo> inputElements,
+                       List<ElementInfo> outputElements) {
+        super();
+        this.dataBinding = dataBinding;
+        this.inputWrapperElement = inputWrapperElement;
+        this.outputWrapperElement = outputWrapperElement;
+        this.inputChildElements = inputElements;
+        this.outputChildElements = outputElements;
+    }
+
+    /**
+     * @return the inputElements
+     */
+    public List<ElementInfo> getInputChildElements() {
+        return inputChildElements;
+    }
+
+    /**
+     * @return the inputWrapperElement
+     */
+    public ElementInfo getInputWrapperElement() {
+        return inputWrapperElement;
+    }
+
+    /**
+     * @return the outputElements
+     */
+    public List<ElementInfo> getOutputChildElements() {
+        return outputChildElements;
+    }
+
+    /**
+     * @return the outputWrapperElement
+     */
+    public ElementInfo getOutputWrapperElement() {
+        return outputWrapperElement;
+    }
+
+    /**
+     * @return the unwrappedInputType
+     */
+    public DataType<List<DataType<XMLType>>> getUnwrappedInputType() {
+        if (unwrappedInputType == null) {
+            List<DataType<XMLType>> childTypes = new ArrayList<DataType<XMLType>>();
+            for (ElementInfo element : getInputChildElements()) {
+                DataType<XMLType> type = new DataTypeImpl<XMLType>(dataBinding, Object.class, new XMLType(element));
+                childTypes.add(type);
+            }
+            unwrappedInputType = new DataTypeImpl<List<DataType<XMLType>>>("idl:unwrapped.input", Object[].class,
+                                                                           childTypes);
+        }
+        return unwrappedInputType;
+    }
+
+    /**
+     * @return the unwrappedOutputType
+     */
+    public DataType<XMLType> getUnwrappedOutputType() {
+        if (unwrappedOutputType == null) {
+            List<ElementInfo> elements = getOutputChildElements();
+            if (elements != null && elements.size() > 0) {
+                if (elements.size() > 1) {
+                    // We don't support output with multiple parts
+                    throw new IllegalArgumentException("Multi-part output is not supported");
+                }
+                ElementInfo element = elements.get(0);
+
+                unwrappedOutputType = new DataTypeImpl<XMLType>(dataBinding, Object.class, new XMLType(element));
+            }
+        }
+        return unwrappedOutputType;
+    }
+}

Propchange: incubator/tuscany/java/sca/modules/interface/src/main/java/org/apache/tuscany/interfacedef/util/WrapperInfo.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/modules/interface/src/main/java/org/apache/tuscany/interfacedef/util/WrapperInfo.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/tuscany/java/sca/modules/interface/src/main/java/org/apache/tuscany/interfacedef/util/XMLType.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/interface/src/main/java/org/apache/tuscany/interfacedef/util/XMLType.java?view=auto&rev=526480
==============================================================================
--- incubator/tuscany/java/sca/modules/interface/src/main/java/org/apache/tuscany/interfacedef/util/XMLType.java (added)
+++ incubator/tuscany/java/sca/modules/interface/src/main/java/org/apache/tuscany/interfacedef/util/XMLType.java Sat Apr  7 13:28:42 2007
@@ -0,0 +1,124 @@
+/*
+ * 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.interfacedef.util;
+
+import javax.xml.namespace.QName;
+
+/**
+ * The metadata for an XML element or type
+ */
+public class XMLType {
+    public static final XMLType UNKNOWN = new XMLType(null, null);
+    protected QName element;
+    protected QName type;
+
+    /**
+     * @param element
+     */
+    public XMLType(ElementInfo element) {
+        super();
+        this.element = element.getQName();
+        if (element.getType() != null) {
+            this.type = element.getType().getQName();
+        }
+    }
+
+    /**
+     * @param element
+     */
+    public XMLType(TypeInfo type) {
+        this.element = null;
+        this.type = type.getQName();
+    }
+
+    public XMLType(QName element, QName type) {
+        this.element = element;
+        this.type = type;
+    }
+
+    /**
+     * @return the type
+     */
+    public QName getTypeName() {
+        return type;
+    }
+
+    public boolean isElement() {
+        return element != null;
+    }
+
+    public QName getElementName() {
+        return element;
+    }
+
+    public static XMLType getType(QName type) {
+        return new XMLType(null, type);
+    }
+
+    /**
+     * @see java.lang.Object#hashCode()
+     */
+    @Override
+    public int hashCode() {
+        final int PRIME = 31;
+        int result = 1;
+        result = PRIME * result + ((element == null) ? 0 : element.hashCode());
+        result = PRIME * result + ((type == null) ? 0 : type.hashCode());
+        return result;
+    }
+
+    /**
+     * @see java.lang.Object#equals(java.lang.Object)
+     */
+    @Override
+    public boolean equals(Object obj) {
+        if (this == obj) {
+            return true;
+        }
+        if (obj == null) {
+            return false;
+        }
+        if (getClass() != obj.getClass()) {
+            return false;
+        }
+        final XMLType other = (XMLType)obj;
+        if (element == null) {
+            if (other.element != null) {
+                return false;
+            }
+        } else if (!element.equals(other.element)) {
+            return false;
+        }
+        if (type == null) {
+            if (other.type != null) {
+                return false;
+            }
+        } else if (!type.equals(other.type)) {
+            return false;
+        }
+        return true;
+    }
+
+    @Override
+    public String toString() {
+        return "Element: " + element + " Type: " + type;
+    }
+
+}

Propchange: incubator/tuscany/java/sca/modules/interface/src/main/java/org/apache/tuscany/interfacedef/util/XMLType.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/modules/interface/src/main/java/org/apache/tuscany/interfacedef/util/XMLType.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: incubator/tuscany/java/sca/modules/policy/src/main/java/org/apache/tuscany/policy/Intent.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/policy/src/main/java/org/apache/tuscany/policy/Intent.java?view=diff&rev=526480&r1=526479&r2=526480
==============================================================================
--- incubator/tuscany/java/sca/modules/policy/src/main/java/org/apache/tuscany/policy/Intent.java (original)
+++ incubator/tuscany/java/sca/modules/policy/src/main/java/org/apache/tuscany/policy/Intent.java Sat Apr  7 13:28:42 2007
@@ -22,7 +22,7 @@
 
 import javax.xml.namespace.QName;
 
-import org.apache.tuscany.idl.Operation;
+import org.apache.tuscany.interfacedef.Operation;
 
 /**
  * Represents a policy intent. See the Policy Framework specification for a

Modified: incubator/tuscany/java/sca/modules/policy/src/main/java/org/apache/tuscany/policy/PolicySet.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/policy/src/main/java/org/apache/tuscany/policy/PolicySet.java?view=diff&rev=526480&r1=526479&r2=526480
==============================================================================
--- incubator/tuscany/java/sca/modules/policy/src/main/java/org/apache/tuscany/policy/PolicySet.java (original)
+++ incubator/tuscany/java/sca/modules/policy/src/main/java/org/apache/tuscany/policy/PolicySet.java Sat Apr  7 13:28:42 2007
@@ -22,7 +22,7 @@
 
 import javax.xml.namespace.QName;
 
-import org.apache.tuscany.idl.Operation;
+import org.apache.tuscany.interfacedef.Operation;
 
 /**
  * Represents a policy set. See the Policy Framework specification for a

Modified: incubator/tuscany/java/sca/modules/policy/src/main/java/org/apache/tuscany/policy/impl/IntentImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/policy/src/main/java/org/apache/tuscany/policy/impl/IntentImpl.java?view=diff&rev=526480&r1=526479&r2=526480
==============================================================================
--- incubator/tuscany/java/sca/modules/policy/src/main/java/org/apache/tuscany/policy/impl/IntentImpl.java (original)
+++ incubator/tuscany/java/sca/modules/policy/src/main/java/org/apache/tuscany/policy/impl/IntentImpl.java Sat Apr  7 13:28:42 2007
@@ -23,7 +23,7 @@
 
 import javax.xml.namespace.QName;
 
-import org.apache.tuscany.idl.Operation;
+import org.apache.tuscany.interfacedef.Operation;
 import org.apache.tuscany.policy.Intent;
 
 /**

Modified: incubator/tuscany/java/sca/modules/policy/src/main/java/org/apache/tuscany/policy/impl/PolicySetImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/policy/src/main/java/org/apache/tuscany/policy/impl/PolicySetImpl.java?view=diff&rev=526480&r1=526479&r2=526480
==============================================================================
--- incubator/tuscany/java/sca/modules/policy/src/main/java/org/apache/tuscany/policy/impl/PolicySetImpl.java (original)
+++ incubator/tuscany/java/sca/modules/policy/src/main/java/org/apache/tuscany/policy/impl/PolicySetImpl.java Sat Apr  7 13:28:42 2007
@@ -23,7 +23,7 @@
 
 import javax.xml.namespace.QName;
 
-import org.apache.tuscany.idl.Operation;
+import org.apache.tuscany.interfacedef.Operation;
 import org.apache.tuscany.policy.Intent;
 import org.apache.tuscany.policy.PolicySet;
 

Modified: incubator/tuscany/java/sca/modules/pom.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/pom.xml?view=diff&rev=526480&r1=526479&r2=526480
==============================================================================
--- incubator/tuscany/java/sca/modules/pom.xml (original)
+++ incubator/tuscany/java/sca/modules/pom.xml Sat Apr  7 13:28:42 2007
@@ -71,6 +71,7 @@
                 <module>implementation-java</module>
                 <module>implementation-java-xml</module>
                 <!--
+                <module>implementation-java-runtime</module>
                 <module>implementation-script</module>
                 <module>implementation-spring</module>
                 -->



---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org


Mime
View raw message