You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by js...@apache.org on 2007/03/23 16:57:09 UTC

svn commit: r521781 [3/3] - in /incubator/tuscany/sandbox/sebastien/java/sca/modules: ./ assembly/ assembly/src/main/java/org/apache/tuscany/assembly/model/ assembly/src/main/java/org/apache/tuscany/assembly/model/impl/ assembly/src/main/java/org/apach...

Added: incubator/tuscany/sandbox/sebastien/java/sca/modules/scdl/src/main/java/org/apache/tuscany/scdl/util/NamespaceStack.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/sebastien/java/sca/modules/scdl/src/main/java/org/apache/tuscany/scdl/util/NamespaceStack.java?view=auto&rev=521781
==============================================================================
--- incubator/tuscany/sandbox/sebastien/java/sca/modules/scdl/src/main/java/org/apache/tuscany/scdl/util/NamespaceStack.java (added)
+++ incubator/tuscany/sandbox/sebastien/java/sca/modules/scdl/src/main/java/org/apache/tuscany/scdl/util/NamespaceStack.java Fri Mar 23 08:57:03 2007
@@ -0,0 +1,225 @@
+/*
+ * 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.scdl.util;
+
+import java.util.ArrayList;
+import java.util.EmptyStackException;
+
+public class NamespaceStack {
+    private FastStack<String> prefixStack = new FastStack<String>();
+
+    // Keep two arraylists for the prefixes and namespaces. They should be in
+    // sync
+    // since the index of the entry will be used to relate them
+    // use the minimum initial capacity to let things handle memory better
+
+    private FastStack<String> uriStack = new FastStack<String>();
+
+    public String getNamespaceURI(String prefix) {
+        int index = prefixStack.search(prefix);
+        return index == -1 ? null : (String)uriStack.get(index);
+    }
+
+    public String getPrefix(String uri) {
+        int index = uriStack.search(uri);
+        if (index != -1) {
+            return (String)prefixStack.get(index);
+        }
+        return null;
+    }
+
+    /**
+     * Pop a namespace
+     */
+    public void endPrefixMapping(String prefix) {
+        int index = prefixStack.search(prefix);
+        if (index != -1) {
+            prefixStack.remove(index);
+            uriStack.remove(index);
+        }
+    }
+
+    /**
+     * Register a namespace in this context
+     * 
+     * @param prefix
+     * @param uri
+     */
+    public void startPrefixMapping(String prefix, String uri) {
+        prefixStack.push(prefix);
+        uriStack.push(uri);
+
+    }
+
+    /**
+     * An implementation of the {@link java.util.Stack} API that is based on an <code>ArrayList</code> instead of a
+     * <code>Vector</code>, so it is not synchronized to protect against multi-threaded access. The implementation is
+     * therefore operates faster in environments where you do not need to worry about multiple thread contention.
+     * <p>
+     * The removal order of an <code>ArrayStack</code> is based on insertion order: The most recently added element is
+     * removed first. The iteration order is <i>not</i> the same as the removal order. The iterator returns elements
+     * from the bottom up, whereas the {@link #remove()} method removes them from the top down.
+     * <p>
+     * Unlike <code>Stack</code>, <code>ArrayStack</code> accepts null entries.
+     */
+    private static class FastStack<T> extends ArrayList<T> {
+
+        /** Ensure serialization compatibility */
+        private static final long serialVersionUID = 2130079159931574599L;
+
+        /**
+         * Constructs a new empty <code>ArrayStack</code>. The initial size is controlled by <code>ArrayList</code>
+         * and is currently 10.
+         */
+        public FastStack() {
+            super();
+        }
+
+        /**
+         * Constructs a new empty <code>ArrayStack</code> with an initial size.
+         * 
+         * @param initialSize the initial size to use
+         * @throws IllegalArgumentException if the specified initial size is negative
+         */
+        public FastStack(int initialSize) {
+            super(initialSize);
+        }
+
+        /**
+         * Return <code>true</code> if this stack is currently empty.
+         * <p>
+         * This method exists for compatibility with <code>java.util.Stack</code>. New users of this class should use
+         * <code>isEmpty</code> instead.
+         * 
+         * @return true if the stack is currently empty
+         */
+        public boolean empty() {
+            return isEmpty();
+        }
+
+        /**
+         * Returns the top item off of this stack without removing it.
+         * 
+         * @return the top item on the stack
+         * @throws EmptyStackException if the stack is empty
+         */
+        public T peek() throws EmptyStackException {
+            int n = size();
+            if (n <= 0) {
+                throw new EmptyStackException();
+            } else {
+                return get(n - 1);
+            }
+        }
+
+        /**
+         * Returns the n'th item down (zero-relative) from the top of this stack without removing it.
+         * 
+         * @param n the number of items down to go
+         * @return the n'th item on the stack, zero relative
+         * @throws EmptyStackException if there are not enough items on the stack to satisfy this request
+         */
+        public T peek(int n) throws EmptyStackException {
+            int m = (size() - n) - 1;
+            if (m < 0) {
+                throw new EmptyStackException();
+            } else {
+                return get(m);
+            }
+        }
+
+        /**
+         * Pops the top item off of this stack and return it.
+         * 
+         * @return the top item on the stack
+         * @throws EmptyStackException if the stack is empty
+         */
+        public T pop() throws EmptyStackException {
+            int n = size();
+            if (n <= 0) {
+                throw new EmptyStackException();
+            } else {
+                return remove(n - 1);
+            }
+        }
+
+        /**
+         * Pushes a new item onto the top of this stack. The pushed item is also returned. This is equivalent to calling
+         * <code>add</code>.
+         * 
+         * @param item the item to be added
+         * @return the item just pushed
+         */
+        public Object push(T item) {
+            add(item);
+            return item;
+        }
+
+        /**
+         * Returns the one-based position of the distance from the top that the specified object exists on this stack,
+         * where the top-most element is considered to be at distance <code>1</code>. If the object is not present on
+         * the stack, return <code>-1</code> instead. The <code>equals()</code> method is used to compare to the
+         * items in this stack.
+         * 
+         * @param object the object to be searched for
+         * @return index of the stack for the object, or -1 if not found
+         */
+        public int search(T object) {
+            int i = size() - 1; // Current index
+            while (i >= 0) {
+                T current = get(i);
+                if ((object == null && current == null) || (object != null && object.equals(current))) {
+                    return i;
+                }
+                i--;
+            }
+            return -1;
+        }
+
+        /**
+         * Returns the element on the top of the stack.
+         * 
+         * @return the element on the top of the stack
+         * @throws EmptyStackException if the stack is empty
+         */
+        public T get() {
+            int size = size();
+            if (size == 0) {
+                throw new EmptyStackException();
+            }
+            return get(size - 1);
+        }
+
+        /**
+         * Removes the element on the top of the stack.
+         * 
+         * @return the removed element
+         * @throws EmptyStackException if the stack is empty
+         */
+        public T remove() {
+            int size = size();
+            if (size == 0) {
+                throw new EmptyStackException();
+            }
+            return remove(size - 1);
+        }
+
+    }
+
+}

