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 2006/02/20 09:15:26 UTC

svn commit: r379052 [12/16] - in /incubator/tuscany/sandbox/sebastien/java: ./ sca/ sca/model/ sca/model/.settings/ sca/model/src/ sca/model/src/main/ sca/model/src/main/java/ sca/model/src/main/java/org/ sca/model/src/main/java/org/apache/ sca/model/s...

Added: incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/scdl/util/SCDLSwitch.java
URL: http://svn.apache.org/viewcvs/incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/scdl/util/SCDLSwitch.java?rev=379052&view=auto
==============================================================================
--- incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/scdl/util/SCDLSwitch.java (added)
+++ incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/scdl/util/SCDLSwitch.java Mon Feb 20 00:15:10 2006
@@ -0,0 +1,679 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id$
+ */
+package org.apache.tuscany.model.assembly.scdl.util;
+
+import java.util.List;
+
+import org.apache.tuscany.model.assembly.scdl.*;
+
+import org.apache.tuscany.model.assembly.scdl.impl.SCDLPackageImpl;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+
+/**
+ * <!-- begin-user-doc -->
+ * The <b>Switch</b> for the model's inheritance hierarchy.
+ * It supports the call {@link #doSwitch(EObject) doSwitch(object)}
+ * to invoke the <code>caseXXX</code> method for each class of the model,
+ * starting with the actual class of the object
+ * and proceeding up the inheritance hierarchy
+ * until a non-null result is returned,
+ * which is the result of the switch.
+ * <!-- end-user-doc -->
+ * @see org.apache.tuscany.model.assembly.scdl.impl.SCDLPackageImpl
+ * @generated
+ */
+public class SCDLSwitch
+{
+  /**
+   * The cached model package
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   */
+  protected static SCDLPackageImpl modelPackage;
+
+  /**
+   * Creates an instance of the switch.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   */
+  public SCDLSwitch()
+  {
+    if (modelPackage == null)
+    {
+      modelPackage = SCDLPackageImpl.eINSTANCE;
+    }
+  }
+
+  /**
+   * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @return the first non-null result returned by a <code>caseXXX</code> call.
+   * @generated
+   */
+  public Object doSwitch(EObject theEObject)
+  {
+    return doSwitch(theEObject.eClass(), theEObject);
+  }
+
+  /**
+   * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @return the first non-null result returned by a <code>caseXXX</code> call.
+   * @generated
+   */
+  protected Object doSwitch(EClass theEClass, EObject theEObject)
+  {
+    if (theEClass.eContainer() == modelPackage)
+    {
+      return doSwitch(theEClass.getClassifierID(), theEObject);
+    }
+    else
+    {
+      List eSuperTypes = theEClass.getESuperTypes();
+      return
+        eSuperTypes.isEmpty() ?
+          defaultCase(theEObject) :
+          doSwitch((EClass)eSuperTypes.get(0), theEObject);
+    }
+  }
+
+  /**
+   * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @return the first non-null result returned by a <code>caseXXX</code> call.
+   * @generated
+   */
+  protected Object doSwitch(int classifierID, EObject theEObject)
+  {
+    switch (classifierID)
+    {
+      case SCDLPackageImpl.BINDING:
+      {
+        Binding binding = (Binding)theEObject;
+        Object result = caseBinding(binding);
+        if (result == null) result = defaultCase(theEObject);
+        return result;
+      }
+      case SCDLPackageImpl.COMPONENT:
+      {
+        Component component = (Component)theEObject;
+        Object result = caseComponent(component);
+        if (result == null) result = defaultCase(theEObject);
+        return result;
+      }
+      case SCDLPackageImpl.COMPONENT_TYPE:
+      {
+        ComponentType componentType = (ComponentType)theEObject;
+        Object result = caseComponentType(componentType);
+        if (result == null) result = defaultCase(theEObject);
+        return result;
+      }
+      case SCDLPackageImpl.DOCUMENT_ROOT:
+      {
+        DocumentRoot documentRoot = (DocumentRoot)theEObject;
+        Object result = caseDocumentRoot(documentRoot);
+        if (result == null) result = defaultCase(theEObject);
+        return result;
+      }
+      case SCDLPackageImpl.ENTRY_POINT:
+      {
+        EntryPoint entryPoint = (EntryPoint)theEObject;
+        Object result = caseEntryPoint(entryPoint);
+        if (result == null) result = defaultCase(theEObject);
+        return result;
+      }
+      case SCDLPackageImpl.EXTERNAL_SERVICE:
+      {
+        ExternalService externalService = (ExternalService)theEObject;
+        Object result = caseExternalService(externalService);
+        if (result == null) result = defaultCase(theEObject);
+        return result;
+      }
+      case SCDLPackageImpl.IMPLEMENTATION:
+      {
+        Implementation implementation = (Implementation)theEObject;
+        Object result = caseImplementation(implementation);
+        if (result == null) result = defaultCase(theEObject);
+        return result;
+      }
+      case SCDLPackageImpl.INTERFACE:
+      {
+        Interface interface_ = (Interface)theEObject;
+        Object result = caseInterface(interface_);
+        if (result == null) result = defaultCase(theEObject);
+        return result;
+      }
+      case SCDLPackageImpl.JAVA_IMPLEMENTATION:
+      {
+        JavaImplementation javaImplementation = (JavaImplementation)theEObject;
+        Object result = caseJavaImplementation(javaImplementation);
+        if (result == null) result = caseImplementation(javaImplementation);
+        if (result == null) result = defaultCase(theEObject);
+        return result;
+      }
+      case SCDLPackageImpl.JAVA_INTERFACE:
+      {
+        JavaInterface javaInterface = (JavaInterface)theEObject;
+        Object result = caseJavaInterface(javaInterface);
+        if (result == null) result = caseInterface(javaInterface);
+        if (result == null) result = defaultCase(theEObject);
+        return result;
+      }
+      case SCDLPackageImpl.MODULE:
+      {
+        Module module = (Module)theEObject;
+        Object result = caseModule(module);
+        if (result == null) result = caseModuleFragment(module);
+        if (result == null) result = defaultCase(theEObject);
+        return result;
+      }
+      case SCDLPackageImpl.MODULE_COMPONENT:
+      {
+        ModuleComponent moduleComponent = (ModuleComponent)theEObject;
+        Object result = caseModuleComponent(moduleComponent);
+        if (result == null) result = defaultCase(theEObject);
+        return result;
+      }
+      case SCDLPackageImpl.MODULE_FRAGMENT:
+      {
+        ModuleFragment moduleFragment = (ModuleFragment)theEObject;
+        Object result = caseModuleFragment(moduleFragment);
+        if (result == null) result = defaultCase(theEObject);
+        return result;
+      }
+      case SCDLPackageImpl.MODULE_WIRE:
+      {
+        ModuleWire moduleWire = (ModuleWire)theEObject;
+        Object result = caseModuleWire(moduleWire);
+        if (result == null) result = defaultCase(theEObject);
+        return result;
+      }
+      case SCDLPackageImpl.PROPERTY:
+      {
+        Property property = (Property)theEObject;
+        Object result = caseProperty(property);
+        if (result == null) result = defaultCase(theEObject);
+        return result;
+      }
+      case SCDLPackageImpl.PROPERTY_VALUES:
+      {
+        PropertyValues propertyValues = (PropertyValues)theEObject;
+        Object result = casePropertyValues(propertyValues);
+        if (result == null) result = defaultCase(theEObject);
+        return result;
+      }
+      case SCDLPackageImpl.REFERENCE:
+      {
+        Reference reference = (Reference)theEObject;
+        Object result = caseReference(reference);
+        if (result == null) result = defaultCase(theEObject);
+        return result;
+      }
+      case SCDLPackageImpl.REFERENCE_VALUES:
+      {
+        ReferenceValues referenceValues = (ReferenceValues)theEObject;
+        Object result = caseReferenceValues(referenceValues);
+        if (result == null) result = defaultCase(theEObject);
+        return result;
+      }
+      case SCDLPackageImpl.SCA_BINDING:
+      {
+        SCABinding scaBinding = (SCABinding)theEObject;
+        Object result = caseSCABinding(scaBinding);
+        if (result == null) result = caseBinding(scaBinding);
+        if (result == null) result = defaultCase(theEObject);
+        return result;
+      }
+      case SCDLPackageImpl.SERVICE:
+      {
+        Service service = (Service)theEObject;
+        Object result = caseService(service);
+        if (result == null) result = defaultCase(theEObject);
+        return result;
+      }
+      case SCDLPackageImpl.SUBSYSTEM:
+      {
+        Subsystem subsystem = (Subsystem)theEObject;
+        Object result = caseSubsystem(subsystem);
+        if (result == null) result = defaultCase(theEObject);
+        return result;
+      }
+      case SCDLPackageImpl.SYSTEM_WIRE:
+      {
+        SystemWire systemWire = (SystemWire)theEObject;
+        Object result = caseSystemWire(systemWire);
+        if (result == null) result = defaultCase(theEObject);
+        return result;
+      }
+      case SCDLPackageImpl.WEB_SERVICE_BINDING:
+      {
+        WebServiceBinding webServiceBinding = (WebServiceBinding)theEObject;
+        Object result = caseWebServiceBinding(webServiceBinding);
+        if (result == null) result = caseBinding(webServiceBinding);
+        if (result == null) result = defaultCase(theEObject);
+        return result;
+      }
+      case SCDLPackageImpl.WSDL_PORT_TYPE:
+      {
+        WSDLPortType wsdlPortType = (WSDLPortType)theEObject;
+        Object result = caseWSDLPortType(wsdlPortType);
+        if (result == null) result = caseInterface(wsdlPortType);
+        if (result == null) result = defaultCase(theEObject);
+        return result;
+      }
+      default: return defaultCase(theEObject);
+    }
+  }
+
+  /**
+   * Returns the result of interpretting the object as an instance of '<em>Binding</em>'.
+   * <!-- begin-user-doc -->
+   * This implementation returns null;
+   * returning a non-null result will terminate the switch.
+   * <!-- end-user-doc -->
+   * @param object the target of the switch.
+   * @return the result of interpretting the object as an instance of '<em>Binding</em>'.
+   * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+   * @generated
+   */
+  public Object caseBinding(Binding object)
+  {
+    return null;
+  }
+
+  /**
+   * Returns the result of interpretting the object as an instance of '<em>Component</em>'.
+   * <!-- begin-user-doc -->
+   * This implementation returns null;
+   * returning a non-null result will terminate the switch.
+   * <!-- end-user-doc -->
+   * @param object the target of the switch.
+   * @return the result of interpretting the object as an instance of '<em>Component</em>'.
+   * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+   * @generated
+   */
+  public Object caseComponent(Component object)
+  {
+    return null;
+  }
+
+  /**
+   * Returns the result of interpretting the object as an instance of '<em>Component Type</em>'.
+   * <!-- begin-user-doc -->
+   * This implementation returns null;
+   * returning a non-null result will terminate the switch.
+   * <!-- end-user-doc -->
+   * @param object the target of the switch.
+   * @return the result of interpretting the object as an instance of '<em>Component Type</em>'.
+   * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+   * @generated
+   */
+  public Object caseComponentType(ComponentType object)
+  {
+    return null;
+  }
+
+  /**
+   * Returns the result of interpretting the object as an instance of '<em>Document Root</em>'.
+   * <!-- begin-user-doc -->
+   * This implementation returns null;
+   * returning a non-null result will terminate the switch.
+   * <!-- end-user-doc -->
+   * @param object the target of the switch.
+   * @return the result of interpretting the object as an instance of '<em>Document Root</em>'.
+   * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+   * @generated
+   */
+  public Object caseDocumentRoot(DocumentRoot object)
+  {
+    return null;
+  }
+
+  /**
+   * Returns the result of interpretting the object as an instance of '<em>Entry Point</em>'.
+   * <!-- begin-user-doc -->
+   * This implementation returns null;
+   * returning a non-null result will terminate the switch.
+   * <!-- end-user-doc -->
+   * @param object the target of the switch.
+   * @return the result of interpretting the object as an instance of '<em>Entry Point</em>'.
+   * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+   * @generated
+   */
+  public Object caseEntryPoint(EntryPoint object)
+  {
+    return null;
+  }
+
+  /**
+   * Returns the result of interpretting the object as an instance of '<em>External Service</em>'.
+   * <!-- begin-user-doc -->
+   * This implementation returns null;
+   * returning a non-null result will terminate the switch.
+   * <!-- end-user-doc -->
+   * @param object the target of the switch.
+   * @return the result of interpretting the object as an instance of '<em>External Service</em>'.
+   * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+   * @generated
+   */
+  public Object caseExternalService(ExternalService object)
+  {
+    return null;
+  }
+
+  /**
+   * Returns the result of interpretting the object as an instance of '<em>Implementation</em>'.
+   * <!-- begin-user-doc -->
+   * This implementation returns null;
+   * returning a non-null result will terminate the switch.
+   * <!-- end-user-doc -->
+   * @param object the target of the switch.
+   * @return the result of interpretting the object as an instance of '<em>Implementation</em>'.
+   * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+   * @generated
+   */
+  public Object caseImplementation(Implementation object)
+  {
+    return null;
+  }
+
+  /**
+   * Returns the result of interpretting the object as an instance of '<em>Interface</em>'.
+   * <!-- begin-user-doc -->
+   * This implementation returns null;
+   * returning a non-null result will terminate the switch.
+   * <!-- end-user-doc -->
+   * @param object the target of the switch.
+   * @return the result of interpretting the object as an instance of '<em>Interface</em>'.
+   * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+   * @generated
+   */
+  public Object caseInterface(Interface object)
+  {
+    return null;
+  }
+
+  /**
+   * Returns the result of interpretting the object as an instance of '<em>Java Implementation</em>'.
+   * <!-- begin-user-doc -->
+   * This implementation returns null;
+   * returning a non-null result will terminate the switch.
+   * <!-- end-user-doc -->
+   * @param object the target of the switch.
+   * @return the result of interpretting the object as an instance of '<em>Java Implementation</em>'.
+   * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+   * @generated
+   */
+  public Object caseJavaImplementation(JavaImplementation object)
+  {
+    return null;
+  }
+
+  /**
+   * Returns the result of interpretting the object as an instance of '<em>Java Interface</em>'.
+   * <!-- begin-user-doc -->
+   * This implementation returns null;
+   * returning a non-null result will terminate the switch.
+   * <!-- end-user-doc -->
+   * @param object the target of the switch.
+   * @return the result of interpretting the object as an instance of '<em>Java Interface</em>'.
+   * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+   * @generated
+   */
+  public Object caseJavaInterface(JavaInterface object)
+  {
+    return null;
+  }
+
+  /**
+   * Returns the result of interpretting the object as an instance of '<em>Module</em>'.
+   * <!-- begin-user-doc -->
+   * This implementation returns null;
+   * returning a non-null result will terminate the switch.
+   * <!-- end-user-doc -->
+   * @param object the target of the switch.
+   * @return the result of interpretting the object as an instance of '<em>Module</em>'.
+   * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+   * @generated
+   */
+  public Object caseModule(Module object)
+  {
+    return null;
+  }
+
+  /**
+   * Returns the result of interpretting the object as an instance of '<em>Module Component</em>'.
+   * <!-- begin-user-doc -->
+   * This implementation returns null;
+   * returning a non-null result will terminate the switch.
+   * <!-- end-user-doc -->
+   * @param object the target of the switch.
+   * @return the result of interpretting the object as an instance of '<em>Module Component</em>'.
+   * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+   * @generated
+   */
+  public Object caseModuleComponent(ModuleComponent object)
+  {
+    return null;
+  }
+
+  /**
+   * Returns the result of interpretting the object as an instance of '<em>Module Fragment</em>'.
+   * <!-- begin-user-doc -->
+   * This implementation returns null;
+   * returning a non-null result will terminate the switch.
+   * <!-- end-user-doc -->
+   * @param object the target of the switch.
+   * @return the result of interpretting the object as an instance of '<em>Module Fragment</em>'.
+   * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+   * @generated
+   */
+  public Object caseModuleFragment(ModuleFragment object)
+  {
+    return null;
+  }
+
+  /**
+   * Returns the result of interpretting the object as an instance of '<em>Module Wire</em>'.
+   * <!-- begin-user-doc -->
+   * This implementation returns null;
+   * returning a non-null result will terminate the switch.
+   * <!-- end-user-doc -->
+   * @param object the target of the switch.
+   * @return the result of interpretting the object as an instance of '<em>Module Wire</em>'.
+   * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+   * @generated
+   */
+  public Object caseModuleWire(ModuleWire object)
+  {
+    return null;
+  }
+
+  /**
+   * Returns the result of interpretting the object as an instance of '<em>Property</em>'.
+   * <!-- begin-user-doc -->
+   * This implementation returns null;
+   * returning a non-null result will terminate the switch.
+   * <!-- end-user-doc -->
+   * @param object the target of the switch.
+   * @return the result of interpretting the object as an instance of '<em>Property</em>'.
+   * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+   * @generated
+   */
+  public Object caseProperty(Property object)
+  {
+    return null;
+  }
+
+  /**
+   * Returns the result of interpretting the object as an instance of '<em>Property Values</em>'.
+   * <!-- begin-user-doc -->
+   * This implementation returns null;
+   * returning a non-null result will terminate the switch.
+   * <!-- end-user-doc -->
+   * @param object the target of the switch.
+   * @return the result of interpretting the object as an instance of '<em>Property Values</em>'.
+   * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+   * @generated
+   */
+  public Object casePropertyValues(PropertyValues object)
+  {
+    return null;
+  }
+
+  /**
+   * Returns the result of interpretting the object as an instance of '<em>Reference</em>'.
+   * <!-- begin-user-doc -->
+   * This implementation returns null;
+   * returning a non-null result will terminate the switch.
+   * <!-- end-user-doc -->
+   * @param object the target of the switch.
+   * @return the result of interpretting the object as an instance of '<em>Reference</em>'.
+   * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+   * @generated
+   */
+  public Object caseReference(Reference object)
+  {
+    return null;
+  }
+
+  /**
+   * Returns the result of interpretting the object as an instance of '<em>Reference Values</em>'.
+   * <!-- begin-user-doc -->
+   * This implementation returns null;
+   * returning a non-null result will terminate the switch.
+   * <!-- end-user-doc -->
+   * @param object the target of the switch.
+   * @return the result of interpretting the object as an instance of '<em>Reference Values</em>'.
+   * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+   * @generated
+   */
+  public Object caseReferenceValues(ReferenceValues object)
+  {
+    return null;
+  }
+
+  /**
+   * Returns the result of interpretting the object as an instance of '<em>SCA Binding</em>'.
+   * <!-- begin-user-doc -->
+   * This implementation returns null;
+   * returning a non-null result will terminate the switch.
+   * <!-- end-user-doc -->
+   * @param object the target of the switch.
+   * @return the result of interpretting the object as an instance of '<em>SCA Binding</em>'.
+   * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+   * @generated
+   */
+  public Object caseSCABinding(SCABinding object)
+  {
+    return null;
+  }
+
+  /**
+   * Returns the result of interpretting the object as an instance of '<em>Service</em>'.
+   * <!-- begin-user-doc -->
+   * This implementation returns null;
+   * returning a non-null result will terminate the switch.
+   * <!-- end-user-doc -->
+   * @param object the target of the switch.
+   * @return the result of interpretting the object as an instance of '<em>Service</em>'.
+   * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+   * @generated
+   */
+  public Object caseService(Service object)
+  {
+    return null;
+  }
+
+  /**
+   * Returns the result of interpretting the object as an instance of '<em>Subsystem</em>'.
+   * <!-- begin-user-doc -->
+   * This implementation returns null;
+   * returning a non-null result will terminate the switch.
+   * <!-- end-user-doc -->
+   * @param object the target of the switch.
+   * @return the result of interpretting the object as an instance of '<em>Subsystem</em>'.
+   * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+   * @generated
+   */
+  public Object caseSubsystem(Subsystem object)
+  {
+    return null;
+  }
+
+  /**
+   * Returns the result of interpretting the object as an instance of '<em>System Wire</em>'.
+   * <!-- begin-user-doc -->
+   * This implementation returns null;
+   * returning a non-null result will terminate the switch.
+   * <!-- end-user-doc -->
+   * @param object the target of the switch.
+   * @return the result of interpretting the object as an instance of '<em>System Wire</em>'.
+   * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+   * @generated
+   */
+  public Object caseSystemWire(SystemWire object)
+  {
+    return null;
+  }
+
+  /**
+   * Returns the result of interpretting the object as an instance of '<em>Web Service Binding</em>'.
+   * <!-- begin-user-doc -->
+   * This implementation returns null;
+   * returning a non-null result will terminate the switch.
+   * <!-- end-user-doc -->
+   * @param object the target of the switch.
+   * @return the result of interpretting the object as an instance of '<em>Web Service Binding</em>'.
+   * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+   * @generated
+   */
+  public Object caseWebServiceBinding(WebServiceBinding object)
+  {
+    return null;
+  }
+
+  /**
+   * Returns the result of interpretting the object as an instance of '<em>WSDL Port Type</em>'.
+   * <!-- begin-user-doc -->
+   * This implementation returns null;
+   * returning a non-null result will terminate the switch.
+   * <!-- end-user-doc -->
+   * @param object the target of the switch.
+   * @return the result of interpretting the object as an instance of '<em>WSDL Port Type</em>'.
+   * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+   * @generated
+   */
+  public Object caseWSDLPortType(WSDLPortType object)
+  {
+    return null;
+  }
+
+  /**
+   * Returns the result of interpretting the object as an instance of '<em>EObject</em>'.
+   * <!-- begin-user-doc -->
+   * This implementation returns null;
+   * returning a non-null result will terminate the switch, but this is the last case anyway.
+   * <!-- end-user-doc -->
+   * @param object the target of the switch.
+   * @return the result of interpretting the object as an instance of '<em>EObject</em>'.
+   * @see #doSwitch(org.eclipse.emf.ecore.EObject)
+   * @generated
+   */
+  public Object defaultCase(EObject object)
+  {
+    return null;
+  }
+
+} //SCDLSwitch

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

