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 [1/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...

Author: jsdelfino
Date: Fri Mar 23 08:57:03 2007
New Revision: 521781

URL: http://svn.apache.org/viewvc?view=rev&rev=521781
Log:
Added java and wsdl SCDL support modules, CRUD impl factory, a wiring util and SCDL loading test cases.

Added:
    incubator/tuscany/sandbox/sebastien/java/sca/modules/assembly/src/main/java/org/apache/tuscany/assembly/model/AbstractContract.java   (with props)
    incubator/tuscany/sandbox/sebastien/java/sca/modules/assembly/src/main/java/org/apache/tuscany/assembly/util/CompositeUtil.java   (with props)
    incubator/tuscany/sandbox/sebastien/java/sca/modules/impl-crud/src/main/java/org/apache/tuscany/crud/
    incubator/tuscany/sandbox/sebastien/java/sca/modules/impl-crud/src/main/java/org/apache/tuscany/crud/CRUD.java   (with props)
    incubator/tuscany/sandbox/sebastien/java/sca/modules/impl-crud/src/main/java/org/apache/tuscany/crud/model/
    incubator/tuscany/sandbox/sebastien/java/sca/modules/impl-crud/src/main/java/org/apache/tuscany/crud/model/CRUDFactory.java   (with props)
    incubator/tuscany/sandbox/sebastien/java/sca/modules/impl-crud/src/main/java/org/apache/tuscany/crud/model/CRUDImplementation.java   (with props)
    incubator/tuscany/sandbox/sebastien/java/sca/modules/impl-crud/src/main/java/org/apache/tuscany/crud/model/impl/
    incubator/tuscany/sandbox/sebastien/java/sca/modules/impl-crud/src/main/java/org/apache/tuscany/crud/model/impl/CRUDFactoryImpl.java   (with props)
    incubator/tuscany/sandbox/sebastien/java/sca/modules/impl-crud/src/main/java/org/apache/tuscany/crud/model/impl/CRUDImplementationImpl.java   (with props)
    incubator/tuscany/sandbox/sebastien/java/sca/modules/impl-crud/src/test/java/org/
    incubator/tuscany/sandbox/sebastien/java/sca/modules/impl-crud/src/test/java/org/apache/
    incubator/tuscany/sandbox/sebastien/java/sca/modules/impl-crud/src/test/java/org/apache/tuscany/
    incubator/tuscany/sandbox/sebastien/java/sca/modules/impl-crud/src/test/java/org/apache/tuscany/crud/
    incubator/tuscany/sandbox/sebastien/java/sca/modules/impl-crud/src/test/java/org/apache/tuscany/crud/model/
    incubator/tuscany/sandbox/sebastien/java/sca/modules/impl-crud/src/test/java/org/apache/tuscany/crud/model/CRUDFactoryTestCase.java   (with props)
    incubator/tuscany/sandbox/sebastien/java/sca/modules/java-scdl/
      - copied from r521361, incubator/tuscany/sandbox/sebastien/java/sca/modules/java/
    incubator/tuscany/sandbox/sebastien/java/sca/modules/java-scdl/pom.xml
      - copied, changed from r521347, incubator/tuscany/sandbox/sebastien/java/sca/modules/java/pom.xml
    incubator/tuscany/sandbox/sebastien/java/sca/modules/java-scdl/src/
      - copied from r521347, incubator/tuscany/sandbox/sebastien/java/sca/modules/java/src/
    incubator/tuscany/sandbox/sebastien/java/sca/modules/java-scdl/src/main/java/org/apache/tuscany/java/scdl/
    incubator/tuscany/sandbox/sebastien/java/sca/modules/java-scdl/src/main/java/org/apache/tuscany/java/scdl/JavaConstants.java   (with props)
    incubator/tuscany/sandbox/sebastien/java/sca/modules/java-scdl/src/main/java/org/apache/tuscany/java/scdl/JavaHandler.java   (with props)
    incubator/tuscany/sandbox/sebastien/java/sca/modules/java-scdl/src/test/java/org/
    incubator/tuscany/sandbox/sebastien/java/sca/modules/java-scdl/src/test/java/org/apache/
    incubator/tuscany/sandbox/sebastien/java/sca/modules/java-scdl/src/test/java/org/apache/tuscany/
    incubator/tuscany/sandbox/sebastien/java/sca/modules/java-scdl/src/test/java/org/apache/tuscany/java/
    incubator/tuscany/sandbox/sebastien/java/sca/modules/java-scdl/src/test/java/org/apache/tuscany/java/scdl/
    incubator/tuscany/sandbox/sebastien/java/sca/modules/java-scdl/src/test/java/org/apache/tuscany/java/scdl/ReadTestCase.java   (with props)
    incubator/tuscany/sandbox/sebastien/java/sca/modules/java-scdl/src/test/resources/
    incubator/tuscany/sandbox/sebastien/java/sca/modules/java-scdl/src/test/resources/Calculator.composite   (with props)
    incubator/tuscany/sandbox/sebastien/java/sca/modules/java-scdl/src/test/resources/CalculatorComponent.constrainingType
    incubator/tuscany/sandbox/sebastien/java/sca/modules/java-scdl/src/test/resources/CalculatorImpl.componentType   (with props)
    incubator/tuscany/sandbox/sebastien/java/sca/modules/java/src/main/java/org/apache/tuscany/java/model/JavaFactory.java   (with props)
    incubator/tuscany/sandbox/sebastien/java/sca/modules/java/src/main/java/org/apache/tuscany/java/model/impl/JavaFactoryImpl.java   (with props)
    incubator/tuscany/sandbox/sebastien/java/sca/modules/scdl/src/main/java/org/apache/tuscany/scdl/AnyHandler.java   (with props)
    incubator/tuscany/sandbox/sebastien/java/sca/modules/scdl/src/main/java/org/apache/tuscany/scdl/BindingHandler.java   (with props)
    incubator/tuscany/sandbox/sebastien/java/sca/modules/scdl/src/main/java/org/apache/tuscany/scdl/ContentHandlerRegistry.java   (with props)
    incubator/tuscany/sandbox/sebastien/java/sca/modules/scdl/src/main/java/org/apache/tuscany/scdl/ImplementationHandler.java   (with props)
    incubator/tuscany/sandbox/sebastien/java/sca/modules/scdl/src/main/java/org/apache/tuscany/scdl/InterfaceHandler.java   (with props)
    incubator/tuscany/sandbox/sebastien/java/sca/modules/scdl/src/main/java/org/apache/tuscany/scdl/impl/
    incubator/tuscany/sandbox/sebastien/java/sca/modules/scdl/src/main/java/org/apache/tuscany/scdl/impl/ComponentTypeHandler.java   (with props)
    incubator/tuscany/sandbox/sebastien/java/sca/modules/scdl/src/main/java/org/apache/tuscany/scdl/impl/ComponentTypeWriter.java   (with props)
    incubator/tuscany/sandbox/sebastien/java/sca/modules/scdl/src/main/java/org/apache/tuscany/scdl/impl/CompositeHandler.java   (with props)
    incubator/tuscany/sandbox/sebastien/java/sca/modules/scdl/src/main/java/org/apache/tuscany/scdl/impl/CompositeWriter.java   (with props)
    incubator/tuscany/sandbox/sebastien/java/sca/modules/scdl/src/main/java/org/apache/tuscany/scdl/impl/ConstrainingTypeHandler.java   (with props)
    incubator/tuscany/sandbox/sebastien/java/sca/modules/scdl/src/main/java/org/apache/tuscany/scdl/impl/ConstrainingTypeWriter.java   (with props)
    incubator/tuscany/sandbox/sebastien/java/sca/modules/scdl/src/main/java/org/apache/tuscany/scdl/impl/DefaultContentHandlerRegistry.java   (with props)
    incubator/tuscany/sandbox/sebastien/java/sca/modules/scdl/src/main/java/org/apache/tuscany/scdl/util/
    incubator/tuscany/sandbox/sebastien/java/sca/modules/scdl/src/main/java/org/apache/tuscany/scdl/util/Attr.java   (with props)
    incubator/tuscany/sandbox/sebastien/java/sca/modules/scdl/src/main/java/org/apache/tuscany/scdl/util/BaseHandler.java   (with props)
    incubator/tuscany/sandbox/sebastien/java/sca/modules/scdl/src/main/java/org/apache/tuscany/scdl/util/BaseWriter.java   (with props)
    incubator/tuscany/sandbox/sebastien/java/sca/modules/scdl/src/main/java/org/apache/tuscany/scdl/util/NamespaceStack.java   (with props)
    incubator/tuscany/sandbox/sebastien/java/sca/modules/scdl/src/test/java/org/apache/tuscany/scdl/ReadTestCase.java   (with props)
    incubator/tuscany/sandbox/sebastien/java/sca/modules/scdl/src/test/java/org/apache/tuscany/scdl/WriteTestCase.java   (with props)
    incubator/tuscany/sandbox/sebastien/java/sca/modules/scdl/src/test/java/org/apache/tuscany/scdl/builder/
    incubator/tuscany/sandbox/sebastien/java/sca/modules/scdl/src/test/java/org/apache/tuscany/scdl/builder/AccountDataService.java   (with props)
    incubator/tuscany/sandbox/sebastien/java/sca/modules/scdl/src/test/java/org/apache/tuscany/scdl/builder/AccountDataServiceImpl.java   (with props)
    incubator/tuscany/sandbox/sebastien/java/sca/modules/scdl/src/test/java/org/apache/tuscany/scdl/builder/AccountService.java   (with props)
    incubator/tuscany/sandbox/sebastien/java/sca/modules/scdl/src/test/java/org/apache/tuscany/scdl/builder/AccountServiceImpl.java   (with props)
    incubator/tuscany/sandbox/sebastien/java/sca/modules/scdl/src/test/java/org/apache/tuscany/scdl/builder/BigBankBuilder.java   (with props)
    incubator/tuscany/sandbox/sebastien/java/sca/modules/scdl/src/test/java/org/apache/tuscany/scdl/builder/BigBankBuilderTestCase.java   (with props)
    incubator/tuscany/sandbox/sebastien/java/sca/modules/scdl/src/test/java/org/apache/tuscany/scdl/builder/StockQuoteService.java   (with props)
    incubator/tuscany/sandbox/sebastien/java/sca/modules/wsdl-scdl/
      - copied from r521361, incubator/tuscany/sandbox/sebastien/java/sca/modules/wsdl/
    incubator/tuscany/sandbox/sebastien/java/sca/modules/wsdl-scdl/pom.xml
      - copied, changed from r521347, incubator/tuscany/sandbox/sebastien/java/sca/modules/wsdl/pom.xml
    incubator/tuscany/sandbox/sebastien/java/sca/modules/wsdl-scdl/src/
      - copied from r521347, incubator/tuscany/sandbox/sebastien/java/sca/modules/wsdl/src/
    incubator/tuscany/sandbox/sebastien/java/sca/modules/wsdl-scdl/src/main/java/org/apache/tuscany/wsdl/scdl/
    incubator/tuscany/sandbox/sebastien/java/sca/modules/wsdl-scdl/src/main/java/org/apache/tuscany/wsdl/scdl/WSDLConstants.java   (with props)
    incubator/tuscany/sandbox/sebastien/java/sca/modules/wsdl-scdl/src/main/java/org/apache/tuscany/wsdl/scdl/WSDLHandler.java   (with props)
    incubator/tuscany/sandbox/sebastien/java/sca/modules/wsdl/src/main/java/org/apache/tuscany/wsdl/model/WSDLFactory.java   (with props)
    incubator/tuscany/sandbox/sebastien/java/sca/modules/wsdl/src/main/java/org/apache/tuscany/wsdl/model/impl/WSDLFactoryImpl.java   (with props)
Removed:
    incubator/tuscany/sandbox/sebastien/java/sca/modules/impl-crud/src/main/java/org/apache/tuscany/impl/
    incubator/tuscany/sandbox/sebastien/java/sca/modules/java-scdl/src/main/java/org/apache/tuscany/java/model/
    incubator/tuscany/sandbox/sebastien/java/sca/modules/scdl/src/main/java/org/apache/tuscany/scdl/reader/
    incubator/tuscany/sandbox/sebastien/java/sca/modules/scdl/src/main/java/org/apache/tuscany/scdl/writer/
    incubator/tuscany/sandbox/sebastien/java/sca/modules/scdl/src/test/java/org/apache/tuscany/assembly/
    incubator/tuscany/sandbox/sebastien/java/sca/modules/scdl/src/test/java/org/apache/tuscany/scdl/reader/
    incubator/tuscany/sandbox/sebastien/java/sca/modules/scdl/src/test/java/org/apache/tuscany/scdl/writer/
    incubator/tuscany/sandbox/sebastien/java/sca/modules/wsdl-scdl/src/main/java/org/apache/tuscany/wsdl/model/
Modified:
    incubator/tuscany/sandbox/sebastien/java/sca/modules/assembly/pom.xml
    incubator/tuscany/sandbox/sebastien/java/sca/modules/assembly/src/main/java/org/apache/tuscany/assembly/model/AbstractReference.java
    incubator/tuscany/sandbox/sebastien/java/sca/modules/assembly/src/main/java/org/apache/tuscany/assembly/model/AbstractService.java
    incubator/tuscany/sandbox/sebastien/java/sca/modules/assembly/src/main/java/org/apache/tuscany/assembly/model/Base.java
    incubator/tuscany/sandbox/sebastien/java/sca/modules/assembly/src/main/java/org/apache/tuscany/assembly/model/CompositeReference.java
    incubator/tuscany/sandbox/sebastien/java/sca/modules/assembly/src/main/java/org/apache/tuscany/assembly/model/Contract.java
    incubator/tuscany/sandbox/sebastien/java/sca/modules/assembly/src/main/java/org/apache/tuscany/assembly/model/Interface.java
    incubator/tuscany/sandbox/sebastien/java/sca/modules/assembly/src/main/java/org/apache/tuscany/assembly/model/Reference.java
    incubator/tuscany/sandbox/sebastien/java/sca/modules/assembly/src/main/java/org/apache/tuscany/assembly/model/Service.java
    incubator/tuscany/sandbox/sebastien/java/sca/modules/assembly/src/main/java/org/apache/tuscany/assembly/model/impl/BaseImpl.java
    incubator/tuscany/sandbox/sebastien/java/sca/modules/assembly/src/main/java/org/apache/tuscany/assembly/model/impl/CompositeReferenceImpl.java
    incubator/tuscany/sandbox/sebastien/java/sca/modules/assembly/src/main/java/org/apache/tuscany/assembly/model/impl/ContractImpl.java
    incubator/tuscany/sandbox/sebastien/java/sca/modules/assembly/src/main/java/org/apache/tuscany/assembly/model/impl/InterfaceImpl.java
    incubator/tuscany/sandbox/sebastien/java/sca/modules/assembly/src/main/java/org/apache/tuscany/assembly/util/PrintUtil.java
    incubator/tuscany/sandbox/sebastien/java/sca/modules/builder/pom.xml
    incubator/tuscany/sandbox/sebastien/java/sca/modules/builder/src/main/java/org/apache/tuscany/assembly/builder/impl/AssemblyBuilderImpl.java
    incubator/tuscany/sandbox/sebastien/java/sca/modules/builder/src/main/java/org/apache/tuscany/assembly/builder/impl/ComponentReferenceBuilderImpl.java
    incubator/tuscany/sandbox/sebastien/java/sca/modules/impl-crud/pom.xml
    incubator/tuscany/sandbox/sebastien/java/sca/modules/java/pom.xml
    incubator/tuscany/sandbox/sebastien/java/sca/modules/java/src/main/java/org/apache/tuscany/java/model/JavaInterface.java
    incubator/tuscany/sandbox/sebastien/java/sca/modules/java/src/main/java/org/apache/tuscany/java/model/impl/JavaImplementationImpl.java
    incubator/tuscany/sandbox/sebastien/java/sca/modules/java/src/main/java/org/apache/tuscany/java/model/impl/JavaInterfaceImpl.java
    incubator/tuscany/sandbox/sebastien/java/sca/modules/pom.xml
    incubator/tuscany/sandbox/sebastien/java/sca/modules/scdl/pom.xml
    incubator/tuscany/sandbox/sebastien/java/sca/modules/wsdl/pom.xml
    incubator/tuscany/sandbox/sebastien/java/sca/modules/wsdl/src/main/java/org/apache/tuscany/wsdl/model/WSDLInterface.java
    incubator/tuscany/sandbox/sebastien/java/sca/modules/wsdl/src/main/java/org/apache/tuscany/wsdl/model/impl/WSDLInterfaceImpl.java

Modified: incubator/tuscany/sandbox/sebastien/java/sca/modules/assembly/pom.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/sebastien/java/sca/modules/assembly/pom.xml?view=diff&rev=521781&r1=521780&r2=521781
==============================================================================
--- incubator/tuscany/sandbox/sebastien/java/sca/modules/assembly/pom.xml (original)
+++ incubator/tuscany/sandbox/sebastien/java/sca/modules/assembly/pom.xml Fri Mar 23 08:57:03 2007
@@ -22,6 +22,7 @@
         <groupId>org.apache.tuscany.sca.modules</groupId>
         <artifactId>parent</artifactId>
         <version>0.1-sandbox-incubating-SNAPSHOT</version>
+        <relativePath>../pom.xml</relativePath>
     </parent>
     <modelVersion>4.0.0</modelVersion>
     <artifactId>tuscany-assembly</artifactId>

Added: incubator/tuscany/sandbox/sebastien/java/sca/modules/assembly/src/main/java/org/apache/tuscany/assembly/model/AbstractContract.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/sebastien/java/sca/modules/assembly/src/main/java/org/apache/tuscany/assembly/model/AbstractContract.java?view=auto&rev=521781
==============================================================================
--- incubator/tuscany/sandbox/sebastien/java/sca/modules/assembly/src/main/java/org/apache/tuscany/assembly/model/AbstractContract.java (added)
+++ incubator/tuscany/sandbox/sebastien/java/sca/modules/assembly/src/main/java/org/apache/tuscany/assembly/model/AbstractContract.java Fri Mar 23 08:57:03 2007
@@ -0,0 +1,66 @@
+/*
+ * 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.assembly.model;
+
+import org.apache.tuscany.policy.model.IntentAttachPoint;
+
+
+/**
+ * Interface contracts define one or more business functions.  These business functions are
+ * provided by services and are used by references.
+ */
+public interface AbstractContract extends Base, IntentAttachPoint {
+
+    /**
+     * Returns the name of the contract.
+     * @return the name of the contract
+     */
+    String getName();
+
+    /**
+     * Sets the name of the contract.
+     * @param name the name of the contract
+     */
+    void setName(String name);
+
+    /**
+     * Returns the interface definition representing the interface for invocations from the requestor to the provider.
+     * @return the interface definition representing the interface for invocations from the requestor to the provider
+     */
+    Interface getInterface();
+
+    /**
+     * Sets the interface definition representing the interface for invocations from the requestor to the provider.
+     * @param callInterface the interface definition representing the interface for invocations from the requestor to the provider
+     */
+    void setInterface(Interface callInterface);
+    
+    /**
+     * Returns the interface definition representing the interface for invocations from the provider to the requestor.
+     * @return the interface definition representing the interface for invocations from the provider to the requestor.
+     */
+    Interface getCallbackInterface();
+
+    /**
+     * Sets the interface definition representing the interface for invocations from the provider to the requestor.
+     * @param callbackInterface the interface definition representing the interface for invocations from the provider to the requestor.
+     */
+    void setCallbackInterface(Interface callbackInterface);
+
+}

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

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

Modified: incubator/tuscany/sandbox/sebastien/java/sca/modules/assembly/src/main/java/org/apache/tuscany/assembly/model/AbstractReference.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/sebastien/java/sca/modules/assembly/src/main/java/org/apache/tuscany/assembly/model/AbstractReference.java?view=diff&rev=521781&r1=521780&r2=521781
==============================================================================
--- incubator/tuscany/sandbox/sebastien/java/sca/modules/assembly/src/main/java/org/apache/tuscany/assembly/model/AbstractReference.java (original)
+++ incubator/tuscany/sandbox/sebastien/java/sca/modules/assembly/src/main/java/org/apache/tuscany/assembly/model/AbstractReference.java Fri Mar 23 08:57:03 2007
@@ -24,7 +24,7 @@
 /**
  * Represents a reference contract.
  */
-public interface AbstractReference extends Contract {
+public interface AbstractReference extends AbstractContract {
 
     /**
      * Returns the multiplicity allowed for wires connected to this reference.

Modified: incubator/tuscany/sandbox/sebastien/java/sca/modules/assembly/src/main/java/org/apache/tuscany/assembly/model/AbstractService.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/sebastien/java/sca/modules/assembly/src/main/java/org/apache/tuscany/assembly/model/AbstractService.java?view=diff&rev=521781&r1=521780&r2=521781
==============================================================================
--- incubator/tuscany/sandbox/sebastien/java/sca/modules/assembly/src/main/java/org/apache/tuscany/assembly/model/AbstractService.java (original)
+++ incubator/tuscany/sandbox/sebastien/java/sca/modules/assembly/src/main/java/org/apache/tuscany/assembly/model/AbstractService.java Fri Mar 23 08:57:03 2007
@@ -24,6 +24,6 @@
 /**
  * Represents a service contract.
  */
-public interface AbstractService extends Contract {
+public interface AbstractService extends AbstractContract {
 
 }

Modified: incubator/tuscany/sandbox/sebastien/java/sca/modules/assembly/src/main/java/org/apache/tuscany/assembly/model/Base.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/sebastien/java/sca/modules/assembly/src/main/java/org/apache/tuscany/assembly/model/Base.java?view=diff&rev=521781&r1=521780&r2=521781
==============================================================================
--- incubator/tuscany/sandbox/sebastien/java/sca/modules/assembly/src/main/java/org/apache/tuscany/assembly/model/Base.java (original)
+++ incubator/tuscany/sandbox/sebastien/java/sca/modules/assembly/src/main/java/org/apache/tuscany/assembly/model/Base.java Fri Mar 23 08:57:03 2007
@@ -32,15 +32,15 @@
     List<?> getExtensions();
 
     /**
-     * Returns true if the model element is undefined.
-     * @return true if the model element is undefined.
+     * Returns true if the model element is unresolved.
+     * @return true if the model element is unresolved.
      */
-    boolean isUndefined();
+    boolean isUnresolved();
     
     /**
-     * Sets whether the model element is undefined.
-     * @param undefined whether the model element is undefined
+     * Sets whether the model element is unresolved.
+     * @param unresolved whether the model element is unresolved
      */
-    void setUndefined(boolean undefined);
+    void setUnresolved(boolean unresolved);
 
 }

Modified: incubator/tuscany/sandbox/sebastien/java/sca/modules/assembly/src/main/java/org/apache/tuscany/assembly/model/CompositeReference.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/sebastien/java/sca/modules/assembly/src/main/java/org/apache/tuscany/assembly/model/CompositeReference.java?view=diff&rev=521781&r1=521780&r2=521781
==============================================================================
--- incubator/tuscany/sandbox/sebastien/java/sca/modules/assembly/src/main/java/org/apache/tuscany/assembly/model/CompositeReference.java (original)
+++ incubator/tuscany/sandbox/sebastien/java/sca/modules/assembly/src/main/java/org/apache/tuscany/assembly/model/CompositeReference.java Fri Mar 23 08:57:03 2007
@@ -33,10 +33,4 @@
      */
     List<ComponentReference> getPromotedReferences();
     
-    /**
-     * Returns the bindings supported for callbacks. 
-     * @return the bindings supported for callbacks
-     */
-    List<Binding> getCallbackBindings();
-    
 }

Modified: incubator/tuscany/sandbox/sebastien/java/sca/modules/assembly/src/main/java/org/apache/tuscany/assembly/model/Contract.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/sebastien/java/sca/modules/assembly/src/main/java/org/apache/tuscany/assembly/model/Contract.java?view=diff&rev=521781&r1=521780&r2=521781
==============================================================================
--- incubator/tuscany/sandbox/sebastien/java/sca/modules/assembly/src/main/java/org/apache/tuscany/assembly/model/Contract.java (original)
+++ incubator/tuscany/sandbox/sebastien/java/sca/modules/assembly/src/main/java/org/apache/tuscany/assembly/model/Contract.java Fri Mar 23 08:57:03 2007
@@ -18,49 +18,32 @@
  */
 package org.apache.tuscany.assembly.model;
 
-import org.apache.tuscany.policy.model.IntentAttachPoint;
+import java.util.List;
+
+import org.apache.tuscany.policy.model.PolicySetAttachPoint;
 
 
 /**
- * Interface contracts define one or more business functions.  These business functions are
- * provided by services and are used by references.
+ * Represents a contract. A contract can be either a service or a reference.
  */
-public interface Contract extends Base, IntentAttachPoint {
-
-    /**
-     * Returns the name of the contract.
-     * @return the name of the contract
-     */
-    String getName();
-
-    /**
-     * Sets the name of the contract.
-     * @param name the name of the contract
-     */
-    void setName(String name);
-
-    /**
-     * Returns the interface definition representing the interface for invocations from the requestor to the provider.
-     * @return the interface definition representing the interface for invocations from the requestor to the provider
-     */
-    Interface getInterface();
-
+public interface Contract extends AbstractContract, PolicySetAttachPoint {
+    
     /**
-     * Sets the interface definition representing the interface for invocations from the requestor to the provider.
-     * @param callInterface the interface definition representing the interface for invocations from the requestor to the provider
+     * Returns the bindings supported by this contract.
+     * @return the bindings supported by this contract
      */
-    void setInterface(Interface callInterface);
+    List<Binding> getBindings();
     
     /**
-     * Returns the interface definition representing the interface for invocations from the provider to the requestor.
-     * @return the interface definition representing the interface for invocations from the provider to the requestor.
+     * Returns a callback definition of the bindings to use for callbacks. 
+     * @return a definition of the bindings to use for callbacks
      */
-    Interface getCallbackInterface();
+    Callback getCallback();
 
     /**
-     * Sets the interface definition representing the interface for invocations from the provider to the requestor.
-     * @param callbackInterface the interface definition representing the interface for invocations from the provider to the requestor.
+     * Sets a callback definition of the bindings to use for callbacks
+     * @param callback a definition of the bindings to use for callbacks
      */
-    void setCallbackInterface(Interface callbackInterface);
-
+    void setCallback(Callback callback);
+    
 }

Modified: incubator/tuscany/sandbox/sebastien/java/sca/modules/assembly/src/main/java/org/apache/tuscany/assembly/model/Interface.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/sebastien/java/sca/modules/assembly/src/main/java/org/apache/tuscany/assembly/model/Interface.java?view=diff&rev=521781&r1=521780&r2=521781
==============================================================================
--- incubator/tuscany/sandbox/sebastien/java/sca/modules/assembly/src/main/java/org/apache/tuscany/assembly/model/Interface.java (original)
+++ incubator/tuscany/sandbox/sebastien/java/sca/modules/assembly/src/main/java/org/apache/tuscany/assembly/model/Interface.java Fri Mar 23 08:57:03 2007
@@ -25,7 +25,7 @@
  * 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 extends IntentAttachPoint {
+public interface Interface extends Base, IntentAttachPoint {
 
     /**
      * Returns true if the interface is conversational. 
@@ -40,15 +40,15 @@
     void setConversational(boolean conversational);
     
     /**
-     * Returns true if the interface is a local interface.. 
-     * @return true if the interface is a local interface
+     * Returns true if the interface is a remotable interface.. 
+     * @return true if the interface is a remotable interface
      */
-    boolean isLocal();
+    boolean isRemotable();
 
     /**
-    * Sets whether the interface is a local or remotable interface. 
-    * @param local indicates whether the interface is local or remotable
+    * Sets whether the interface is a remotable or local interface. 
+    * @param remotable indicates whether the interface is remotable or local
      */
-    void setLocal(boolean local);
+    void setRemotable(boolean remotable);
     
 }

Modified: incubator/tuscany/sandbox/sebastien/java/sca/modules/assembly/src/main/java/org/apache/tuscany/assembly/model/Reference.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/sebastien/java/sca/modules/assembly/src/main/java/org/apache/tuscany/assembly/model/Reference.java?view=diff&rev=521781&r1=521780&r2=521781
==============================================================================
--- incubator/tuscany/sandbox/sebastien/java/sca/modules/assembly/src/main/java/org/apache/tuscany/assembly/model/Reference.java (original)
+++ incubator/tuscany/sandbox/sebastien/java/sca/modules/assembly/src/main/java/org/apache/tuscany/assembly/model/Reference.java Fri Mar 23 08:57:03 2007
@@ -20,14 +20,12 @@
 
 import java.util.List;
 
-import org.apache.tuscany.policy.model.PolicySetAttachPoint;
-
 
 /**
  * Represents a reference. References within an implementation represent
  * links to services that the implementation uses that must be provided by other components.
  */
-public interface Reference extends AbstractReference, PolicySetAttachPoint {
+public interface Reference extends AbstractReference, Contract {
 	
 	/**
 	 * Returns a boolean value, "false" by default, which indicates that the implementation wires this
@@ -44,27 +42,9 @@
 	void setWiredByImpl(boolean wiredByImpl);
     
     /**
-     * Returns the bindings supported by this reference.
-     * @return the bindings supported by this reference
-     */
-    List<Binding> getBindings();
-
-    /**
      * Returns the targets of this reference.
      * @return the targets of this reference.
      */
     List<ComponentService> getTargets();
-    
-    /**
-     * Returns a callback definition of the bindings to use for callbacks. 
-     * @return a definition of the bindings to use for callbacks
-     */
-    Callback getCallback();
-
-    /**
-     * Sets a callback definition of the bindings to use for callbacks
-     * @param callback a definition of the bindings to use for callbacks
-     */
-    void setCallback(Callback callback);
     
 }

Modified: incubator/tuscany/sandbox/sebastien/java/sca/modules/assembly/src/main/java/org/apache/tuscany/assembly/model/Service.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/sebastien/java/sca/modules/assembly/src/main/java/org/apache/tuscany/assembly/model/Service.java?view=diff&rev=521781&r1=521780&r2=521781
==============================================================================
--- incubator/tuscany/sandbox/sebastien/java/sca/modules/assembly/src/main/java/org/apache/tuscany/assembly/model/Service.java (original)
+++ incubator/tuscany/sandbox/sebastien/java/sca/modules/assembly/src/main/java/org/apache/tuscany/assembly/model/Service.java Fri Mar 23 08:57:03 2007
@@ -18,33 +18,11 @@
  */
 package org.apache.tuscany.assembly.model;
 
-import java.util.List;
-
-import org.apache.tuscany.policy.model.PolicySetAttachPoint;
-
 
 /**
  * Represents a service. Services are used to publish services provided by
  * implementations, so that they are addressable by other components.
  */
-public interface Service extends AbstractService, PolicySetAttachPoint {
-    
-    /**
-     * Returns the bindings supported by this service.
-     * @return the bindings supported by this service
-     */
-    List<Binding> getBindings();
-    
-    /**
-     * Returns a callback definition of the bindings to use for callbacks. 
-     * @return a definition of the bindings to use for callbacks
-     */
-    Callback getCallback();
-
-    /**
-     * Sets a callback definition of the bindings to use for callbacks
-     * @param callback a definition of the bindings to use for callbacks
-     */
-    void setCallback(Callback callback);
+public interface Service extends AbstractService, Contract {
     
 }

Modified: incubator/tuscany/sandbox/sebastien/java/sca/modules/assembly/src/main/java/org/apache/tuscany/assembly/model/impl/BaseImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/sebastien/java/sca/modules/assembly/src/main/java/org/apache/tuscany/assembly/model/impl/BaseImpl.java?view=diff&rev=521781&r1=521780&r2=521781
==============================================================================
--- incubator/tuscany/sandbox/sebastien/java/sca/modules/assembly/src/main/java/org/apache/tuscany/assembly/model/impl/BaseImpl.java (original)
+++ incubator/tuscany/sandbox/sebastien/java/sca/modules/assembly/src/main/java/org/apache/tuscany/assembly/model/impl/BaseImpl.java Fri Mar 23 08:57:03 2007
@@ -30,18 +30,18 @@
  */
 public class BaseImpl implements Base {
 	private List<?> extensions = new ArrayList();
-	private boolean undefined = false;
+	private boolean unresolved = false;
 
 	public List<?> getExtensions() {
 		return extensions;
 	}
 
-	public boolean isUndefined() {
-		return undefined;
+	public boolean isUnresolved() {
+		return unresolved;
 	}
 
-	public void setUndefined(boolean undefined) {
-		this.undefined = undefined;
+	public void setUnresolved(boolean undefined) {
+		this.unresolved = undefined;
 	}
 
 }

Modified: incubator/tuscany/sandbox/sebastien/java/sca/modules/assembly/src/main/java/org/apache/tuscany/assembly/model/impl/CompositeReferenceImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/sebastien/java/sca/modules/assembly/src/main/java/org/apache/tuscany/assembly/model/impl/CompositeReferenceImpl.java?view=diff&rev=521781&r1=521780&r2=521781
==============================================================================
--- incubator/tuscany/sandbox/sebastien/java/sca/modules/assembly/src/main/java/org/apache/tuscany/assembly/model/impl/CompositeReferenceImpl.java (original)
+++ incubator/tuscany/sandbox/sebastien/java/sca/modules/assembly/src/main/java/org/apache/tuscany/assembly/model/impl/CompositeReferenceImpl.java Fri Mar 23 08:57:03 2007
@@ -22,7 +22,6 @@
 import java.util.ArrayList;
 import java.util.List;
 
-import org.apache.tuscany.assembly.model.Binding;
 import org.apache.tuscany.assembly.model.ComponentReference;
 import org.apache.tuscany.assembly.model.CompositeReference;
 
@@ -32,12 +31,7 @@
  *  @version $Rev$ $Date$
  */
 public class CompositeReferenceImpl extends ReferenceImpl implements CompositeReference {
-	private List<Binding> callbackBindings = new ArrayList<Binding>();
 	private List<ComponentReference> promotedReferences = new ArrayList<ComponentReference>();
-
-	public List<Binding> getCallbackBindings() {
-		return callbackBindings;
-	}
 
 	public List<ComponentReference> getPromotedReferences() {
 		return promotedReferences;

Modified: incubator/tuscany/sandbox/sebastien/java/sca/modules/assembly/src/main/java/org/apache/tuscany/assembly/model/impl/ContractImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/sebastien/java/sca/modules/assembly/src/main/java/org/apache/tuscany/assembly/model/impl/ContractImpl.java?view=diff&rev=521781&r1=521780&r2=521781
==============================================================================
--- incubator/tuscany/sandbox/sebastien/java/sca/modules/assembly/src/main/java/org/apache/tuscany/assembly/model/impl/ContractImpl.java (original)
+++ incubator/tuscany/sandbox/sebastien/java/sca/modules/assembly/src/main/java/org/apache/tuscany/assembly/model/impl/ContractImpl.java Fri Mar 23 08:57:03 2007
@@ -21,11 +21,11 @@
 import java.util.ArrayList;
 import java.util.List;
 
-import org.apache.tuscany.assembly.model.Contract;
+import org.apache.tuscany.assembly.model.AbstractContract;
 import org.apache.tuscany.assembly.model.Interface;
 import org.apache.tuscany.policy.model.Intent;
 
-public class ContractImpl extends BaseImpl implements Contract {
+public class ContractImpl extends BaseImpl implements AbstractContract {
 	private Interface callbackInterface;
 	private Interface callInterface;
 	private String name;

Modified: incubator/tuscany/sandbox/sebastien/java/sca/modules/assembly/src/main/java/org/apache/tuscany/assembly/model/impl/InterfaceImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/sebastien/java/sca/modules/assembly/src/main/java/org/apache/tuscany/assembly/model/impl/InterfaceImpl.java?view=diff&rev=521781&r1=521780&r2=521781
==============================================================================
--- incubator/tuscany/sandbox/sebastien/java/sca/modules/assembly/src/main/java/org/apache/tuscany/assembly/model/impl/InterfaceImpl.java (original)
+++ incubator/tuscany/sandbox/sebastien/java/sca/modules/assembly/src/main/java/org/apache/tuscany/assembly/model/impl/InterfaceImpl.java Fri Mar 23 08:57:03 2007
@@ -27,23 +27,23 @@
 public abstract class InterfaceImpl extends BaseImpl implements Interface {
 	
 	private boolean conversational;
-	private boolean local;
+	private boolean remotable;
 	List<Intent> requiredIntents = new ArrayList<Intent>();
 
 	public boolean isConversational() {
 		return conversational;
 	}
 
-	public boolean isLocal() {
-		return local;
+	public boolean isRemotable() {
+		return remotable;
 	}
 
 	public void setConversational(boolean conversational) {
 		this.conversational = conversational;
 	}
 
-	public void setLocal(boolean local) {
-		this.local = local;
+	public void setRemotable(boolean local) {
+		this.remotable = local;
 	}
 
 	public List<Intent> getRequiredIntents() {

Added: incubator/tuscany/sandbox/sebastien/java/sca/modules/assembly/src/main/java/org/apache/tuscany/assembly/util/CompositeUtil.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/sebastien/java/sca/modules/assembly/src/main/java/org/apache/tuscany/assembly/util/CompositeUtil.java?view=auto&rev=521781
==============================================================================
--- incubator/tuscany/sandbox/sebastien/java/sca/modules/assembly/src/main/java/org/apache/tuscany/assembly/util/CompositeUtil.java (added)
+++ incubator/tuscany/sandbox/sebastien/java/sca/modules/assembly/src/main/java/org/apache/tuscany/assembly/util/CompositeUtil.java Fri Mar 23 08:57:03 2007
@@ -0,0 +1,230 @@
+/*
+ * 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.assembly.util;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.tuscany.assembly.model.AssemblyFactory;
+import org.apache.tuscany.assembly.model.Base;
+import org.apache.tuscany.assembly.model.Component;
+import org.apache.tuscany.assembly.model.ComponentReference;
+import org.apache.tuscany.assembly.model.ComponentService;
+import org.apache.tuscany.assembly.model.Composite;
+import org.apache.tuscany.assembly.model.CompositeReference;
+import org.apache.tuscany.assembly.model.CompositeService;
+import org.apache.tuscany.assembly.model.Implementation;
+import org.apache.tuscany.assembly.model.Reference;
+import org.apache.tuscany.assembly.model.Service;
+import org.apache.tuscany.assembly.model.Wire;
+
+/**
+ * A temporary utility class that resolves wires in a composite.
+ *
+ *  @version $Rev$ $Date$
+ */
+public class CompositeUtil {
+
+	private AssemblyFactory assemblyFactory;
+	private Composite composite;
+	
+	public CompositeUtil(AssemblyFactory assemblyFactory, Composite composite) {
+		this.assemblyFactory = assemblyFactory;
+		this.composite = composite;
+	}
+	
+	public void configure(List<Base> problems) {
+		if (problems == null) {
+			problems = new ArrayList<Base>();
+		}
+		init(problems);
+		wire(problems);
+	}
+	
+	private void init(List<Base> problems) {
+		
+		// Init all component services and references
+		for (Component component: composite.getComponents()) {
+			Map<String, Service> services = new HashMap<String, Service>();
+			Map<String, Reference> references = new HashMap<String, Reference>();
+			
+			// Index services and references
+			Implementation implementation = component.getImplementation();
+			if (implementation != null) {
+				for (Service service: implementation.getServices()) {
+					services.put(service.getName(), service);
+				}
+				for (Reference reference: implementation.getReferences()) {
+					references.put(reference.getName(), reference);
+				}
+			}
+			
+			// Index component services and references
+			Map<String, ComponentService> cservices = new HashMap<String, ComponentService>();
+			Map<String, ComponentReference> creferences = new HashMap<String, ComponentReference>();
+			for (ComponentService componentService: component.getServices()) {
+				cservices.put(componentService.getName(), componentService);
+			}
+			for (ComponentReference componentReference: component.getReferences()) {
+				creferences.put(componentReference.getName(), componentReference);
+			}
+			
+			// Reconcile component services/references and implementation services/references
+			for (ComponentService componentService: cservices.values()) {
+				Service service = services.get(componentService.getName());
+				if (service != null) {
+					componentService.setService(service);
+				} else {
+					problems.add(componentService);
+				}
+			}
+			for (ComponentReference componentReference: creferences.values()) {
+				Reference reference = references.get(componentReference.getName());
+				if (reference != null) {
+					componentReference.setReference(reference);
+				} else {
+					problems.add(componentReference);
+				}
+			}
+			
+			// Create component services/references for the services/references declared by
+			// the implementation
+			for (Service service: services.values()) {
+				if (!cservices.containsKey(service.getName())) {
+					ComponentService componentService = assemblyFactory.createComponentService();
+					componentService.setName(service.getName());
+					componentService.setService(service);
+					component.getServices().add(componentService);
+				}
+			}
+			for (Reference reference: references.values()) {
+				if (!cservices.containsKey(reference.getName())) {
+					ComponentReference componentReference = assemblyFactory.createComponentReference();
+					componentReference.setName(reference.getName());
+					componentReference.setReference(reference);
+					component.getReferences().add(componentReference);
+				}
+			}
+		}
+	}
+	
+	private void wire(List<Base> problems) {
+		
+		// Index all component services and references
+		Map<String, ComponentService> componentServices = new HashMap<String, ComponentService>();
+		Map<String, ComponentReference> componentReferences = new HashMap<String, ComponentReference>();
+		for (Component component: composite.getComponents()) {
+			int i = 0;
+			for (ComponentService componentService: component.getServices()) {
+				if (i == 0) {
+					componentServices.put(component.getName(), componentService);
+				}
+				i++;
+				componentServices.put(component.getName() + '/' + componentService.getName(), componentService);
+			}
+			for (ComponentReference componentReference: component.getReferences()) {
+				componentReferences.put(component.getName() + '/' + componentReference.getName(), componentReference);
+			}
+		}
+		
+		// Resolve promoted services and references
+		for (Service service: composite.getServices()) {
+			CompositeService compositeService = (CompositeService)service;
+			ComponentService componentService = compositeService.getPromotedService();
+			if (componentService != null && componentService.isUnresolved()) {
+				ComponentService resolved = componentServices.get(componentService.getName());
+				if (resolved != null) {
+					compositeService.setPromotedService(resolved);
+				} else {
+					problems.add(compositeService);
+				}
+			}
+		}
+		for (Reference reference: composite.getReferences()) {
+			CompositeReference compositeReference = (CompositeReference)reference;
+			List<ComponentReference> promotedReferences = compositeReference.getPromotedReferences();
+			for (int i =0, n = promotedReferences.size(); i <  n; i++) {
+				ComponentReference componentReference = promotedReferences.get(i);
+				if (componentReference.isUnresolved()) {
+					ComponentReference resolved = componentReferences.get(componentReference.getName());
+					if (resolved != null) {
+						promotedReferences.set(i, resolved);
+					} else {
+						problems.add(compositeReference);
+					}
+				}
+			}
+		}
+		
+		// Wire references to their targets
+		for (ComponentReference componentReference: componentReferences.values()) {
+			List<ComponentService> targets = componentReference.getTargets();
+			for (int i = 0, n = targets.size(); i < n; i++) {
+				ComponentService target = targets.get(i);
+				if (target.isUnresolved()) {
+					ComponentService resolved = componentServices.get(target.getName());
+					if (resolved != null) {
+						targets.set(i, resolved);
+					} else {
+						problems.add(target);
+					}
+				}
+			}
+		}
+
+		// Wire references as specified in wires
+		List<Wire> wires = composite.getWires();
+		for (int i = 0, n = wires.size(); i < n; i++) {
+			Wire wire = wires.get(i);
+			
+			ComponentReference resolvedReference;
+			ComponentService resolvedService;
+			
+			ComponentReference source = wire.getSource();
+			if (source != null && source.isUnresolved()) {
+				resolvedReference = componentReferences.get(source.getName());
+				if (resolvedReference != null) {
+					wire.setSource(resolvedReference);
+				} else {
+					problems.add(source);
+				}
+			} else {
+				resolvedReference = wire.getSource();
+			}
+
+			ComponentService target = wire.getTarget();
+			if (target != null && target.isUnresolved()) {
+				resolvedService = componentServices.get(target.getName());
+				if (resolvedService != null) {
+					wire.setTarget(target);
+				} else {
+					problems.add(source);
+				}
+			} else {
+				resolvedService = wire.getTarget();
+			}
+			if (resolvedReference != null && resolvedService != null) {
+				resolvedReference.getTargets().add(resolvedService);
+			}
+		}
+	}
+	
+}

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

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

Modified: incubator/tuscany/sandbox/sebastien/java/sca/modules/assembly/src/main/java/org/apache/tuscany/assembly/util/PrintUtil.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/sebastien/java/sca/modules/assembly/src/main/java/org/apache/tuscany/assembly/util/PrintUtil.java?view=diff&rev=521781&r1=521780&r2=521781
==============================================================================
--- incubator/tuscany/sandbox/sebastien/java/sca/modules/assembly/src/main/java/org/apache/tuscany/assembly/util/PrintUtil.java (original)
+++ incubator/tuscany/sandbox/sebastien/java/sca/modules/assembly/src/main/java/org/apache/tuscany/assembly/util/PrintUtil.java Fri Mar 23 08:57:03 2007
@@ -95,7 +95,13 @@
 									}
 								} else {
 									level++;
+									indent(level);
+									out.println(pd.getName() + "= {" );
+									level++;
 									print(pv);
+									level--;
+									indent(level);
+									out.println("}");
 									level--;
 								}
 							}

Modified: incubator/tuscany/sandbox/sebastien/java/sca/modules/builder/pom.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/sebastien/java/sca/modules/builder/pom.xml?view=diff&rev=521781&r1=521780&r2=521781
==============================================================================
--- incubator/tuscany/sandbox/sebastien/java/sca/modules/builder/pom.xml (original)
+++ incubator/tuscany/sandbox/sebastien/java/sca/modules/builder/pom.xml Fri Mar 23 08:57:03 2007
@@ -22,6 +22,7 @@
         <groupId>org.apache.tuscany.sca.modules</groupId>
         <artifactId>parent</artifactId>
         <version>0.1-sandbox-incubating-SNAPSHOT</version>
+        <relativePath>../pom.xml</relativePath>
     </parent>
     <modelVersion>4.0.0</modelVersion>
     <artifactId>tuscany-assembly-builder</artifactId>

Modified: incubator/tuscany/sandbox/sebastien/java/sca/modules/builder/src/main/java/org/apache/tuscany/assembly/builder/impl/AssemblyBuilderImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/sebastien/java/sca/modules/builder/src/main/java/org/apache/tuscany/assembly/builder/impl/AssemblyBuilderImpl.java?view=diff&rev=521781&r1=521780&r2=521781
==============================================================================
--- incubator/tuscany/sandbox/sebastien/java/sca/modules/builder/src/main/java/org/apache/tuscany/assembly/builder/impl/AssemblyBuilderImpl.java (original)
+++ incubator/tuscany/sandbox/sebastien/java/sca/modules/builder/src/main/java/org/apache/tuscany/assembly/builder/impl/AssemblyBuilderImpl.java Fri Mar 23 08:57:03 2007
@@ -1,3 +1,21 @@
+/*
+ * 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.assembly.builder.impl;
 
 import javax.xml.namespace.QName;

Modified: incubator/tuscany/sandbox/sebastien/java/sca/modules/builder/src/main/java/org/apache/tuscany/assembly/builder/impl/ComponentReferenceBuilderImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/sebastien/java/sca/modules/builder/src/main/java/org/apache/tuscany/assembly/builder/impl/ComponentReferenceBuilderImpl.java?view=diff&rev=521781&r1=521780&r2=521781
==============================================================================
--- incubator/tuscany/sandbox/sebastien/java/sca/modules/builder/src/main/java/org/apache/tuscany/assembly/builder/impl/ComponentReferenceBuilderImpl.java (original)
+++ incubator/tuscany/sandbox/sebastien/java/sca/modules/builder/src/main/java/org/apache/tuscany/assembly/builder/impl/ComponentReferenceBuilderImpl.java Fri Mar 23 08:57:03 2007
@@ -33,7 +33,7 @@
 	
 	public ComponentReferenceBuilder wiredTo(String target) {
 		ComponentService componentService = new ComponentServiceImpl();
-		componentService.setUndefined(true);
+		componentService.setUnresolved(true);
 		componentService.setName(target);
 		getTargets().add(componentService);
 		return this;

Modified: incubator/tuscany/sandbox/sebastien/java/sca/modules/impl-crud/pom.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/sebastien/java/sca/modules/impl-crud/pom.xml?view=diff&rev=521781&r1=521780&r2=521781
==============================================================================
--- incubator/tuscany/sandbox/sebastien/java/sca/modules/impl-crud/pom.xml (original)
+++ incubator/tuscany/sandbox/sebastien/java/sca/modules/impl-crud/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-impl-crud</artifactId>
+    <artifactId>tuscany-crud</artifactId>
     <name>Apache Tuscany Sample CRUD Implementation Model</name>
     <description>Apache Tuscany Sample CRUD Implementation Model</description>
 
@@ -34,6 +34,17 @@
             <groupId>org.apache.tuscany.sca.modules</groupId>
             <artifactId>tuscany-assembly</artifactId>
             <version>0.1-sandbox-incubating-SNAPSHOT</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.tuscany.sca.modules</groupId>
+            <artifactId>tuscany-java</artifactId>
+            <version>0.1-sandbox-incubating-SNAPSHOT</version>
+        </dependency>
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <version>4.2</version>
+            <scope>test</scope>
         </dependency>
     </dependencies>
 

Added: incubator/tuscany/sandbox/sebastien/java/sca/modules/impl-crud/src/main/java/org/apache/tuscany/crud/CRUD.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/sebastien/java/sca/modules/impl-crud/src/main/java/org/apache/tuscany/crud/CRUD.java?view=auto&rev=521781
==============================================================================
--- incubator/tuscany/sandbox/sebastien/java/sca/modules/impl-crud/src/main/java/org/apache/tuscany/crud/CRUD.java (added)
+++ incubator/tuscany/sandbox/sebastien/java/sca/modules/impl-crud/src/main/java/org/apache/tuscany/crud/CRUD.java Fri Mar 23 08:57:03 2007
@@ -0,0 +1,36 @@
+/*
+ * 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.crud;
+
+/**
+ * The service interface implemented by CRUD components.
+ *
+ *  @version $Rev$ $Date$
+ */
+public interface CRUD {
+	
+	String create(Object resource);
+	
+	Object retrieve(String id);
+	
+	Object update(String id, Object resource);
+	
+	void delete(String id);
+
+}

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

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

Added: incubator/tuscany/sandbox/sebastien/java/sca/modules/impl-crud/src/main/java/org/apache/tuscany/crud/model/CRUDFactory.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/sebastien/java/sca/modules/impl-crud/src/main/java/org/apache/tuscany/crud/model/CRUDFactory.java?view=auto&rev=521781
==============================================================================
--- incubator/tuscany/sandbox/sebastien/java/sca/modules/impl-crud/src/main/java/org/apache/tuscany/crud/model/CRUDFactory.java (added)
+++ incubator/tuscany/sandbox/sebastien/java/sca/modules/impl-crud/src/main/java/org/apache/tuscany/crud/model/CRUDFactory.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.crud.model;
+
+/**
+ * A factory for the CRUD model.
+ *
+ *  @version $Rev$ $Date$
+ */
+public interface CRUDFactory {
+	
+	/**
+	 * Create a new CRUD implementation.
+	 * @return a new CRUD implementation
+	 */
+	CRUDImplementation createCRUDImplementation();
+
+}

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

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

Added: incubator/tuscany/sandbox/sebastien/java/sca/modules/impl-crud/src/main/java/org/apache/tuscany/crud/model/CRUDImplementation.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/sebastien/java/sca/modules/impl-crud/src/main/java/org/apache/tuscany/crud/model/CRUDImplementation.java?view=auto&rev=521781
==============================================================================
--- incubator/tuscany/sandbox/sebastien/java/sca/modules/impl-crud/src/main/java/org/apache/tuscany/crud/model/CRUDImplementation.java (added)
+++ incubator/tuscany/sandbox/sebastien/java/sca/modules/impl-crud/src/main/java/org/apache/tuscany/crud/model/CRUDImplementation.java Fri Mar 23 08:57:03 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.crud.model;
+
+import org.apache.tuscany.assembly.model.Implementation;
+
+/**
+ * Represents a CRUD component implementation.
+ *
+ *  @version $Rev$ $Date$
+ */
+public interface CRUDImplementation extends Implementation {
+
+	/**
+	 * Returns the directory used to store resources managed by this component.
+	 * @return the directory used to store resources managed by this component
+	 */
+	String getDirectory();
+
+	/**
+	 * Sets the directory used to store resources managed by this component.
+	 * @param directory the directory used to store resources managed by this component
+	 */
+	void setDirectory(String directory);
+
+}

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

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

Added: incubator/tuscany/sandbox/sebastien/java/sca/modules/impl-crud/src/main/java/org/apache/tuscany/crud/model/impl/CRUDFactoryImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/sebastien/java/sca/modules/impl-crud/src/main/java/org/apache/tuscany/crud/model/impl/CRUDFactoryImpl.java?view=auto&rev=521781
==============================================================================
--- incubator/tuscany/sandbox/sebastien/java/sca/modules/impl-crud/src/main/java/org/apache/tuscany/crud/model/impl/CRUDFactoryImpl.java (added)
+++ incubator/tuscany/sandbox/sebastien/java/sca/modules/impl-crud/src/main/java/org/apache/tuscany/crud/model/impl/CRUDFactoryImpl.java Fri Mar 23 08:57:03 2007
@@ -0,0 +1,59 @@
+/*
+ * 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.crud.model.impl;
+
+import org.apache.tuscany.assembly.model.AssemblyFactory;
+import org.apache.tuscany.assembly.model.Service;
+import org.apache.tuscany.crud.CRUD;
+import org.apache.tuscany.crud.model.CRUDFactory;
+import org.apache.tuscany.crud.model.CRUDImplementation;
+import org.apache.tuscany.java.model.JavaFactory;
+import org.apache.tuscany.java.model.JavaInterface;
+
+/**
+ * Factory for the CRUD component implementation model.
+ *
+ *  @version $Rev$ $Date$
+ */
+public class CRUDFactoryImpl implements CRUDFactory {
+	
+	private AssemblyFactory assemblyFactory;
+	private JavaFactory javaFactory;
+	
+	public CRUDFactoryImpl(AssemblyFactory assemblyFactory, JavaFactory javaFactory) {
+		this.assemblyFactory = assemblyFactory;
+		this.javaFactory = javaFactory;
+	}
+
+	public CRUDImplementation createCRUDImplementation() {
+		
+		// Create the CRUD implementation
+		CRUDImplementation implementation = new CRUDImplementationImpl();
+		
+		// Create a fixed service, exposed by all CRUD implementations
+		Service service = assemblyFactory.createService();
+		JavaInterface javaInterface = javaFactory.createJavaInterface();
+		javaInterface.setJavaClass(CRUD.class);
+		service.setName("crud");
+		service.setInterface(javaInterface);
+		implementation.getServices().add(service);
+		return implementation;
+	}
+
+}

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

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

Added: incubator/tuscany/sandbox/sebastien/java/sca/modules/impl-crud/src/main/java/org/apache/tuscany/crud/model/impl/CRUDImplementationImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/sebastien/java/sca/modules/impl-crud/src/main/java/org/apache/tuscany/crud/model/impl/CRUDImplementationImpl.java?view=auto&rev=521781
==============================================================================
--- incubator/tuscany/sandbox/sebastien/java/sca/modules/impl-crud/src/main/java/org/apache/tuscany/crud/model/impl/CRUDImplementationImpl.java (added)
+++ incubator/tuscany/sandbox/sebastien/java/sca/modules/impl-crud/src/main/java/org/apache/tuscany/crud/model/impl/CRUDImplementationImpl.java Fri Mar 23 08:57:03 2007
@@ -0,0 +1,41 @@
+/*
+ * 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.crud.model.impl;
+
+import org.apache.tuscany.assembly.model.impl.ComponentTypeImpl;
+import org.apache.tuscany.crud.model.CRUDImplementation;
+
+/**
+ * Represents a CRUD component implementation.
+ *
+ *  @version $Rev$ $Date$
+ */
+public class CRUDImplementationImpl extends ComponentTypeImpl implements CRUDImplementation {
+	
+	private String directory;
+	
+	public String getDirectory() {
+		return directory;
+	}
+
+	public void setDirectory(String directory) {
+		this.directory = directory;
+	}
+	
+}

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

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

Added: incubator/tuscany/sandbox/sebastien/java/sca/modules/impl-crud/src/test/java/org/apache/tuscany/crud/model/CRUDFactoryTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/sebastien/java/sca/modules/impl-crud/src/test/java/org/apache/tuscany/crud/model/CRUDFactoryTestCase.java?view=auto&rev=521781
==============================================================================
--- incubator/tuscany/sandbox/sebastien/java/sca/modules/impl-crud/src/test/java/org/apache/tuscany/crud/model/CRUDFactoryTestCase.java (added)
+++ incubator/tuscany/sandbox/sebastien/java/sca/modules/impl-crud/src/test/java/org/apache/tuscany/crud/model/CRUDFactoryTestCase.java Fri Mar 23 08:57:03 2007
@@ -0,0 +1,41 @@
+/*
+ * 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.crud.model;
+
+import org.apache.tuscany.assembly.model.AssemblyFactory;
+import org.apache.tuscany.assembly.model.impl.AssemblyFactoryImpl;
+import org.apache.tuscany.crud.CRUD;
+import org.apache.tuscany.crud.model.impl.CRUDFactoryImpl;
+import org.apache.tuscany.java.model.JavaFactory;
+import org.apache.tuscany.java.model.JavaInterface;
+import org.apache.tuscany.java.model.impl.JavaFactoryImpl;
+
+import junit.framework.TestCase;
+
+public class CRUDFactoryTestCase extends TestCase {
+	
+	public void testFactory() {
+		AssemblyFactory assemblyFactory = new AssemblyFactoryImpl();
+		JavaFactory javaFactory = new JavaFactoryImpl(assemblyFactory);
+		CRUDFactoryImpl factory = new CRUDFactoryImpl(assemblyFactory, javaFactory);
+		CRUDImplementation implementation = factory.createCRUDImplementation();
+		assertTrue(((JavaInterface)implementation.getServices().get(0).getInterface()).getJavaClass() == CRUD.class);
+	}
+
+}

Propchange: incubator/tuscany/sandbox/sebastien/java/sca/modules/impl-crud/src/test/java/org/apache/tuscany/crud/model/CRUDFactoryTestCase.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/sandbox/sebastien/java/sca/modules/impl-crud/src/test/java/org/apache/tuscany/crud/model/CRUDFactoryTestCase.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

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

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

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

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

Added: incubator/tuscany/sandbox/sebastien/java/sca/modules/java-scdl/src/main/java/org/apache/tuscany/java/scdl/JavaHandler.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/sebastien/java/sca/modules/java-scdl/src/main/java/org/apache/tuscany/java/scdl/JavaHandler.java?view=auto&rev=521781
==============================================================================
--- incubator/tuscany/sandbox/sebastien/java/sca/modules/java-scdl/src/main/java/org/apache/tuscany/java/scdl/JavaHandler.java (added)
+++ incubator/tuscany/sandbox/sebastien/java/sca/modules/java-scdl/src/main/java/org/apache/tuscany/java/scdl/JavaHandler.java Fri Mar 23 08:57:03 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.java.scdl;
+
+import org.apache.tuscany.assembly.model.Implementation;
+import org.apache.tuscany.assembly.model.Interface;
+import org.apache.tuscany.java.model.JavaFactory;
+import org.apache.tuscany.java.model.JavaImplementation;
+import org.apache.tuscany.java.model.JavaInterface;
+import org.apache.tuscany.scdl.Constants;
+import org.apache.tuscany.scdl.ImplementationHandler;
+import org.apache.tuscany.scdl.InterfaceHandler;
+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 JavaHandler extends DefaultHandler implements ImplementationHandler, InterfaceHandler {
+	
+	private JavaFactory javaFactory;
+	private JavaImplementation javaImplementation;
+	private JavaInterface javaInterface;
+	
+	public JavaHandler(JavaFactory javaFactory) {
+		this.javaFactory = javaFactory;
+	}
+	
+	public void startDocument() throws SAXException {
+		javaInterface = null;
+		javaImplementation = null;
+	}
+	
+	public void startElement(String uri, String name, String qname, Attributes attr) throws SAXException {
+		
+		if (Constants.SCA10_NS.equals(uri)) {
+			
+			if (JavaConstants.IMPLEMENTATION_JAVA.equals(name)) {
+				
+				// Parse a Java implementation
+				javaImplementation = javaFactory.createJavaImplementation();
+				javaImplementation.setUnresolved(true);
+				javaImplementation.setName(attr.getValue(JavaConstants.CLASS));
+				
+			} else if (JavaConstants.INTERFACE_JAVA.equals(name)) {
+				
+				// Parse a Java interface
+				javaInterface = javaFactory.createJavaInterface();
+				javaInterface.setUnresolved(true);
+				javaInterface.setName(attr.getValue(JavaConstants.INTERFACE));
+			}
+		}
+	}
+	
+	public Implementation getImplementation() {
+		return javaImplementation;
+	}
+	
+	public Interface getInterface() {
+		return javaInterface;
+	}
+	
+}

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

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

Added: incubator/tuscany/sandbox/sebastien/java/sca/modules/java-scdl/src/test/java/org/apache/tuscany/java/scdl/ReadTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/sebastien/java/sca/modules/java-scdl/src/test/java/org/apache/tuscany/java/scdl/ReadTestCase.java?view=auto&rev=521781
==============================================================================
--- incubator/tuscany/sandbox/sebastien/java/sca/modules/java-scdl/src/test/java/org/apache/tuscany/java/scdl/ReadTestCase.java (added)
+++ incubator/tuscany/sandbox/sebastien/java/sca/modules/java-scdl/src/test/java/org/apache/tuscany/java/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.java.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.CompositeUtil;
+import org.apache.tuscany.assembly.util.PrintUtil;
+import org.apache.tuscany.java.model.impl.JavaFactoryImpl;
+import org.apache.tuscany.scdl.Constants;
+import org.apache.tuscany.scdl.ContentHandlerRegistry;
+import org.apache.tuscany.scdl.ImplementationHandler;
+import org.apache.tuscany.scdl.InterfaceHandler;
+import org.apache.tuscany.scdl.impl.ComponentTypeHandler;
+import org.apache.tuscany.scdl.impl.CompositeHandler;
+import org.apache.tuscany.scdl.impl.ConstrainingTypeHandler;
+import org.apache.tuscany.scdl.impl.DefaultContentHandlerRegistry;
+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 {
+
+    AssemblyFactory assemblyFactory;
+    XMLReader reader;
+    ContentHandlerRegistry<InterfaceHandler> interfaceHandlers;
+    ContentHandlerRegistry<ImplementationHandler> implementationHandlers;
+    
+    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();
+
+        JavaHandler javaHandler = new JavaHandler(new JavaFactoryImpl(assemblyFactory));
+        
+        interfaceHandlers = new DefaultContentHandlerRegistry<InterfaceHandler>();
+        interfaceHandlers.addHandler(Constants.SCA10_NS, JavaConstants.INTERFACE_JAVA, javaHandler);
+        implementationHandlers = new DefaultContentHandlerRegistry<ImplementationHandler>();
+        implementationHandlers.addHandler(Constants.SCA10_NS, JavaConstants.IMPLEMENTATION_JAVA, javaHandler);
+    }
+
+    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, interfaceHandlers);
+        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, interfaceHandlers);
+        reader.setContentHandler(handler);
+        reader.parse(new InputSource(is));
+        assertNotNull(handler.getConstrainingType());
+
+        new PrintUtil(System.out).print(handler.getConstrainingType());
+    }
+    
+    public void testReadComposite() throws Exception {
+        InputStream is = getClass().getClassLoader().getResourceAsStream("Calculator.composite");
+        CompositeHandler handler = new CompositeHandler(assemblyFactory, interfaceHandlers, implementationHandlers, 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/java-scdl/src/test/java/org/apache/tuscany/java/scdl/ReadTestCase.java
------------------------------------------------------------------------------
    svn:eol-style = native

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

Added: incubator/tuscany/sandbox/sebastien/java/sca/modules/java-scdl/src/test/resources/Calculator.composite
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/sebastien/java/sca/modules/java-scdl/src/test/resources/Calculator.composite?view=auto&rev=521781
==============================================================================
--- incubator/tuscany/sandbox/sebastien/java/sca/modules/java-scdl/src/test/resources/Calculator.composite (added)
+++ incubator/tuscany/sandbox/sebastien/java/sca/modules/java-scdl/src/test/resources/Calculator.composite Fri Mar 23 08:57:03 2007
@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.    
+-->
+<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
+	xmlns:calc="http://sample.calculator"
+	name="calc:Calculator">
+
+    <service name="CalculatorService" promote="CalculatorServiceComponent">
+        <interface.java interface="calculator.CalculatorService"/>
+    </service>
+
+    <component name="CalculatorServiceComponent">
+		<implementation.java class="calculator.CalculatorServiceImpl"/>
+        <reference name="addService" target="AddServiceComponent"/>
+        <reference name="subtractService" target="SubtractServiceComponent"/>
+        <reference name="multiplyService" target="MultiplyServiceComponent"/>
+        <reference name="divideService" target="DivideServiceComponent"/>
+    </component>
+
+    <component name="AddServiceComponent">
+        <implementation.java class="calculator.AddServiceImpl"/>
+    </component>
+
+    <component name="SubtractServiceComponent">
+        <implementation.java class="calculator.SubtractServiceImpl"/>
+    </component>
+
+    <component name="MultiplyServiceComponent">
+        <implementation.java class="calculator.MultiplyServiceImpl"/>
+    </component>
+
+    <component name="DivideServiceComponent">
+        <implementation.java class="calculator.DivideServiceImpl"/>
+    </component>
+
+</composite>

Propchange: incubator/tuscany/sandbox/sebastien/java/sca/modules/java-scdl/src/test/resources/Calculator.composite
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/sandbox/sebastien/java/sca/modules/java-scdl/src/test/resources/Calculator.composite
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/tuscany/sandbox/sebastien/java/sca/modules/java-scdl/src/test/resources/CalculatorComponent.constrainingType
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/sebastien/java/sca/modules/java-scdl/src/test/resources/CalculatorComponent.constrainingType?view=auto&rev=521781
==============================================================================
--- incubator/tuscany/sandbox/sebastien/java/sca/modules/java-scdl/src/test/resources/CalculatorComponent.constrainingType (added)
+++ incubator/tuscany/sandbox/sebastien/java/sca/modules/java-scdl/src/test/resources/CalculatorComponent.constrainingType Fri Mar 23 08:57:03 2007
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="ASCII"?>
+<!--
+ * 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.
+-->
+<constrainingType xmlns="http://www.osoa.org/xmlns/sca/1.0"
+	xmlns:calc="http://sample.calculator"
+	name="calc:CalculatorComponent">
+
+  <service name="CalculatorService">
+        <interface.java class="calculator.CalculatorService" />
+  </service>
+
+  <reference name="divideService">
+        <interface.java class="calculator.DivideService" />
+  </reference>  
+
+</constrainingType>              
+       
\ No newline at end of file



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