Propchange: incubator/tuscany/sandbox/sebastien/java/sca/modules/scdl/src/main/java/org/apache/tuscany/scdl/util/NamespaceStack.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/sandbox/sebastien/java/sca/modules/scdl/src/main/java/org/apache/tuscany/scdl/util/NamespaceStack.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/tuscany/sandbox/sebastien/java/sca/modules/scdl/src/test/java/org/apache/tuscany/scdl/ReadTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/sebastien/java/sca/modules/scdl/src/test/java/org/apache/tuscany/scdl/ReadTestCase.java?view=auto&rev=521781
==============================================================================
--- incubator/tuscany/sandbox/sebastien/java/sca/modules/scdl/src/test/java/org/apache/tuscany/scdl/ReadTestCase.java (added)
+++ incubator/tuscany/sandbox/sebastien/java/sca/modules/scdl/src/test/java/org/apache/tuscany/scdl/ReadTestCase.java Fri Mar 23 08:57:03 2007
@@ -0,0 +1,108 @@
+/*
+ * 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.scdl;
+
+import java.io.InputStream;
+
+import junit.framework.TestCase;
+
+import org.apache.tuscany.assembly.model.AssemblyFactory;
+import org.apache.tuscany.assembly.model.impl.AssemblyFactoryImpl;
+import org.apache.tuscany.assembly.util.PrintUtil;
+import org.apache.tuscany.assembly.util.CompositeUtil;
+import org.apache.tuscany.scdl.impl.ComponentTypeHandler;
+import org.apache.tuscany.scdl.impl.CompositeHandler;
+import org.apache.tuscany.scdl.impl.ConstrainingTypeHandler;
+import org.xml.sax.InputSource;
+import org.xml.sax.XMLReader;
+import org.xml.sax.helpers.XMLReaderFactory;
+
+/**
+ * Test the usability of the assembly model API when loading SCDL
+ * 
+ * @version $Rev$ $Date$
+ */
+public class ReadTestCase extends TestCase {
+
+    XMLReader reader;
+    AssemblyFactory assemblyFactory;
+    
+    public void setUp() throws Exception {
+        reader = XMLReaderFactory.createXMLReader();
+        reader.setFeature("http://xml.org/sax/features/namespaces", true);
+        reader.setFeature("http://xml.org/sax/features/namespace-prefixes", false);
+        
+        assemblyFactory = new AssemblyFactoryImpl();
+    }
+
+    public void tearDown() throws Exception {
+        assemblyFactory = null;
+        reader = null;
+    }
+
+    public void testReadComponentType() throws Exception {
+        InputStream is = getClass().getClassLoader().getResourceAsStream("CalculatorImpl.componentType");
+        ComponentTypeHandler handler = new ComponentTypeHandler(assemblyFactory, null);
+        reader.setContentHandler(handler);
+        reader.parse(new InputSource(is));
+        assertNotNull(handler.getComponentType());
+        
+        new PrintUtil(System.out).print(handler.getComponentType());
+    }
+
+    public void testReadConstrainingType() throws Exception {
+        InputStream is = getClass().getClassLoader().getResourceAsStream("CalculatorComponent.constrainingType");
+        ConstrainingTypeHandler handler = new ConstrainingTypeHandler(assemblyFactory, null);
+        reader.setContentHandler(handler);
+        reader.parse(new InputSource(is));
+        assertNotNull(handler.getConstrainingType());
+
+        new PrintUtil(System.out).print(handler.getConstrainingType());
+    }
+    
+    public static void main(String[] args) throws Exception {
+		ReadTestCase tc = new ReadTestCase();
+		tc.setUp();
+		tc.testReadComposite();
+	}
+
+    public void testReadComposite() throws Exception {
+        InputStream is = getClass().getClassLoader().getResourceAsStream("Calculator.composite");
+        CompositeHandler handler = new CompositeHandler(assemblyFactory, null, null, null);
+        reader.setContentHandler(handler);
+        reader.parse(new InputSource(is));
+        assertNotNull(handler.getComposite());
+
+        new PrintUtil(System.out).print(handler.getComposite());
+    }
+
+    public void testReadCompositeAndWireIt() throws Exception {
+        InputStream is = getClass().getClassLoader().getResourceAsStream("Calculator.composite");
+        CompositeHandler handler = new CompositeHandler(assemblyFactory, null, null, null);
+        reader.setContentHandler(handler);
+        reader.parse(new InputSource(is));
+        assertNotNull(handler.getComposite());
+        
+        new CompositeUtil(assemblyFactory, handler.getComposite()).configure(null);
+
+        new PrintUtil(System.out).print(handler.getComposite());
+    }
+
+}