Propchange: incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/scdl/util/SCDLSwitch.java
------------------------------------------------------------------------------
    svn:keywords = Rev,Date

Added: incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/scdl/util/SCDLXMLLoader.java
URL: http://svn.apache.org/viewcvs/incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/scdl/util/SCDLXMLLoader.java?rev=379052&view=auto
==============================================================================
--- incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/scdl/util/SCDLXMLLoader.java (added)
+++ incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/scdl/util/SCDLXMLLoader.java Mon Feb 20 00:15:10 2006
@@ -0,0 +1,127 @@
+/**
+ *
+ *  Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed 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.model.assembly.scdl.util;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.tuscany.model.assembly.scdl.ComponentType;
+import org.apache.tuscany.model.assembly.scdl.DocumentRoot;
+import org.apache.tuscany.model.assembly.scdl.Module;
+import org.apache.tuscany.model.assembly.scdl.ModuleFragment;
+import org.apache.tuscany.model.assembly.scdl.SCDLPackage;
+import org.apache.tuscany.model.assembly.scdl.Subsystem;
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
+import org.eclipse.emf.ecore.xmi.XMLResource;
+import org.eclipse.emf.ecore.xmi.impl.XMLMapImpl;
+
+/**
+ */
+public class SCDLXMLLoader extends ResourceSetImpl {
+
+    /**
+     * Constructor
+     */
+    public SCDLXMLLoader() {
+        
+        // Register resource factories
+        Map extensionToFactoryMap=getResourceFactoryRegistry().getExtensionToFactoryMap();
+        SCDLResourceFactoryImpl resourceFactory=new SCDLResourceFactoryImpl(); 
+        extensionToFactoryMap.put("module", resourceFactory);
+        extensionToFactoryMap.put("fragment", resourceFactory);
+        extensionToFactoryMap.put("subsystem", resourceFactory);
+        extensionToFactoryMap.put("componentType", resourceFactory);
+        
+        // Initialize SCDL package
+        SCDLPackage.eINSTANCE.eClass();
+        
+    }
+
+    /**
+     * Returns an SCDL document root.
+     * @param uri
+     * @return
+     */
+    private DocumentRoot getDocumentRoot(String uri) {
+        Resource resource = (Resource) getResource(URI.createURI(uri), true);
+        List contents=resource.getContents();
+        if (!contents.isEmpty()) {
+            return (DocumentRoot)contents.get(0);
+        } else
+            return null;
+    }
+
+    /**
+     * Returns an SCDL module.
+     * @param uri
+     * @return
+     */
+    public Module getModule(String uri) {
+        DocumentRoot documentRoot=getDocumentRoot(uri);
+        return documentRoot!=null? documentRoot.getModule():null;
+    }
+
+    /**
+     * Returns an SCDL module fragment.
+     * @param uri
+     * @return
+     */
+    public ModuleFragment getModuleFragment(String uri) {
+        DocumentRoot documentRoot=getDocumentRoot(uri);
+        return documentRoot!=null? documentRoot.getModuleFragment():null;
+    }
+
+    /**
+     * Returns an SCDL component type.
+     * @param uri
+     * @return
+     */
+    public ComponentType getComponentType(String uri) {
+        DocumentRoot documentRoot=getDocumentRoot(uri);
+        return documentRoot!=null? documentRoot.getComponentType():null;
+    }
+    
+    /**
+     * Returns an SCDL subsystem.
+     * @param uri
+     * @return
+     */
+    public Subsystem getSubsystem(String uri) {
+        DocumentRoot documentRoot=getDocumentRoot(uri);
+        return documentRoot!=null? documentRoot.getSubsystem():null;
+    }
+    
+    /**
+     * @see org.eclipse.emf.ecore.resource.impl.ResourceSetImpl#getLoadOptions()
+     */
+    public Map getLoadOptions() {
+        if (loadOptions == null) {
+            loadOptions = new HashMap();
+            XMLResource.XMLMap xmlMap = new XMLMapImpl();
+            loadOptions.put(XMLResource.OPTION_XML_MAP, xmlMap);
+            loadOptions.put(XMLResource.OPTION_EXTENDED_META_DATA, Boolean.TRUE);
+            loadOptions.put(XMLResource.OPTION_ENCODING, "UTF-8");
+            loadOptions.put(XMLResource.OPTION_USE_ENCODED_ATTRIBUTE_STYLE, Boolean.TRUE);
+            loadOptions.put(XMLResource.OPTION_USE_LEXICAL_HANDLER, Boolean.TRUE);
+        }
+        return loadOptions;
+    }
+
+}

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