Propchange: incubator/tuscany/sandbox/sebastien/java/sca/modules/scdl/src/test/java/org/apache/tuscany/scdl/ReadTestCase.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/sandbox/sebastien/java/sca/modules/scdl/src/test/java/org/apache/tuscany/scdl/ReadTestCase.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/tuscany/sandbox/sebastien/java/sca/modules/scdl/src/test/java/org/apache/tuscany/scdl/WriteTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/sebastien/java/sca/modules/scdl/src/test/java/org/apache/tuscany/scdl/WriteTestCase.java?view=auto&rev=521781
==============================================================================
--- incubator/tuscany/sandbox/sebastien/java/sca/modules/scdl/src/test/java/org/apache/tuscany/scdl/WriteTestCase.java (added)
+++ incubator/tuscany/sandbox/sebastien/java/sca/modules/scdl/src/test/java/org/apache/tuscany/scdl/WriteTestCase.java Fri Mar 23 08:57:03 2007
@@ -0,0 +1,116 @@
+/*
+ * 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.scdl;
+
+import java.io.InputStream;
+
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.sax.SAXSource;
+import javax.xml.transform.stream.StreamResult;
+
+import junit.framework.TestCase;
+
+import org.apache.tuscany.assembly.model.AssemblyFactory;
+import org.apache.tuscany.assembly.model.impl.AssemblyFactoryImpl;
+import org.apache.tuscany.scdl.impl.ComponentTypeHandler;
+import org.apache.tuscany.scdl.impl.ComponentTypeWriter;
+import org.apache.tuscany.scdl.impl.CompositeHandler;
+import org.apache.tuscany.scdl.impl.CompositeWriter;
+import org.apache.tuscany.scdl.impl.ConstrainingTypeHandler;
+import org.apache.tuscany.scdl.impl.ConstrainingTypeWriter;
+import org.xml.sax.InputSource;
+import org.xml.sax.XMLReader;
+import org.xml.sax.helpers.XMLReaderFactory;
+
+/**
+ * Test the usability of the assembly model API when loading SCDL
+ * 
+ * @version $Rev$ $Date$
+ */
+public class WriteTestCase extends TestCase {
+
+    AssemblyFactory factory;
+    XMLReader reader;
+    Transformer transformer;
+
+    public void setUp() throws Exception {
+        factory = new AssemblyFactoryImpl();
+
+        reader = XMLReaderFactory.createXMLReader();
+        reader.setFeature("http://xml.org/sax/features/namespaces", true);
+        reader.setFeature("http://xml.org/sax/features/namespace-prefixes", false);
+        
+        transformer = TransformerFactory.newInstance().newTransformer();
+        transformer.setOutputProperty("indent", "yes");
+    }
+
+    public void tearDown() throws Exception {
+        factory = null;
+        reader = null;
+        transformer = null;
+    }
+    
+    public static void main(String[] args) throws Exception {
+    	WriteTestCase tc = new WriteTestCase();
+    	tc.setUp();
+		tc.testWriteComponentType();
+	}
+
+    public void testWriteComponentType() throws Exception {
+        InputStream is = getClass().getClassLoader().getResourceAsStream("CalculatorImpl.componentType");
+        ComponentTypeHandler handler = new ComponentTypeHandler(factory, null);
+        reader.setContentHandler(handler);
+        reader.parse(new InputSource(is));
+        assertNotNull(handler.getComponentType());
+
+        ComponentTypeWriter writer = new ComponentTypeWriter(handler.getComponentType());
+        System.out.println();
+        transformer.transform(new SAXSource(writer, null), new StreamResult(System.out));
+        System.out.println();
+    }
+
+    public void testWriteComposite() throws Exception {
+        InputStream is = getClass().getClassLoader().getResourceAsStream("Calculator.composite");
+        CompositeHandler handler = new CompositeHandler(factory, null, null, null);
+        reader.setContentHandler(handler);
+        reader.parse(new InputSource(is));
+        assertNotNull(handler.getComposite());
+
+        CompositeWriter writer = new CompositeWriter(handler.getComposite());
+        System.out.println();
+        transformer.transform(new SAXSource(writer, null), new StreamResult(System.out));
+        System.out.println();
+    }
+
+    public void testWriteConstrainingType() throws Exception {
+        InputStream is = getClass().getClassLoader().getResourceAsStream("CalculatorComponent.constrainingType");
+        ConstrainingTypeHandler handler = new ConstrainingTypeHandler(factory, null);
+        reader.setContentHandler(handler);
+        reader.parse(new InputSource(is));
+        assertNotNull(handler.getConstrainingType());
+
+        ConstrainingTypeWriter writer = new ConstrainingTypeWriter(handler.getConstrainingType());
+        System.out.println();
+        transformer.transform(new SAXSource(writer, null), new StreamResult(System.out));
+        System.out.println();
+    }
+
+}