Propchange: incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/scdl/util/SCDLXMLLoader.java
------------------------------------------------------------------------------
    svn:keywords = Rev,Date

Added: incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/scdl/util/SCDLXMLProcessor.java
URL: http://svn.apache.org/viewcvs/incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/scdl/util/SCDLXMLProcessor.java?rev=379052&view=auto
==============================================================================
--- incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/scdl/util/SCDLXMLProcessor.java (added)
+++ incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/scdl/util/SCDLXMLProcessor.java Mon Feb 20 00:15:10 2006
@@ -0,0 +1,55 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id$
+ */
+package org.apache.tuscany.model.assembly.scdl.util;
+
+import java.util.Map;
+
+import org.apache.tuscany.model.assembly.scdl.impl.SCDLPackageImpl;
+
+import org.eclipse.emf.ecore.EPackage;
+
+import org.eclipse.emf.ecore.xmi.util.XMLProcessor;
+
+/**
+ * This class contains helper methods to serialize and deserialize XML documents
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class SCDLXMLProcessor extends XMLProcessor
+{
+
+  /**
+   * Public constructor to instantiate the helper.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   */
+  public SCDLXMLProcessor()
+  {
+    super((EPackage.Registry.INSTANCE));
+    SCDLPackageImpl.eINSTANCE.eClass();
+  }
+  
+  /**
+   * Register for "*" and "xml" file extensions the SCDLResourceFactoryImpl factory.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   */
+  protected Map getRegistrations()
+  {
+    if (registrations == null)
+    {
+      super.getRegistrations();
+      registrations.put(XML_EXTENSION, new SCDLResourceFactoryImpl());
+      registrations.put(STAR_EXTENSION, new SCDLResourceFactoryImpl());
+    }
+    return registrations;
+  }
+
+} //SCDLXMLProcessor

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

Propchange: incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/scdl/util/SCDLXMLProcessor.java
------------------------------------------------------------------------------
    svn:keywords = Rev,Date

Added: incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/types/InterfaceType.java
URL: http://svn.apache.org/viewcvs/incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/types/InterfaceType.java?rev=379052&view=auto
==============================================================================
--- incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/types/InterfaceType.java (added)
+++ incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/types/InterfaceType.java Mon Feb 20 00:15:10 2006
@@ -0,0 +1,63 @@
+/**
+ *
+ *  Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed 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.model.types;
+
+import java.util.List;
+
+import org.apache.tuscany.model.assembly.AssemblyModelObject;
+
+/**
+ * Represents a service interface.
+ */
+public interface InterfaceType extends AssemblyModelObject {
+
+    /**
+     * Returns the list of operation types on the interface.
+     *
+     * @return
+     */
+    List<OperationType> getOperationTypes();
+
+    /**
+     * Returns the named operation type.
+     *
+     * @param name
+     * @return
+     */
+    OperationType getOperationType(String name);
+
+    /**
+     * Returns the interface URI.
+     *
+     * @return
+     */
+    String getURI();
+
+    /**
+     * Returns the Java class that this interface type represents.
+     *
+     * @return
+     */
+    Class getInstanceClass();
+
+    /**
+     * Sets the Java class that this interface represents.
+     * @param instanceClass
+     */
+    void setInstanceClass(Class instanceClass);
+	
+}

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