Propchange: incubator/tuscany/sandbox/sebastien/java/sca/modules/scdl/src/test/java/org/apache/tuscany/scdl/WriteTestCase.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/sandbox/sebastien/java/sca/modules/scdl/src/test/java/org/apache/tuscany/scdl/WriteTestCase.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/tuscany/sandbox/sebastien/java/sca/modules/scdl/src/test/java/org/apache/tuscany/scdl/builder/AccountDataService.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/sebastien/java/sca/modules/scdl/src/test/java/org/apache/tuscany/scdl/builder/AccountDataService.java?view=auto&rev=521781
==============================================================================
--- incubator/tuscany/sandbox/sebastien/java/sca/modules/scdl/src/test/java/org/apache/tuscany/scdl/builder/AccountDataService.java (added)
+++ incubator/tuscany/sandbox/sebastien/java/sca/modules/scdl/src/test/java/org/apache/tuscany/scdl/builder/AccountDataService.java Fri Mar 23 08:57:03 2007
@@ -0,0 +1,24 @@
+/*
+ * 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.scdl.builder;
+
+public interface AccountDataService {
+
+}

Propchange: incubator/tuscany/sandbox/sebastien/java/sca/modules/scdl/src/test/java/org/apache/tuscany/scdl/builder/AccountDataService.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/sandbox/sebastien/java/sca/modules/scdl/src/test/java/org/apache/tuscany/scdl/builder/AccountDataService.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/tuscany/sandbox/sebastien/java/sca/modules/scdl/src/test/java/org/apache/tuscany/scdl/builder/AccountDataServiceImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/sebastien/java/sca/modules/scdl/src/test/java/org/apache/tuscany/scdl/builder/AccountDataServiceImpl.java?view=auto&rev=521781
==============================================================================
--- incubator/tuscany/sandbox/sebastien/java/sca/modules/scdl/src/test/java/org/apache/tuscany/scdl/builder/AccountDataServiceImpl.java (added)
+++ incubator/tuscany/sandbox/sebastien/java/sca/modules/scdl/src/test/java/org/apache/tuscany/scdl/builder/AccountDataServiceImpl.java Fri Mar 23 08:57:03 2007
@@ -0,0 +1,24 @@
+/*
+ * 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.scdl.builder;
+
+public class AccountDataServiceImpl {
+
+}

Propchange: incubator/tuscany/sandbox/sebastien/java/sca/modules/scdl/src/test/java/org/apache/tuscany/scdl/builder/AccountDataServiceImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/sandbox/sebastien/java/sca/modules/scdl/src/test/java/org/apache/tuscany/scdl/builder/AccountDataServiceImpl.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/tuscany/sandbox/sebastien/java/sca/modules/scdl/src/test/java/org/apache/tuscany/scdl/builder/AccountService.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/sebastien/java/sca/modules/scdl/src/test/java/org/apache/tuscany/scdl/builder/AccountService.java?view=auto&rev=521781
==============================================================================
--- incubator/tuscany/sandbox/sebastien/java/sca/modules/scdl/src/test/java/org/apache/tuscany/scdl/builder/AccountService.java (added)
+++ incubator/tuscany/sandbox/sebastien/java/sca/modules/scdl/src/test/java/org/apache/tuscany/scdl/builder/AccountService.java Fri Mar 23 08:57:03 2007
@@ -0,0 +1,24 @@
+/*
+ * 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.scdl.builder;
+
+public interface AccountService {
+
+}

Propchange: incubator/tuscany/sandbox/sebastien/java/sca/modules/scdl/src/test/java/org/apache/tuscany/scdl/builder/AccountService.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/sandbox/sebastien/java/sca/modules/scdl/src/test/java/org/apache/tuscany/scdl/builder/AccountService.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/tuscany/sandbox/sebastien/java/sca/modules/scdl/src/test/java/org/apache/tuscany/scdl/builder/AccountServiceImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/sebastien/java/sca/modules/scdl/src/test/java/org/apache/tuscany/scdl/builder/AccountServiceImpl.java?view=auto&rev=521781
==============================================================================
--- incubator/tuscany/sandbox/sebastien/java/sca/modules/scdl/src/test/java/org/apache/tuscany/scdl/builder/AccountServiceImpl.java (added)
+++ incubator/tuscany/sandbox/sebastien/java/sca/modules/scdl/src/test/java/org/apache/tuscany/scdl/builder/AccountServiceImpl.java Fri Mar 23 08:57:03 2007
@@ -0,0 +1,24 @@
+/*
+ * 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.scdl.builder;
+
+public class AccountServiceImpl {
+
+}

Propchange: incubator/tuscany/sandbox/sebastien/java/sca/modules/scdl/src/test/java/org/apache/tuscany/scdl/builder/AccountServiceImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/sandbox/sebastien/java/sca/modules/scdl/src/test/java/org/apache/tuscany/scdl/builder/AccountServiceImpl.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/tuscany/sandbox/sebastien/java/sca/modules/scdl/src/test/java/org/apache/tuscany/scdl/builder/BigBankBuilder.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/sebastien/java/sca/modules/scdl/src/test/java/org/apache/tuscany/scdl/builder/BigBankBuilder.java?view=auto&rev=521781
==============================================================================
--- incubator/tuscany/sandbox/sebastien/java/sca/modules/scdl/src/test/java/org/apache/tuscany/scdl/builder/BigBankBuilder.java (added)
+++ incubator/tuscany/sandbox/sebastien/java/sca/modules/scdl/src/test/java/org/apache/tuscany/scdl/builder/BigBankBuilder.java Fri Mar 23 08:57:03 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.scdl.builder;
+
+import org.apache.tuscany.assembly.builder.CompositeBuilder;
+import org.apache.tuscany.assembly.builder.impl.AssemblyBuilderImpl;
+
+public class BigBankBuilder extends AssemblyBuilderImpl {
+	
+	public CompositeBuilder build() {
+		
+		CompositeBuilder bigbankAccount = composite("bigbank.account").contains(
+
+			component("AccountServiceComponent").
+			implementedBy(AccountServiceImpl.class).
+			uses(
+				reference("accountDataService").typedBy(AccountDataService.class).wiredTo("AccountDataServiceComponent/AccountDataService"),
+				reference("stockQuoteService").promotedAs("StockQuoteService")
+			).
+			provides(
+				service("AccountDataService").typedBy(AccountService.class).promoted()
+			).
+			declares(
+				property("currency").ofType("string").configuredTo("USD")
+			),
+		
+			component("AccountDataServiceComponent").
+			implementedBy(AccountDataServiceImpl.class).
+			provides(
+				service("AccountDataService").typedBy(AccountDataService.class)
+			)
+		);
+		
+		CompositeBuilder bigbankApp = composite("bigbank.app").
+			contains(
+				component("BigBankAccount").implementedBy(bigbankAccount)
+			);
+		
+		CompositeBuilder domain = domain("http://bigbank.org").includes(bigbankApp);
+		
+		return domain;
+	}
+}

Propchange: incubator/tuscany/sandbox/sebastien/java/sca/modules/scdl/src/test/java/org/apache/tuscany/scdl/builder/BigBankBuilder.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/sandbox/sebastien/java/sca/modules/scdl/src/test/java/org/apache/tuscany/scdl/builder/BigBankBuilder.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/tuscany/sandbox/sebastien/java/sca/modules/scdl/src/test/java/org/apache/tuscany/scdl/builder/BigBankBuilderTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/sebastien/java/sca/modules/scdl/src/test/java/org/apache/tuscany/scdl/builder/BigBankBuilderTestCase.java?view=auto&rev=521781
==============================================================================
--- incubator/tuscany/sandbox/sebastien/java/sca/modules/scdl/src/test/java/org/apache/tuscany/scdl/builder/BigBankBuilderTestCase.java (added)
+++ incubator/tuscany/sandbox/sebastien/java/sca/modules/scdl/src/test/java/org/apache/tuscany/scdl/builder/BigBankBuilderTestCase.java Fri Mar 23 08:57:03 2007
@@ -0,0 +1,69 @@
+/*
+ * 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.scdl.builder;
+
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.sax.SAXSource;
+import javax.xml.transform.stream.StreamResult;
+
+import junit.framework.TestCase;
+
+import org.apache.tuscany.assembly.model.Composite;
+import org.apache.tuscany.scdl.impl.CompositeWriter;
+
+public class BigBankBuilderTestCase extends TestCase {
+	
+    Transformer transformer;
+    
+    public void setUp() throws Exception {
+        transformer = TransformerFactory.newInstance().newTransformer();
+        transformer.setOutputProperty("indent", "yes");
+    }
+
+    public void tearDown() throws Exception {
+        transformer = null;
+    }
+    
+	public void testBuild() throws Exception {
+
+		BigBankBuilder builder = new BigBankBuilder();
+		Composite domain = (Composite)builder.build();
+		
+        CompositeWriter writer = new CompositeWriter(domain);
+        System.out.println();
+        transformer.transform(new SAXSource(writer, null), new StreamResult(System.out));
+        System.out.println();
+        
+        Composite bigbankApp = domain.getIncludes().get(0);
+        writer = new CompositeWriter(bigbankApp);
+        System.out.println();
+        transformer.transform(new SAXSource(writer, null), new StreamResult(System.out));
+        System.out.println();
+        
+        Composite bigbankAccount = (Composite)bigbankApp.getComponents().get(0).getImplementation();
+        writer = new CompositeWriter(bigbankAccount);
+        System.out.println();
+        transformer.transform(new SAXSource(writer, null), new StreamResult(System.out));
+        System.out.println();
+        
+	}
+
+}

Propchange: incubator/tuscany/sandbox/sebastien/java/sca/modules/scdl/src/test/java/org/apache/tuscany/scdl/builder/BigBankBuilderTestCase.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/sandbox/sebastien/java/sca/modules/scdl/src/test/java/org/apache/tuscany/scdl/builder/BigBankBuilderTestCase.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/tuscany/sandbox/sebastien/java/sca/modules/scdl/src/test/java/org/apache/tuscany/scdl/builder/StockQuoteService.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/sebastien/java/sca/modules/scdl/src/test/java/org/apache/tuscany/scdl/builder/StockQuoteService.java?view=auto&rev=521781
==============================================================================
--- incubator/tuscany/sandbox/sebastien/java/sca/modules/scdl/src/test/java/org/apache/tuscany/scdl/builder/StockQuoteService.java (added)
+++ incubator/tuscany/sandbox/sebastien/java/sca/modules/scdl/src/test/java/org/apache/tuscany/scdl/builder/StockQuoteService.java Fri Mar 23 08:57:03 2007
@@ -0,0 +1,24 @@
+/*
+ * 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.scdl.builder;
+
+public interface StockQuoteService {
+
+}

Propchange: incubator/tuscany/sandbox/sebastien/java/sca/modules/scdl/src/test/java/org/apache/tuscany/scdl/builder/StockQuoteService.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/sandbox/sebastien/java/sca/modules/scdl/src/test/java/org/apache/tuscany/scdl/builder/StockQuoteService.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Copied: incubator/tuscany/sandbox/sebastien/java/sca/modules/wsdl-scdl/pom.xml (from r521347, incubator/tuscany/sandbox/sebastien/java/sca/modules/wsdl/pom.xml)
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/sebastien/java/sca/modules/wsdl-scdl/pom.xml?view=diff&rev=521781&p1=incubator/tuscany/sandbox/sebastien/java/sca/modules/wsdl/pom.xml&r1=521347&p2=incubator/tuscany/sandbox/sebastien/java/sca/modules/wsdl-scdl/pom.xml&r2=521781
==============================================================================
--- incubator/tuscany/sandbox/sebastien/java/sca/modules/wsdl/pom.xml (original)
+++ incubator/tuscany/sandbox/sebastien/java/sca/modules/wsdl-scdl/pom.xml Fri Mar 23 08:57:03 2007
@@ -25,24 +25,18 @@
         <relativePath>../pom.xml</relativePath>
     </parent>
     <modelVersion>4.0.0</modelVersion>
-    <artifactId>tuscany-assembly-wsdl</artifactId>
+    <artifactId>tuscany-wsdl-scdl</artifactId>
     <packaging>jar</packaging>
-    <name>Apache Tuscany WSDL Interface Model</name>
-    <description>Apache Tuscany WSDL Interface Model.</description>
+    <name>Apache Tuscany WSDL Interface SCDL Support</name>
+    <description>Apache Tuscany WSDL Interface SCDL Support.</description>
 
     <dependencies>
 
         <dependency>
             <groupId>org.apache.tuscany.sca.modules</groupId>
-            <artifactId>tuscany-assembly</artifactId>
+            <artifactId>tuscany-wsdl</artifactId>
             <version>0.1-sandbox-incubating-SNAPSHOT</version>
         </dependency>
-
-         <dependency>
-             <groupId>wsdl4j</groupId>
-             <artifactId>wsdl4j</artifactId>
-             <version>1.6.2</version>
-         </dependency>
 
         <dependency>
             <groupId>junit</groupId>

Added: incubator/tuscany/sandbox/sebastien/java/sca/modules/wsdl-scdl/src/main/java/org/apache/tuscany/wsdl/scdl/WSDLConstants.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/sebastien/java/sca/modules/wsdl-scdl/src/main/java/org/apache/tuscany/wsdl/scdl/WSDLConstants.java?view=auto&rev=521781
==============================================================================
--- incubator/tuscany/sandbox/sebastien/java/sca/modules/wsdl-scdl/src/main/java/org/apache/tuscany/wsdl/scdl/WSDLConstants.java (added)
+++ incubator/tuscany/sandbox/sebastien/java/sca/modules/wsdl-scdl/src/main/java/org/apache/tuscany/wsdl/scdl/WSDLConstants.java Fri Mar 23 08:57:03 2007
@@ -0,0 +1,26 @@
+/*
+ * 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.wsdl.scdl;
+
+public interface WSDLConstants {
+	
+	public final String INTERFACE_WSDL ="interface.wsdl";
+	public final String INTERFACE = "interface";
+
+}

Propchange: incubator/tuscany/sandbox/sebastien/java/sca/modules/wsdl-scdl/src/main/java/org/apache/tuscany/wsdl/scdl/WSDLConstants.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/sandbox/sebastien/java/sca/modules/wsdl-scdl/src/main/java/org/apache/tuscany/wsdl/scdl/WSDLConstants.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/tuscany/sandbox/sebastien/java/sca/modules/wsdl-scdl/src/main/java/org/apache/tuscany/wsdl/scdl/WSDLHandler.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/sebastien/java/sca/modules/wsdl-scdl/src/main/java/org/apache/tuscany/wsdl/scdl/WSDLHandler.java?view=auto&rev=521781
==============================================================================
--- incubator/tuscany/sandbox/sebastien/java/sca/modules/wsdl-scdl/src/main/java/org/apache/tuscany/wsdl/scdl/WSDLHandler.java (added)
+++ incubator/tuscany/sandbox/sebastien/java/sca/modules/wsdl-scdl/src/main/java/org/apache/tuscany/wsdl/scdl/WSDLHandler.java Fri Mar 23 08:57:03 2007
@@ -0,0 +1,69 @@
+/*
+ * 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.wsdl.scdl;
+
+import javax.xml.namespace.QName;
+
+import org.apache.tuscany.assembly.model.Interface;
+import org.apache.tuscany.scdl.Constants;
+import org.apache.tuscany.scdl.InterfaceHandler;
+import org.apache.tuscany.wsdl.model.WSDLFactory;
+import org.apache.tuscany.wsdl.model.WSDLInterface;
+import org.xml.sax.Attributes;
+import org.xml.sax.SAXException;
+import org.xml.sax.helpers.DefaultHandler;
+
+/**
+ * A content handler for Java interfaces and implementations. 
+ *
+ *  @version $Rev$ $Date$
+ */
+public class WSDLHandler extends DefaultHandler implements InterfaceHandler {
+	
+	private WSDLFactory wsdlFactory;
+	private WSDLInterface wsdlInterface;
+	
+	public WSDLHandler(WSDLFactory wsdlFactory) {
+		this.wsdlFactory = wsdlFactory;
+	}
+	
+	public void startDocument() throws SAXException {
+		wsdlInterface = null;
+	}
+	
+	public void startElement(String uri, String name, String qname, Attributes attr) throws SAXException {
+		
+		if (Constants.SCA10_NS.equals(uri)) {
+			
+			if (WSDLConstants.INTERFACE_WSDL.equals(name)) {
+				
+				// Parse a WSDL interface
+				wsdlInterface = wsdlFactory.createWSDLInterface();
+				wsdlInterface.setUnresolved(true);
+				//TODO handle qname
+				wsdlInterface.setName(new QName("", attr.getValue(WSDLConstants.INTERFACE)));
+			}
+		}
+	}
+	
+	public Interface getInterface() {
+		return wsdlInterface;
+	}
+	
+}