Propchange: incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/types/InterfaceType.java
------------------------------------------------------------------------------
    svn:keywords = Rev,Date

Added: incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/types/MessageType.java
URL: http://svn.apache.org/viewcvs/incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/types/MessageType.java?rev=379052&view=auto
==============================================================================
--- incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/types/MessageType.java (added)
+++ incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/types/MessageType.java Mon Feb 20 00:15:10 2006
@@ -0,0 +1,39 @@
+/**
+ *
+ *  Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed 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.model.types;
+
+import org.apache.tuscany.model.assembly.AssemblyModelObject;
+
+/**
+ */
+public interface MessageType extends AssemblyModelObject {
+
+    /**
+     * Returns the message name.
+     *
+     * @return
+     */
+    String getName();
+
+    /**
+     * Sets the message name
+     *
+     * @param name
+     */
+    void setName(String name);
+
+}

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

Propchange: incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/types/MessageType.java
------------------------------------------------------------------------------
    svn:keywords = Rev,Date

Added: incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/types/OperationType.java
URL: http://svn.apache.org/viewcvs/incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/types/OperationType.java?rev=379052&view=auto
==============================================================================
--- incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/types/OperationType.java (added)
+++ incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/types/OperationType.java Mon Feb 20 00:15:10 2006
@@ -0,0 +1,64 @@
+/**
+ *
+ *  Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed 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.model.types;
+
+import java.util.List;
+
+import commonj.sdo.Type;
+
+import org.apache.tuscany.model.assembly.AssemblyModelObject;
+
+/**
+ * Represents a service operation type.
+ */
+public interface OperationType extends AssemblyModelObject {
+
+    /**
+     * Returns the operation name.
+     *
+     * @return
+     */
+    String getName();
+
+    /**
+     * Sets the operation name.
+     *
+     * @param name
+     */
+    void setName(String name);
+
+    /**
+     * Returns the operation input type.
+     *
+     * @return
+     */
+    Type getInputType();
+
+    /**
+     * Returns the operation output type.
+     *
+     * @return
+     */
+    Type getOutputType();
+
+    /**
+     * Returns the operation exception types.
+     * @return
+     */
+    List<Type> getExceptionTypes();
+
+}

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