Propchange: incubator/tuscany/sandbox/sebastien/java/sca/modules/wsdl-scdl/src/main/java/org/apache/tuscany/wsdl/scdl/WSDLHandler.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/sandbox/sebastien/java/sca/modules/wsdl-scdl/src/main/java/org/apache/tuscany/wsdl/scdl/WSDLHandler.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: incubator/tuscany/sandbox/sebastien/java/sca/modules/wsdl/pom.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/sebastien/java/sca/modules/wsdl/pom.xml?view=diff&rev=521781&r1=521780&r2=521781
==============================================================================
--- incubator/tuscany/sandbox/sebastien/java/sca/modules/wsdl/pom.xml (original)
+++ incubator/tuscany/sandbox/sebastien/java/sca/modules/wsdl/pom.xml Fri Mar 23 08:57:03 2007
@@ -25,7 +25,7 @@
         <relativePath>../pom.xml</relativePath>
     </parent>
     <modelVersion>4.0.0</modelVersion>
-    <artifactId>tuscany-assembly-wsdl</artifactId>
+    <artifactId>tuscany-wsdl</artifactId>
     <packaging>jar</packaging>
     <name>Apache Tuscany WSDL Interface Model</name>
     <description>Apache Tuscany WSDL Interface Model.</description>
@@ -37,7 +37,11 @@
             <artifactId>tuscany-assembly</artifactId>
             <version>0.1-sandbox-incubating-SNAPSHOT</version>
         </dependency>