Propchange: incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/types/OperationType.java
------------------------------------------------------------------------------
    svn:keywords = Rev,Date

Added: incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/types/TypePackage.java
URL: http://svn.apache.org/viewcvs/incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/types/TypePackage.java?rev=379052&view=auto
==============================================================================
--- incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/types/TypePackage.java (added)
+++ incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/types/TypePackage.java Mon Feb 20 00:15:10 2006
@@ -0,0 +1,31 @@
+/**
+ *
+ *  Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed 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.model.types;
+
+import commonj.sdo.Type;
+
+import org.apache.tuscany.model.assembly.AssemblyModelObject;
+
+/**
+ */
+public interface TypePackage extends AssemblyModelObject {
+
+    InterfaceType getInterfaceType(String uri);
+
+    Type getType();
+
+}

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

Propchange: incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/types/TypePackage.java
------------------------------------------------------------------------------
    svn:keywords = Rev,Date

Added: incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/types/java/JavaServiceContract.java
URL: http://svn.apache.org/viewcvs/incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/types/java/JavaServiceContract.java?rev=379052&view=auto
==============================================================================
--- incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/types/java/JavaServiceContract.java (added)
+++ incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/types/java/JavaServiceContract.java Mon Feb 20 00:15:10 2006
@@ -0,0 +1,27 @@
+/**
+ *
+ *  Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed 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.model.types.java;
+
+import org.apache.tuscany.model.assembly.ServiceContract;
+
+
+/**
+ * Represents a Java service contract.
+ */
+public interface JavaServiceContract extends ServiceContract {
+    
+}

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

Propchange: incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/types/java/JavaServiceContract.java
------------------------------------------------------------------------------
    svn:keywords = Rev,Date

Added: incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/types/java/impl/JavaServiceContractImpl.java
URL: http://svn.apache.org/viewcvs/incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/types/java/impl/JavaServiceContractImpl.java?rev=379052&view=auto
==============================================================================
--- incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/types/java/impl/JavaServiceContractImpl.java (added)
+++ incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/types/java/impl/JavaServiceContractImpl.java Mon Feb 20 00:15:10 2006
@@ -0,0 +1,33 @@
+/**
+ *
+ *  Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed 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.model.types.java.impl;
+
+import org.apache.tuscany.model.assembly.impl.ServiceContractImpl;
+import org.apache.tuscany.model.types.java.JavaServiceContract;
+
+/**
+ * An implementation of JavaServiceContract.
+ */
+public class JavaServiceContractImpl extends ServiceContractImpl implements JavaServiceContract {
+
+    /**
+     * Constructor
+     */
+    public JavaServiceContractImpl() {
+    }
+
+}

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

Propchange: incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/types/java/impl/JavaServiceContractImpl.java
------------------------------------------------------------------------------
    svn:keywords = Rev,Date

Added: incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/types/wsdl/WSDLServiceContract.java
URL: http://svn.apache.org/viewcvs/incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/types/wsdl/WSDLServiceContract.java?rev=379052&view=auto
==============================================================================
--- incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/types/wsdl/WSDLServiceContract.java (added)
+++ incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/types/wsdl/WSDLServiceContract.java Mon Feb 20 00:15:10 2006
@@ -0,0 +1,52 @@
+/**
+ *
+ *  Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed 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.model.types.wsdl;
+
+import javax.wsdl.PortType;
+
+import org.apache.tuscany.model.assembly.ServiceContract;
+
+/**
+ * A WSDL service contract.
+ */
+public interface WSDLServiceContract extends ServiceContract {
+    
+    /**
+     * Returns the WSDL portType.
+     * @return
+     */
+    PortType getPortType();
+    
+    /**
+     * Sets the WSDL portType.
+     * @param portType
+     */
+    void setPortType(PortType portType);
+    
+    /**
+     * Returns the callback WSDL portType.
+     * @return
+     */
+    PortType getCallbackPortType();
+    
+    /**
+     * Sets the callback WSDL portType.
+     * @param portType
+     */
+    void setCallbackPortType(PortType portType);
+
+}

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

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

Added: incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/types/wsdl/impl/WSDLServiceContractImpl.java
URL: http://svn.apache.org/viewcvs/incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/types/wsdl/impl/WSDLServiceContractImpl.java?rev=379052&view=auto
==============================================================================
--- incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/types/wsdl/impl/WSDLServiceContractImpl.java (added)
+++ incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/types/wsdl/impl/WSDLServiceContractImpl.java Mon Feb 20 00:15:10 2006
@@ -0,0 +1,102 @@
+/**
+ *
+ *  Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed 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.model.types.wsdl.impl;
+
+import javax.wsdl.PortType;
+import javax.xml.namespace.QName;
+
+import org.apache.tuscany.model.assembly.AssemblyModelContext;
+import org.apache.tuscany.model.assembly.impl.ServiceContractImpl;
+import org.apache.tuscany.model.types.wsdl.WSDLServiceContract;
+import org.apache.tuscany.model.util.XMLNameUtil;
+
+/**
+ * An implementation of WSDLServiceContract.
+ */
+public class WSDLServiceContractImpl extends ServiceContractImpl implements WSDLServiceContract {
+
+    private PortType portType;
+    private PortType callbackPortType;
+
+    /**
+     * Constructor
+     */
+    public WSDLServiceContractImpl() {
+    }
+
+    /**
+     * @see org.apache.tuscany.model.types.wsdl.WSDLServiceContract#getPortType()
+     */
+    public PortType getPortType() {
+        return portType;
+    }
+    
+    /**
+     * @see org.apache.tuscany.model.types.wsdl.WSDLServiceContract#setPortType(javax.wsdl.PortType)
+     */
+    public void setPortType(PortType portType) {
+        checkNotFrozen();
+        this.portType=portType;
+    }
+
+    /**
+     * @see org.apache.tuscany.model.types.wsdl.WSDLServiceContract#getCallbackPortType()
+     */
+    public PortType getCallbackPortType() {
+        return callbackPortType;
+    }
+    
+    /**
+     * @see org.apache.tuscany.model.types.wsdl.WSDLServiceContract#setCallbackPortType(javax.wsdl.PortType)
+     */
+    public void setCallbackPortType(PortType portType) {
+        checkNotFrozen();
+        callbackPortType=portType;
+    }
+
+    /**
+     * @see org.apache.tuscany.model.assembly.impl.ExtensibleImpl#initialize(org.apache.tuscany.model.assembly.AssemblyModelContext)
+     */
+    public void initialize(AssemblyModelContext modelContext) {
+        if (isInitialized())
+            return;
+        super.initialize(modelContext);
+
+        // Load the Java interface for the portType 
+        if (portType!=null && getInterface()==null) {
+            QName qname=portType.getQName();
+            String interfaceName=XMLNameUtil.getPackageNameFromNamespace(qname.getNamespaceURI())+XMLNameUtil.getValidNameFromXMLName(qname.getLocalPart(), true);
+            try {
+                super.setInterface(modelContext.getResourceLoader().loadClass(interfaceName));
+            } catch (ClassNotFoundException e) {
+                throw new IllegalArgumentException(e);
+            }
+        }
+
+        // Load the Java interface for the callback portType 
+        if (callbackPortType!=null && getCallbackInterface()==null) {
+            QName qname=callbackPortType.getQName();
+            String interfaceName=XMLNameUtil.getPackageNameFromNamespace(qname.getNamespaceURI())+XMLNameUtil.getValidNameFromXMLName(qname.getLocalPart(), true);
+            try {
+                super.setCallbackInterface(modelContext.getResourceLoader().loadClass(interfaceName));
+            } catch (ClassNotFoundException e) {
+                throw new IllegalArgumentException(e);
+            }
+        }
+    }
+    
+}

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

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