-
+        <dependency>
+            <groupId>org.apache.tuscany.sca.modules</groupId>
+            <artifactId>tuscany-assembly-scdl</artifactId>
+            <version>0.1-sandbox-incubating-SNAPSHOT</version>
+        </dependency>
          <dependency>
              <groupId>wsdl4j</groupId>
              <artifactId>wsdl4j</artifactId>

Added: incubator/tuscany/sandbox/sebastien/java/sca/modules/wsdl/src/main/java/org/apache/tuscany/wsdl/model/WSDLFactory.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/sebastien/java/sca/modules/wsdl/src/main/java/org/apache/tuscany/wsdl/model/WSDLFactory.java?view=auto&rev=521781
==============================================================================
--- incubator/tuscany/sandbox/sebastien/java/sca/modules/wsdl/src/main/java/org/apache/tuscany/wsdl/model/WSDLFactory.java (added)
+++ incubator/tuscany/sandbox/sebastien/java/sca/modules/wsdl/src/main/java/org/apache/tuscany/wsdl/model/WSDLFactory.java Fri Mar 23 08:57:03 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.wsdl.model;
+
+/**
+ * Factory for the WSDL model.
+ *
+ *  @version $Rev$ $Date$
+ */
+public interface WSDLFactory {
+	
+	/**
+	 * Creates a new WSDL interface.
+	 * @return a new WSDL interface
+	 */
+	WSDLInterface createWSDLInterface();
+
+}

Propchange: incubator/tuscany/sandbox/sebastien/java/sca/modules/wsdl/src/main/java/org/apache/tuscany/wsdl/model/WSDLFactory.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/sandbox/sebastien/java/sca/modules/wsdl/src/main/java/org/apache/tuscany/wsdl/model/WSDLFactory.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: incubator/tuscany/sandbox/sebastien/java/sca/modules/wsdl/src/main/java/org/apache/tuscany/wsdl/model/WSDLInterface.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/sebastien/java/sca/modules/wsdl/src/main/java/org/apache/tuscany/wsdl/model/WSDLInterface.java?view=diff&rev=521781&r1=521780&r2=521781
==============================================================================
--- incubator/tuscany/sandbox/sebastien/java/sca/modules/wsdl/src/main/java/org/apache/tuscany/wsdl/model/WSDLInterface.java (original)
+++ incubator/tuscany/sandbox/sebastien/java/sca/modules/wsdl/src/main/java/org/apache/tuscany/wsdl/model/WSDLInterface.java Fri Mar 23 08:57:03 2007
@@ -24,11 +24,11 @@
 import org.apache.tuscany.assembly.model.Interface;
 
 /**
- * Represents a Java interface.
+ * Represents a WSDL interface.
  *
  *  @version $Rev$ $Date$
  */