Added: incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/util/NotifyingHashMapImpl.java
URL: http://svn.apache.org/viewcvs/incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/util/NotifyingHashMapImpl.java?rev=379052&view=auto
==============================================================================
--- incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/util/NotifyingHashMapImpl.java (added)
+++ incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/util/NotifyingHashMapImpl.java Mon Feb 20 00:15:10 2006
@@ -0,0 +1,227 @@
+/**
+ *
+ *  Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed 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.model.util;
+
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Set;
+
+import org.eclipse.emf.common.notify.Adapter;
+
+/**
+ *         <p/>
+ *         A map that notifies an adapter of all changes.
+ */
+public class NotifyingHashMapImpl extends HashMap implements Map {
+
+    private Adapter adapter;
+
+    private class NotifyingCollectionImpl implements Collection {
+        Collection collection;
+
+        private NotifyingCollectionImpl(Collection collection) {
+            this.collection = collection;
+        }
+
+        public boolean add(Object o) {
+            boolean result = collection.add(o);
+            adapter.notifyChanged(null);
+            return result;
+        }
+
+        public boolean addAll(Collection c) {
+            boolean result = collection.addAll(c);
+            adapter.notifyChanged(null);
+            return result;
+        }
+
+        public void clear() {
+            collection.clear();
+            adapter.notifyChanged(null);
+        }
+
+        public boolean contains(Object o) {
+            return collection.contains(o);
+        }
+
+        public boolean containsAll(Collection c) {
+            return collection.containsAll(c);
+        }
+
+        public boolean equals(Object obj) {
+            return collection.equals(obj);
+        }
+
+        public int hashCode() {
+            return collection.hashCode();
+        }
+
+        public boolean isEmpty() {
+            return collection.isEmpty();
+        }
+
+        public Iterator iterator() {
+            return new NotifyingIteratorImpl(collection.iterator());
+        }
+
+        public boolean remove(Object o) {
+            boolean result = collection.remove(o);
+            adapter.notifyChanged(null);
+            return result;
+        }
+
+        public boolean removeAll(Collection c) {
+            boolean result = collection.removeAll(c);
+            adapter.notifyChanged(null);
+            return result;
+        }
+
+        public boolean retainAll(Collection c) {
+            boolean result = collection.retainAll(c);
+            adapter.notifyChanged(null);
+            return result;
+        }
+
+        public int size() {
+            return collection.size();
+        }
+
+        public Object[] toArray() {
+            return collection.toArray();
+        }
+
+        public Object[] toArray(Object[] a) {
+            return collection.toArray(a);
+        }
+
+        public String toString() {
+            return collection.toString();
+        }
+    }
+
+    private class NotifyingSetImpl extends NotifyingCollectionImpl implements Set {
+        private NotifyingSetImpl(Set set) {
+            super(set);
+        }
+    }
+
+    private class NotifyingIteratorImpl implements Iterator {
+        Iterator iterator;
+
+        private NotifyingIteratorImpl(Iterator iterator) {
+            this.iterator = iterator;
+        }
+
+        public boolean equals(Object obj) {
+            return iterator.equals(obj);
+        }
+
+        public int hashCode() {
+            return iterator.hashCode();
+        }
+
+        public boolean hasNext() {
+            return iterator.hasNext();
+        }
+
+        public Object next() {
+            return iterator.next();
+        }
+
+        public void remove() {
+            iterator.remove();
+            adapter.notifyChanged(null);
+        }
+
+        public String toString() {
+            return iterator.toString();
+        }
+    }
+
+    public NotifyingHashMapImpl(Adapter adapter) {
+        this.adapter = adapter;
+    }
+
+    public void clear() {
+        super.clear();
+        adapter.notifyChanged(null);
+    }
+
+    public boolean containsKey(Object key) {
+        return super.containsKey(key);
+    }
+
+    public boolean containsValue(Object value) {
+        return super.containsValue(value);
+    }
+
+    public Set entrySet() {
+        return new NotifyingSetImpl(super.entrySet());
+    }
+
+    public boolean equals(Object obj) {
+        return super.equals(obj);
+    }
+
+    public Object get(Object key) {
+        return super.get(key);
+    }
+
+    public int hashCode() {
+        return super.hashCode();
+    }
+
+    public boolean isEmpty() {
+        return super.isEmpty();
+    }
+
+    public Set keySet() {
+        return new NotifyingSetImpl(super.keySet());
+    }
+
+    public Object put(Object key, Object value) {
+        Object result = super.put(key, value);
+        adapter.notifyChanged(null);
+        return result;
+    }
+
+    public void putAll(Map t) {
+        super.putAll(t);
+        adapter.notifyChanged(null);
+    }
+
+    public Object remove(Object key) {
+        Object result = super.remove(key);
+        adapter.notifyChanged(null);
+        return result;
+    }
+
+    public int size() {
+        return super.size();
+    }
+
+    public String toString() {
+        return super.toString();
+    }
+
+    public Collection values() {
+        return new NotifyingCollectionImpl(super.values());
+    }
+
+}
\ No newline at end of file

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

Propchange: incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/util/NotifyingHashMapImpl.java
------------------------------------------------------------------------------
    svn:keywords = Rev,Date