-public interface WSDLInterface extends Interface{
+public interface WSDLInterface extends Interface {
 	
 	/**
 	 * Returns the name of the WSDL interface.

Added: incubator/tuscany/sandbox/sebastien/java/sca/modules/wsdl/src/main/java/org/apache/tuscany/wsdl/model/impl/WSDLFactoryImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/sebastien/java/sca/modules/wsdl/src/main/java/org/apache/tuscany/wsdl/model/impl/WSDLFactoryImpl.java?view=auto&rev=521781
==============================================================================
--- incubator/tuscany/sandbox/sebastien/java/sca/modules/wsdl/src/main/java/org/apache/tuscany/wsdl/model/impl/WSDLFactoryImpl.java (added)
+++ incubator/tuscany/sandbox/sebastien/java/sca/modules/wsdl/src/main/java/org/apache/tuscany/wsdl/model/impl/WSDLFactoryImpl.java Fri Mar 23 08:57:03 2007
@@ -0,0 +1,35 @@
+/*
+ * 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.wsdl.model.impl;
+
+import org.apache.tuscany.wsdl.model.WSDLFactory;
+import org.apache.tuscany.wsdl.model.WSDLInterface;
+
+/**
+ * A factory for the WSDL model.
+ *
+ *  @version $Rev$ $Date$
+ */
+public class WSDLFactoryImpl implements WSDLFactory {
+	
+	public WSDLInterface createWSDLInterface() {
+		return new WSDLInterfaceImpl();
+	}
+
+}

Propchange: incubator/tuscany/sandbox/sebastien/java/sca/modules/wsdl/src/main/java/org/apache/tuscany/wsdl/model/impl/WSDLFactoryImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/sandbox/sebastien/java/sca/modules/wsdl/src/main/java/org/apache/tuscany/wsdl/model/impl/WSDLFactoryImpl.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: incubator/tuscany/sandbox/sebastien/java/sca/modules/wsdl/src/main/java/org/apache/tuscany/wsdl/model/impl/WSDLInterfaceImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/sebastien/java/sca/modules/wsdl/src/main/java/org/apache/tuscany/wsdl/model/impl/WSDLInterfaceImpl.java?view=diff&rev=521781&r1=521780&r2=521781
==============================================================================
--- incubator/tuscany/sandbox/sebastien/java/sca/modules/wsdl/src/main/java/org/apache/tuscany/wsdl/model/impl/WSDLInterfaceImpl.java (original)
+++ incubator/tuscany/sandbox/sebastien/java/sca/modules/wsdl/src/main/java/org/apache/tuscany/wsdl/model/impl/WSDLInterfaceImpl.java Fri Mar 23 08:57:03 2007
@@ -34,15 +34,19 @@
 	private QName interfaceName;
 	private PortType portType;
 
+	public WSDLInterfaceImpl() {
+		setRemotable(true);
+	}
+	
 	public QName getName() {
-		if (isUndefined())
+		if (isUnresolved())
 			return interfaceName;
 		else
 			return portType.getQName();
 	}
 
 	public void setName(QName interfaceName) {
-		if (!isUndefined())
+		if (!isUnresolved())
 			this.interfaceName = interfaceName;
 		else
 			throw new IllegalArgumentException();



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