Added: incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/util/XMLNameUtil.java
URL: http://svn.apache.org/viewcvs/incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/util/XMLNameUtil.java?rev=379052&view=auto
==============================================================================
--- incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/util/XMLNameUtil.java (added)
+++ incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/util/XMLNameUtil.java Mon Feb 20 00:15:10 2006
@@ -0,0 +1,217 @@
+/**
+ *
+ *  Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed 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.model.util;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.emf.common.util.URI;
+
+/**
+ * A utility class that converts between XML names and Java names.
+ */
+public class XMLNameUtil {
+
+    private static final List domains = Arrays.asList(new String[]{"COM", "com", "ORG", "org"});
+
+    /**
+     * Constructor
+     */
+    private XMLNameUtil() {
+        super();
+    }
+
+    /**
+     * Return an EPackage name for the given namespace.
+     *
+     * @param namespace
+     * @return
+     */
+    public static String getPackageNameFromNamespace(String namespace) {
+
+        URI uri = URI.createURI(namespace);
+        List parsedName;
+        if (uri.isHierarchical()) {
+            String host = uri.host();
+            if (host != null && host.startsWith("www.")) {
+                host = host.substring(4);
+            }
+            parsedName = parseName(host, '.');
+            Collections.reverse(parsedName);
+            if (!parsedName.isEmpty()) {
+                parsedName.set(0, ((String) parsedName.get(0)).toLowerCase());
+            }
+
+            parsedName.addAll(parseName(uri.trimFileExtension().path(), '/'));
+
+        } else {
+            String opaquePart = uri.opaquePart();
+            int index = opaquePart.indexOf(":");
+            if (index != -1 && "urn".equalsIgnoreCase(uri.scheme())) {
+                parsedName = parseName(opaquePart.substring(0, index), '-');
+                if (parsedName.size() > 0 && domains.contains(parsedName.get(parsedName.size() - 1))) {
+                    Collections.reverse(parsedName);
+                    parsedName.set(0, ((String) parsedName.get(0)).toLowerCase());
+                }
+                parsedName.addAll(parseName(opaquePart.substring(index + 1), '/'));
+
+            } else {
+                parsedName = parseName(opaquePart, '/');
+            }
+        }
+
+        StringBuffer qualifiedPackageName = new StringBuffer();
+        for (Iterator i = parsedName.iterator(); i.hasNext();) {
+            String packageName = (String) i.next();
+            if (packageName.length() > 0) {
+                if (qualifiedPackageName.length() > 0) {
+                    qualifiedPackageName.append('.');
+                }
+                qualifiedPackageName.append(getValidNameFromXMLName(packageName, false));
+            }
+        }
+        return qualifiedPackageName.toString();
+
+    }
+
+    /**
+     * Returns a namespace prefix for the given package Name
+     *
+     * @param packageName
+     * @return
+     */
+    public static String getNSPrefixFromPackageName(String packageName) {
+        String nsPrefix = packageName;
+        int index = nsPrefix.lastIndexOf('.');
+        return index == -1 ? nsPrefix : nsPrefix.substring(index + 1);
+    }
+
+    /**
+     * Parse the given name.
+     *
+     * @param sourceName
+     * @param separator
+     * @return
+     */
+    private static List parseName(String sourceName, char separator) {
+        List result = new ArrayList();
+        if (sourceName != null) {
+            StringBuffer currentWord = new StringBuffer();
+            boolean lastIsLower = false;
+            for (int index = 0, length = sourceName.length(); index < length; ++index) {
+                char curChar = sourceName.charAt(index);
+                if (!Character.isJavaIdentifierPart(curChar)) {
+                    curChar = separator;
+                }
+                if (Character.isUpperCase(curChar) || (!lastIsLower && Character.isDigit(curChar)) || curChar == separator) {
+                    if (lastIsLower && currentWord.length() > 1 || curChar == separator && currentWord.length() > 0) {
+                        result.add(currentWord.toString());
+                        currentWord = new StringBuffer();
+                    }
+                    lastIsLower = false;
+                } else {
+                    if (!lastIsLower) {
+                        int currentWordLength = currentWord.length();
+                        if (currentWordLength > 1) {
+                            char lastChar = currentWord.charAt(--currentWordLength);
+                            currentWord.setLength(currentWordLength);
+                            result.add(currentWord.toString());
+                            currentWord = new StringBuffer();
+                            currentWord.append(lastChar);
+                        }
+                    }
+                    lastIsLower = true;
+                }
+
+                if (curChar != separator) {
+                    currentWord.append(curChar);
+                }
+            }
+
+            result.add(currentWord.toString());
+        }
+        return result;
+    }
+
+    /**
+     * Returns a valid name from an XML Name
+     *
+     * @param name
+     * @param isUpperCase
+     * @return
+     */
+    public static String getValidNameFromXMLName(String name, boolean isUpperCase) {
+        List parsedName = parseName(name, '_');
+        StringBuffer result = new StringBuffer();
+        for (Iterator i = parsedName.iterator(); i.hasNext();) {
+            String nameComponent = (String) i.next();
+            if (nameComponent.length() > 0) {
+                if (result.length() > 0 || isUpperCase) {
+                    result.append(Character.toUpperCase(nameComponent.charAt(0)));
+                    result.append(nameComponent.substring(1));
+                } else {
+                    result.append(nameComponent);
+                }
+            }
+        }
+
+        return result.length() == 0 ? "_" : Character.isJavaIdentifierStart(result.charAt(0)) ? isUpperCase ? result.toString() : decapitalizeName(result.toString()) : "_" + result;
+    }
+
+    /**
+     * Decapitalize a name.
+     * @param name
+     * @return
+     */
+    public static String decapitalizeName(String name) {
+        if (name.length() == 0) {
+            return name;
+        } else {
+            String lowerName = name.toLowerCase();
+            int i;
+            for (i = 0; i < name.length(); i++) {
+                if (name.charAt(i) == lowerName.charAt(i)) {
+                    break;
+                }
+            }
+            if (i > 1 && i < name.length()) {
+                --i;
+            }
+            return name.substring(0, i).toLowerCase() + name.substring(i);
+        }
+    }
+
+    /**
+     * Capitalize a name.
+     * @param name
+     * @return
+     */
+    public static String capitalizeName(String name) {
+        int l=name.length();
+        if (l == 0) {
+            return name;
+        } else if (l==1) {
+            return name.toUpperCase();
+        } else {
+            return name.substring(0, 1).toUpperCase() + name.substring(1);
+        }
+    }
+
+}
\ No newline at end of file

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

Propchange: incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/util/XMLNameUtil.java
------------------------------------------------------------------------------
    svn:keywords = Rev,Date