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 [3/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/sr...

Added: incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ConfiguredPortImpl.java
URL: http://svn.apache.org/viewcvs/incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ConfiguredPortImpl.java?rev=379052&view=auto
==============================================================================
--- incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ConfiguredPortImpl.java (added)
+++ incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ConfiguredPortImpl.java Mon Feb 20 00:15:10 2006
@@ -0,0 +1,142 @@
+/**
+ *
+ *  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.impl;
+
+import org.apache.tuscany.model.assembly.AggregatePart;
+import org.apache.tuscany.model.assembly.AssemblyModelContext;
+import org.apache.tuscany.model.assembly.AssemblyModelVisitor;
+import org.apache.tuscany.model.assembly.ConfiguredPort;
+import org.apache.tuscany.model.assembly.Port;
+
+/**
+ * Implementation of ConfiguredPort.
+ */
+public abstract class ConfiguredPortImpl extends AssemblyModelObjectImpl implements ConfiguredPort {
+    private AggregatePart aggregatePart;
+    private Port port;
+
+    private Object runtimeConfiguration;
+    private Object proxyFactory;
+
+    /**
+     * Constructor
+     */
+    protected ConfiguredPortImpl() {
+    }
+
+    /**
+     * @see org.apache.tuscany.model.assembly.ConfiguredPort#getPort()
+     */
+    public Port getPort() {
+        return port;
+    }
+    
+    /**
+     * @see org.apache.tuscany.model.assembly.ConfiguredPort#setPort(org.apache.tuscany.model.assembly.Port)
+     */
+    public void setPort(Port port) {
+        checkNotFrozen();
+        this.port = port;
+    }
+    
+    /**
+     * @see org.apache.tuscany.model.assembly.ConfiguredPort#getAggregatePart()
+     */
+    public AggregatePart getAggregatePart() {
+        checkInitialized();
+        return aggregatePart;
+    }
+    
+    /**
+     * Sets the aggregate part containing this configured port.
+     * @param aggregatePart
+     */
+    protected void setAggregatePart(AggregatePart aggregatePart) {
+        checkNotFrozen();
+        this.aggregatePart=aggregatePart;
+    }
+
+    /**
+     * @see org.apache.tuscany.model.assembly.ConfiguredPort#getProxyFactory()
+     */
+    public Object getProxyFactory() {
+        return proxyFactory;
+    }
+
+    /**
+     * @see org.apache.tuscany.model.assembly.ConfiguredPort#setProxyFactory(java.lang.Object)
+     */
+    public void setProxyFactory(Object proxyFactory) {
+        checkNotFrozen();
+        this.proxyFactory = proxyFactory;
+    }
+
+    /**
+     * @see org.apache.tuscany.model.assembly.RuntimeConfigurationHolder#getRuntimeConfiguration()
+     */
+    public Object getRuntimeConfiguration() {
+        return runtimeConfiguration;
+    }
+
+    /**
+     * @see org.apache.tuscany.model.assembly.RuntimeConfigurationHolder#setRuntimeConfiguration(java.lang.Object)
+     */
+    public void setRuntimeConfiguration(Object configuration) {
+        checkNotFrozen();
+        runtimeConfiguration = configuration;
+    }
+
+    /**
+     * @see org.apache.tuscany.model.assembly.impl.AssemblyModelObjectImpl#initialize(org.apache.tuscany.model.assembly.AssemblyModelContext)
+     */
+    public void initialize(AssemblyModelContext modelContext) {
+        if (isInitialized())
+            return;
+        super.initialize(modelContext);
+        
+        if (port!=null)
+            port.initialize(modelContext);
+    }
+    
+    /**
+     * @see org.apache.tuscany.model.assembly.impl.AssemblyModelObjectImpl#freeze()
+     */
+    public void freeze() {
+        if (isFrozen())
+            return;
+        super.freeze();
+        
+        if (port!=null)
+            port.freeze();
+    }
+    
+    /**
+     * @see org.apache.tuscany.model.assembly.impl.AssemblyModelObjectImpl#accept(org.apache.tuscany.model.assembly.AssemblyModelVisitor)
+     */
+    public boolean accept(AssemblyModelVisitor visitor) {
+        if (!super.accept(visitor))
+            return false;
+        
+        if (port!=null) {
+            if (!port.accept(visitor))
+                return false;
+        }
+        
+        return true;
+    }
+    
+}

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

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

Added: incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ConfiguredPropertyImpl.java
URL: http://svn.apache.org/viewcvs/incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ConfiguredPropertyImpl.java?rev=379052&view=auto
==============================================================================
--- incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ConfiguredPropertyImpl.java (added)
+++ incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ConfiguredPropertyImpl.java Mon Feb 20 00:15:10 2006
@@ -0,0 +1,106 @@
+/**
+ *
+ *  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.impl;
+
+import org.apache.tuscany.model.assembly.AssemblyModelContext;
+import org.apache.tuscany.model.assembly.AssemblyModelVisitor;
+import org.apache.tuscany.model.assembly.ConfiguredProperty;
+import org.apache.tuscany.model.assembly.Property;
+
+/**
+ * Implementation of ConfiguredProperty
+ */
+public class ConfiguredPropertyImpl extends AssemblyModelObjectImpl implements ConfiguredProperty {
+    private Property property;
+    private Object value;
+
+    /**
+     * Constructor
+     */
+    protected ConfiguredPropertyImpl() {
+    }
+
+    /**
+     * @see org.apache.tuscany.model.assembly.ConfiguredProperty#getProperty()
+     */
+    public Property getProperty() {
+        return property;
+    }
+
+    /**
+     * @see org.apache.tuscany.model.assembly.ConfiguredProperty#setProperty(org.apache.tuscany.model.assembly.Property)
+     */
+    public void setProperty(Property property) {
+        checkNotFrozen();
+        this.property = property;
+    }
+
+    /**
+     * @see org.apache.tuscany.model.assembly.ConfiguredProperty#getValue()
+     */
+    public Object getValue() {
+        return value;
+    }
+
+    /**
+     * @see org.apache.tuscany.model.assembly.ConfiguredProperty#setValue(java.lang.Object)
+     */
+    public void setValue(Object value) {
+        checkNotFrozen();
+        this.value = value;
+    }
+
+    /**
+     * @see org.apache.tuscany.model.assembly.impl.AssemblyModelObjectImpl#initialize(org.apache.tuscany.model.assembly.AssemblyModelContext)
+     */
+    public void initialize(AssemblyModelContext modelContext) {
+        if (isInitialized())
+            return;
+        super.initialize(modelContext);
+        
+        if (property!=null)
+            property.initialize(modelContext);
+    }
+    
+    /**
+     * @see org.apache.tuscany.model.assembly.impl.AssemblyModelObjectImpl#freeze()
+     */
+    public void freeze() {
+        if (isFrozen())
+            return;
+        super.freeze();
+        
+        if (property!=null)
+            property.freeze();
+    }
+    
+    /**
+     * @see org.apache.tuscany.model.assembly.impl.AssemblyModelObjectImpl#accept(org.apache.tuscany.model.assembly.AssemblyModelVisitor)
+     */
+    public boolean accept(AssemblyModelVisitor visitor) {
+        if (!super.accept(visitor))
+            return false;
+        
+        if (property!=null) {
+            if (!property.accept(visitor))
+                return false;
+        }
+        
+        return true;
+    }
+    
+}

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

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

Added: incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ConfiguredReferenceImpl.java
URL: http://svn.apache.org/viewcvs/incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ConfiguredReferenceImpl.java?rev=379052&view=auto
==============================================================================
--- incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ConfiguredReferenceImpl.java (added)
+++ incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ConfiguredReferenceImpl.java Mon Feb 20 00:15:10 2006
@@ -0,0 +1,72 @@
+/**
+ *
+ *  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.impl;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import org.apache.tuscany.model.assembly.ConfiguredReference;
+import org.apache.tuscany.model.assembly.ConfiguredService;
+import org.apache.tuscany.model.assembly.Reference;
+
+/**
+ * An implementation of ConfiguredReference.
+ */
+public class ConfiguredReferenceImpl extends ConfiguredPortImpl implements ConfiguredReference {
+
+    private List<ConfiguredService> targetConfiguredServices = new ArrayList<ConfiguredService>();
+
+    /**
+     * Constructor
+     */
+    protected ConfiguredReferenceImpl() {
+    }
+
+    /**
+     * @see org.apache.tuscany.model.assembly.ConfiguredReference#getReference()
+     */
+    public Reference getReference() {
+        return (Reference) super.getPort();
+    }
+
+    /**
+     * @see org.apache.tuscany.model.assembly.ConfiguredReference#setReference(org.apache.tuscany.model.assembly.Reference)
+     */
+    public void setReference(Reference reference) {
+        checkNotFrozen();
+        super.setPort(reference);
+    }
+    
+    /**
+     * @see org.apache.tuscany.model.assembly.ConfiguredReference#getTargetConfiguredServices()
+     */
+    public List<ConfiguredService> getTargetConfiguredServices() {
+        return targetConfiguredServices;
+    }
+    
+    /**
+     * @see org.apache.tuscany.model.assembly.impl.ConfiguredPortImpl#freeze()
+     */
+    public void freeze() {
+        super.freeze();
+        
+        // Freeze list of configured services
+        targetConfiguredServices=Collections.unmodifiableList(targetConfiguredServices);
+    }
+
+}

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

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

Added: incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ConfiguredServiceImpl.java
URL: http://svn.apache.org/viewcvs/incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ConfiguredServiceImpl.java?rev=379052&view=auto
==============================================================================
--- incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ConfiguredServiceImpl.java (added)
+++ incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ConfiguredServiceImpl.java Mon Feb 20 00:15:10 2006
@@ -0,0 +1,48 @@
+/**
+ *
+ *  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.impl;
+
+import org.apache.tuscany.model.assembly.ConfiguredService;
+import org.apache.tuscany.model.assembly.Service;
+
+/**
+ * An implementation of ConfiguredService.
+ */
+public class ConfiguredServiceImpl extends ConfiguredPortImpl implements ConfiguredService {
+
+    /**
+     * Constructor
+     */
+    protected ConfiguredServiceImpl() {
+    }
+
+    /**
+     * @see org.apache.tuscany.model.assembly.ConfiguredService#getService()
+     */
+    public Service getService() {
+        return (Service) super.getPort();
+    }
+    
+    /**
+     * @see org.apache.tuscany.model.assembly.ConfiguredService#setService(org.apache.tuscany.model.assembly.Service)
+     */
+    public void setService(Service service) {
+        checkNotFrozen();
+        super.setPort(service);
+    }
+
+}

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

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

Added: incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/EntryPointImpl.java
URL: http://svn.apache.org/viewcvs/incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/EntryPointImpl.java?rev=379052&view=auto
==============================================================================
--- incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/EntryPointImpl.java (added)
+++ incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/EntryPointImpl.java Mon Feb 20 00:15:10 2006
@@ -0,0 +1,141 @@
+/**
+ *
+ *  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.impl;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import org.apache.tuscany.model.assembly.AssemblyModelContext;
+import org.apache.tuscany.model.assembly.AssemblyModelVisitor;
+import org.apache.tuscany.model.assembly.Binding;
+import org.apache.tuscany.model.assembly.ConfiguredReference;
+import org.apache.tuscany.model.assembly.ConfiguredService;
+import org.apache.tuscany.model.assembly.EntryPoint;
+
+/**
+ * An implementation of EntryPoint.
+ */
+public class EntryPointImpl extends AggregatePartImpl implements EntryPoint {
+    
+    private ConfiguredService configuredService;
+    private ConfiguredReference configuredReference;
+    private List<Binding> bindings=new ArrayList<Binding>();
+
+    /**
+     * Constructor
+     */
+    protected EntryPointImpl() {
+    }
+
+    /**
+     * @see org.apache.tuscany.model.assembly.EntryPoint#getConfiguredReference()
+     */
+    public ConfiguredReference getConfiguredReference() {
+        return configuredReference;
+    }
+    
+    /**
+     * @see org.apache.tuscany.model.assembly.EntryPoint#setConfiguredReference(org.apache.tuscany.model.assembly.ConfiguredReference)
+     */
+    public void setConfiguredReference(ConfiguredReference configuredReference) {
+        checkNotFrozen();
+        this.configuredReference=configuredReference;
+    }
+
+    /**
+     * @see org.apache.tuscany.model.assembly.EntryPoint#getConfiguredService()
+     */
+    public ConfiguredService getConfiguredService() {
+        return configuredService;
+    }
+    
+    /**
+     * @see org.apache.tuscany.model.assembly.EntryPoint#setConfiguredService(org.apache.tuscany.model.assembly.ConfiguredService)
+     */
+    public void setConfiguredService(ConfiguredService configuredService) {
+        checkNotFrozen();
+        this.configuredService=configuredService;
+    }
+    
+    /**
+     * @see org.apache.tuscany.model.assembly.EntryPoint#getBindings()
+     */
+    public List<Binding> getBindings() {
+        return bindings;
+    }
+
+    /**
+     * @see org.apache.tuscany.model.assembly.AssemblyModelObject#initialize(org.apache.tuscany.model.assembly.AssemblyModelContext)
+     */
+    public void initialize(AssemblyModelContext modelContext) {
+        if (isInitialized())
+            return;
+        super.initialize(modelContext);
+
+        // Initialize the service contract and reference to the published service
+        if (configuredReference != null)
+            configuredReference.initialize(modelContext);
+        if (configuredService != null)
+            configuredService.initialize(modelContext);
+
+        // Initialize the bindings
+        initialize(bindings, modelContext);
+    }
+
+    /**
+     * @see org.apache.tuscany.model.assembly.AssemblyModelObject#freeze()
+     */
+    public void freeze() {
+        if (isFrozen())
+            return;
+        super.freeze();
+
+        // Freeze the service contract and configured reference
+        if (configuredReference != null)
+            configuredReference.freeze();
+        if (configuredService != null)
+            configuredService.freeze();
+
+        // Freeze the bindings
+        bindings=Collections.unmodifiableList(bindings);
+        freeze(bindings);
+    }
+
+    /**
+     * @see org.apache.tuscany.model.assembly.impl.AssemblyModelObjectImpl#accept(org.apache.tuscany.model.assembly.AssemblyModelVisitor)
+     */
+    public boolean accept(AssemblyModelVisitor visitor) {
+        if (!super.accept(visitor))
+            return false;
+        
+        if (configuredReference!=null) {
+            if (!configuredReference.accept(visitor))
+                return false;
+        }
+        
+        if (configuredService!=null) {
+            if (!configuredService.accept(visitor))
+                return false;
+        }
+        
+        if (!accept(bindings, visitor))
+            return false;
+        
+        return true;
+    }
+}

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

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

Added: incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ExtensibleImpl.java
URL: http://svn.apache.org/viewcvs/incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ExtensibleImpl.java?rev=379052&view=auto
==============================================================================
--- incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ExtensibleImpl.java (added)
+++ incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ExtensibleImpl.java Mon Feb 20 00:15:10 2006
@@ -0,0 +1,92 @@
+/**
+ *
+ *  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.impl;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.tuscany.model.assembly.AssemblyModelContext;
+import org.apache.tuscany.model.assembly.AssemblyModelVisitor;
+import org.apache.tuscany.model.assembly.Extensible;
+
+/**
+ * An implementation of Extensible.
+ */
+public abstract class ExtensibleImpl extends AssemblyModelObjectImpl implements Extensible {
+    
+    private List<Object> extensibilityElements=new ArrayList<Object>();
+    private List<Object> extensibilityAttributes=new ArrayList<Object>();
+
+    /**
+     * Constructor
+     */
+    protected ExtensibleImpl() {
+    }
+
+    /**
+     * @see org.apache.tuscany.model.assembly.Extensible#getExtensibilityElements()
+     */
+    public List getExtensibilityElements() {
+        return extensibilityElements;
+    }
+
+    /**
+     * @see org.apache.tuscany.model.assembly.Extensible#getExtensibilityAttributes()
+     */
+    public List getExtensibilityAttributes() {
+        return extensibilityAttributes;
+    }
+    
+    /**
+     * @see org.apache.tuscany.model.assembly.AssemblyModelObject#initialize(org.apache.tuscany.model.assembly.AssemblyModelContext)
+     */
+    public void initialize(AssemblyModelContext modelContext) {
+        if (isInitialized())
+            return;
+        super.initialize(modelContext);
+
+        // Initialize extensibility elements and attributes
+        initialize(extensibilityElements, modelContext);
+        initialize(extensibilityAttributes, modelContext);
+    }
+
+    public void freeze() {
+        if (isFrozen())
+            return;
+        super.freeze();
+        
+        // Freeze extensibility elements and attributes
+        freeze(extensibilityElements);
+        freeze(extensibilityAttributes);
+    }
+    
+    /**
+     * @see org.apache.tuscany.model.assembly.impl.AssemblyModelObjectImpl#accept(org.apache.tuscany.model.assembly.AssemblyModelVisitor)
+     */
+    public boolean accept(AssemblyModelVisitor visitor) {
+        if (!super.accept(visitor))
+            return false;
+        
+        if (!accept(extensibilityElements, visitor))
+            return false;
+        if (!accept(extensibilityAttributes, visitor))
+            return false;
+        
+        return true;
+    }
+
+}

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

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

Added: incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ExternalServiceImpl.java
URL: http://svn.apache.org/viewcvs/incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ExternalServiceImpl.java?rev=379052&view=auto
==============================================================================
--- incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ExternalServiceImpl.java (added)
+++ incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ExternalServiceImpl.java Mon Feb 20 00:15:10 2006
@@ -0,0 +1,133 @@
+/**
+ *
+ *  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.impl;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import org.apache.tuscany.model.assembly.AssemblyModelContext;
+import org.apache.tuscany.model.assembly.AssemblyModelVisitor;
+import org.apache.tuscany.model.assembly.Binding;
+import org.apache.tuscany.model.assembly.ConfiguredService;
+import org.apache.tuscany.model.assembly.ExternalService;
+import org.apache.tuscany.model.assembly.OverrideOption;
+
+/**
+ * An implementation ExternalService.
+ */
+public class ExternalServiceImpl extends AggregatePartImpl implements ExternalService {
+
+    private ConfiguredService configuredService;
+    private OverrideOption overrideOption;
+    private List<Binding> bindings=new ArrayList<Binding>();
+
+    /**
+     * Constructor
+     */
+    protected ExternalServiceImpl() {
+    }
+
+    /**
+     * @see org.apache.tuscany.model.assembly.sdo.impl.ExternalServiceImpl#getOverrideOption()
+     */
+    public OverrideOption getOverrideOption() {
+        return overrideOption;
+    }
+
+    /**
+     * @see org.apache.tuscany.model.assembly.ExternalService#setOverrideOption(org.apache.tuscany.model.assembly.OverrideOption)
+     */
+    public void setOverrideOption(OverrideOption newOverridable) {
+        checkNotFrozen();
+        overrideOption=newOverridable;
+    }
+
+    /**
+     * @see org.apache.tuscany.model.assembly.ExternalService#getBindings()
+     */
+    public List<Binding> getBindings() {
+        return bindings;
+    }
+
+    /**
+     * @see org.apache.tuscany.model.assembly.ExternalService#getConfiguredService()
+     */
+    public ConfiguredService getConfiguredService() {
+        return configuredService;
+    }
+    
+    /**
+     * @see org.apache.tuscany.model.assembly.ExternalService#setConfiguredService(org.apache.tuscany.model.assembly.ConfiguredService)
+     */
+    public void setConfiguredService(ConfiguredService configuredService) {
+        checkNotFrozen();
+        this.configuredService=configuredService;
+    }
+
+    /**
+     * @see org.apache.tuscany.model.assembly.AssemblyModelObject#initialize(org.apache.tuscany.model.assembly.AssemblyModelContext)
+     */
+    public void initialize(AssemblyModelContext modelContext) {
+        if (isInitialized())
+            return;
+        super.initialize(modelContext);
+
+        // Initialize the configured service 
+        if (configuredService != null)
+            configuredService.initialize(modelContext);
+        
+        // Initialize the bindings
+        initialize(bindings, modelContext);
+    }
+
+    /**
+     * @see org.apache.tuscany.model.assembly.AssemblyModelObject#freeze()
+     */
+    public void freeze() {
+        if (isFrozen())
+            return;
+        super.freeze();
+
+        // Freeze the configured service
+        if (configuredService!= null)
+            configuredService.freeze();
+
+        // Freeze the bindings
+        bindings=Collections.unmodifiableList(bindings);
+        freeze(bindings);
+    }
+    
+    /**
+     * @see org.apache.tuscany.model.assembly.impl.ExtensibleImpl#accept(org.apache.tuscany.model.assembly.AssemblyModelVisitor)
+     */
+    public boolean accept(AssemblyModelVisitor visitor) {
+        if (!super.accept(visitor))
+            return false;
+        
+        if (configuredService!=null) {
+            if (!configuredService.accept(visitor))
+                return false;
+        }
+        
+        if (!accept(bindings, visitor))
+            return false;
+        
+        return true;
+    }
+
+}

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

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

Added: incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ModuleComponentImpl.java
URL: http://svn.apache.org/viewcvs/incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ModuleComponentImpl.java?rev=379052&view=auto
==============================================================================
--- incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ModuleComponentImpl.java (added)
+++ incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ModuleComponentImpl.java Mon Feb 20 00:15:10 2006
@@ -0,0 +1,65 @@
+/**
+ *
+ *  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.impl;
+
+import org.apache.tuscany.model.assembly.Module;
+import org.apache.tuscany.model.assembly.ModuleComponent;
+
+/**
+ * An implementation of ModuleComponent.
+ */
+public class ModuleComponentImpl extends ComponentImpl implements ModuleComponent {
+    
+    private String uri;
+
+    /**
+     * Constructor
+     */
+    protected ModuleComponentImpl() {
+    }
+
+    /**
+     * @see org.apache.tuscany.model.assembly.ModuleComponent#setModuleImplementation(org.apache.tuscany.model.assembly.Module)
+     */
+    public void setModuleImplementation(Module module) {
+        checkNotFrozen();
+        super.setComponentImplementation(module);
+    }
+    
+    /**
+     * @see org.apache.tuscany.model.assembly.ModuleComponent#getModuleImplementation()
+     */
+    public Module getModuleImplementation() {
+        return (Module)super.getComponentImplementation();
+    }
+
+    /**
+     * @see org.apache.tuscany.model.assembly.ModuleComponent#getURI()
+     */
+    public String getURI() {
+        return uri;
+    }
+
+    /**
+     * @see org.apache.tuscany.model.assembly.ModuleComponent#setURI(java.lang.String)
+     */
+    public void setURI(String value) {
+        checkNotFrozen();
+        uri=value;
+    }
+
+}

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

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

Added: incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ModuleFragmentImpl.java
URL: http://svn.apache.org/viewcvs/incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ModuleFragmentImpl.java?rev=379052&view=auto
==============================================================================
--- incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ModuleFragmentImpl.java (added)
+++ incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ModuleFragmentImpl.java Mon Feb 20 00:15:10 2006
@@ -0,0 +1,32 @@
+/**
+ *
+ *  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.impl;
+
+import org.apache.tuscany.model.assembly.ModuleFragment;
+
+/**
+ * An implementation of ModuleFragment.
+ */
+public class ModuleFragmentImpl extends AggregateImpl implements ModuleFragment {
+
+    /**
+     * Constructor
+     */
+    protected ModuleFragmentImpl() {
+    }
+
+}

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

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

Added: incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ModuleImpl.java
URL: http://svn.apache.org/viewcvs/incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ModuleImpl.java?rev=379052&view=auto
==============================================================================
--- incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ModuleImpl.java (added)
+++ incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ModuleImpl.java Mon Feb 20 00:15:10 2006
@@ -0,0 +1,342 @@
+/**
+ *
+ *  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.impl;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.tuscany.model.assembly.AssemblyFactory;
+import org.apache.tuscany.model.assembly.AssemblyModelContext;
+import org.apache.tuscany.model.assembly.AssemblyModelVisitor;
+import org.apache.tuscany.model.assembly.ComponentType;
+import org.apache.tuscany.model.assembly.EntryPoint;
+import org.apache.tuscany.model.assembly.ExternalService;
+import org.apache.tuscany.model.assembly.Module;
+import org.apache.tuscany.model.assembly.ModuleFragment;
+import org.apache.tuscany.model.assembly.Reference;
+import org.apache.tuscany.model.assembly.Service;
+import org.apache.tuscany.model.assembly.ServiceContract;
+
+/**
+ * An implementation of Module.
+ */
+public class ModuleImpl extends AggregateImpl implements Module {
+    
+    private List<ModuleFragment> moduleFragments = new ArrayList<ModuleFragment>();
+    private Map<String, ModuleFragment> moduleFragmentsMap;
+    private ComponentType componentType;
+    private Object runtimeConfiguration;
+
+    /**
+     * Constructor
+     */
+    protected ModuleImpl() {
+    }
+
+    /**
+     * @see org.apache.tuscany.model.assembly.Module#getModuleFragments()
+     */
+    public List<ModuleFragment> getModuleFragments() {
+        return moduleFragments;
+    }
+
+    /**
+     * @see org.apache.tuscany.model.assembly.Module#getModuleFragment(java.lang.String)
+     */
+    public ModuleFragment getModuleFragment(String name) {
+        checkInitialized();
+        return moduleFragmentsMap.get(name);
+    }
+
+    /**
+     * @see org.apache.tuscany.model.assembly.AssemblyModelObject#initialize(org.apache.tuscany.model.assembly.AssemblyModelContext)
+     */
+    public void initialize(AssemblyModelContext modelContext) {
+        if (isInitialized())
+            return;
+        
+        // Populate map of module fragments
+        moduleFragmentsMap = new HashMap<String, ModuleFragment>();
+        for (ModuleFragment moduleFragment : moduleFragments) {
+            moduleFragmentsMap.put(moduleFragment.getName(), moduleFragment);
+            
+            // Add all components, entry points and external services from the module fragments
+            getComponents().addAll(moduleFragment.getComponents());
+            getEntryPoints().addAll(moduleFragment.getEntryPoints());
+            getExternalServices().addAll(moduleFragment.getExternalServices());
+        }
+        
+        // Initialize the aggregate
+        super.initialize(modelContext);
+
+        //FIXME derive the module properties from the overridable properties of the components in the module
+
+        // Derive the component type from the entry points and external services in the module
+        AssemblyFactory factory = modelContext.getAssemblyFactory();
+        componentType = factory.createComponentType();
+        for (EntryPoint entryPoint : getEntryPoints()) {
+            Service service = factory.createService();
+            service.setName(entryPoint.getName());
+            ServiceContract serviceContract = entryPoint.getConfiguredService().getService().getServiceContract();
+            if (serviceContract != null)
+                service.setServiceContract(serviceContract);
+            componentType.getServices().add(service);
+        }
+        for (Iterator<ExternalService> i = getExternalServices().iterator(); i.hasNext();) {
+            ExternalService externalService = i.next();
+            Reference reference = factory.createReference();
+            reference.setName(externalService.getName());
+            ServiceContract serviceContract = externalService.getConfiguredService().getService().getServiceContract();
+            if (serviceContract != null)
+                reference.setServiceContract(serviceContract);
+            componentType.getReferences().add(reference);
+        }
+        componentType.initialize(modelContext);
+
+        //FIXME add wiring later
+//        
+//        // Resolve the references and the wires
+//        AssemblyFactory factory = modelContext.getAssemblyFactory();
+//
+//        // Resolve entry point references
+//        for (Iterator<EntryPoint> i = entryPointsMap.values().iterator(); i.hasNext();) {
+//            EntryPoint entryPoint = i.next();
+//            ConfiguredReference configuredReference = entryPoint.getConfiguredReference();
+//            for (Iterator<DataObject> r = ((org.osoa.sca.model.EntryPoint) entryPoint).getReferences().iterator(); r.hasNext();) {
+//                DataObject targetURIElement = r.next();
+//                ConfiguredService configuredService = resolveURIElement(factory, targetURIElement);
+//                if (configuredService != null) {
+//                    if (!configuredReference.getReference().isMultiplicityN() && !configuredReference.getTargetConfiguredServices().isEmpty()) {
+//                        // FIXME shouldn't we be throwing an exception here
+//                        // log.error("Attempting to wire multiple targets to reference " + configuredReference.getReference().getName());
+//                    } else {
+//                        configuredReference.getTargetConfiguredServices().add(configuredService);
+//                    }
+//                }
+//            }
+//        }
+//
+//        // Resolve component references
+//        for (Iterator<Component> i = componentsMap.values().iterator(); i.hasNext();) {
+//            Component component = i.next();
+//            ReferenceValues referenceValues = ((org.osoa.sca.model.Component) component).getReferenceValues();
+//            if (referenceValues == null)
+//                continue;
+//            Sequence sequence = referenceValues.getAny();
+//            for (int p = 0, n = sequence.size(); p < n; p++) {
+//                Property property = sequence.getProperty(p);
+//                DataObject targetURIElement = (DataObject) sequence.getValue(p);
+//
+//                // Get the named reference
+//                ConfiguredReference configuredReference = component.getConfiguredReference(property.getName());
+//                if (configuredReference != null) {
+//                    ConfiguredService configuredService = resolveURIElement(factory, targetURIElement);
+//                    if (configuredService != null) {
+//                        if (!configuredReference.getReference().isMultiplicityN() && !configuredReference.getTargetConfiguredServices().isEmpty()) {
+//                            // FIXME shouldn't we be throwing an exception here
+//                            // log.error("Attempting to wire multiple targets to reference " + configuredReference.getReference().getName());
+//                        } else {
+//                            configuredReference.getTargetConfiguredServices().add(configuredService);
+//                        }
+//                    }
+//                } else {
+//                    // FIXME shouldn't we be throwing an exception here
+//                    // log.error("Undefined reference " + property.getName());
+//                }
+//            }
+//        }
+//
+//        // Resolve wires from this module and its module fragments
+//        resolveWires(factory, getWires());
+//        for (Iterator<ModuleFragment> i = getModuleFragments().iterator(); i.hasNext();) {
+//            ModuleFragment moduleFragment = i.next();
+//            resolveWires(factory, ((org.osoa.sca.model.ModuleFragment) moduleFragment).getWires());
+//        }
+    }
+
+//    /**
+//     * Resolve a target URI
+//     *
+//     * @param factory
+//     * @param targetURIElement
+//     */
+//    private ConfiguredService resolveURIElement(AssemblyFactory factory, DataObject targetURIElement) {
+//        Sequence sequence = targetURIElement.getSequence(0);
+//        String targetURI = (String) sequence.getValue(0);
+//        ServiceURI serviceURI = factory.createServiceURI(null, targetURI);
+//        ConfiguredService configuredService = getConfiguredService(serviceURI);
+//        if (configuredService == null) {
+//            // FIXME shouldn't we be throwing an exception here
+//            // log.error("Cannot find service for " + targetURI);
+//        }
+//        return configuredService;
+//    }
+//
+//    /**
+//     * Resolve the given wires
+//     *
+//     * @param factory
+//     * @param wires
+//     */
+//    private void resolveWires(AssemblyFactory factory, List<ModuleWire> wires) {
+//
+//        // Loop through the wires
+//        for (Iterator<ModuleWire> i = wires.iterator(); i.hasNext();) {
+//            ModuleWire wire = i.next();
+//
+//            // Get the source reference
+//            ServiceURI sourceURI = factory.createServiceURI(null, wire.getSourceUri());
+//            ConfiguredReference configuredReference = null;
+//            String partName = sourceURI.getPartName();
+//            String referenceName = sourceURI.getServiceName();
+//            if (referenceName != null) {
+//                Component component = getComponent(partName);
+//                if (component != null) {
+//                    configuredReference = component.getConfiguredReference(referenceName);
+//                }
+//            } else {
+//                EntryPoint entryPoint = getEntryPoint(partName);
+//                if (entryPoint != null) {
+//                    configuredReference = entryPoint.getConfiguredReference();
+//                }
+//            }
+//            if (configuredReference == null) {
+//                // FIXME shouldn't we be throwing an exception here
+//                // log.error("Cannot find wire source " + sourceURI);
+//            } else {
+//
+//                // Resolve the target service endpoint
+//                ServiceURI targetURI = factory.createServiceURI(null, wire.getTargetUri());
+//                ConfiguredService configuredService = getConfiguredService(targetURI);
+//                if (configuredService != null) {
+//
+//                    // Wire the reference to the target
+//                    if (configuredReference.getReference().isMultiplicityN()) {
+//                        configuredReference.getTargetConfiguredServices().add(configuredService);
+//                    } else {
+//                        configuredReference.getTargetConfiguredServices().clear();
+//                        configuredReference.getTargetConfiguredServices().add(configuredService);
+//                    }
+//                } else {
+//                    // FIXME shouldn't we be throwing an exception here
+//                    // log.error("Cannot find service for " + targetURI.getAddress());
+//                }
+//            }
+//        }
+//    }
+
+    /**
+     * @see org.apache.tuscany.model.assembly.AssemblyModelObject#freeze()
+     */
+    public void freeze() {
+        if (isFrozen())
+            return;
+        super.freeze();
+        
+        // Freeze component type and module fragments
+        if (componentType!=null)
+            componentType.freeze();
+        moduleFragments=Collections.unmodifiableList(moduleFragments);
+        freeze(moduleFragments);
+    }
+
+    /**
+     * @see org.apache.tuscany.model.assembly.RuntimeConfigurationHolder#getRuntimeConfiguration()
+     */
+    public Object getRuntimeConfiguration() {
+        return runtimeConfiguration;
+    }
+
+    /**
+     * @see org.apache.tuscany.model.assembly.RuntimeConfigurationHolder#setRuntimeConfiguration(java.lang.Object)
+     */
+    public void setRuntimeConfiguration(Object configuration) {
+        checkNotFrozen();
+        this.runtimeConfiguration = configuration;
+    }
+
+    /**
+     * @see org.apache.tuscany.model.assembly.ComponentType#getProperties()
+     */
+    public List<org.apache.tuscany.model.assembly.Property> getProperties() {
+        checkInitialized();
+        return componentType.getProperties();
+    }
+
+    /**
+     * @see org.apache.tuscany.model.assembly.ComponentType#getProperty(java.lang.String)
+     */
+    public org.apache.tuscany.model.assembly.Property getProperty(String name) {
+        checkInitialized();
+        return componentType.getProperty(name);
+    }
+
+    /**
+     * @see org.apache.tuscany.model.assembly.ComponentType#getReference(java.lang.String)
+     */
+    public Reference getReference(String name) {
+        checkInitialized();
+        return componentType.getReference(name);
+    }
+
+    /**
+     * @see org.apache.tuscany.model.assembly.ComponentType#getReferences()
+     */
+    public List<Reference> getReferences() {
+        checkInitialized();
+        return componentType.getReferences();
+    }
+
+    /**
+     * @see org.apache.tuscany.model.assembly.ComponentType#getService(java.lang.String)
+     */
+    public Service getService(String name) {
+        checkInitialized();
+        return componentType.getService(name);
+    }
+
+    /**
+     * @see org.apache.tuscany.model.assembly.ComponentType#getServices()
+     */
+    public List<Service> getServices() {
+        checkInitialized();
+        return componentType.getServices();
+    }
+
+    /**
+     * @see org.apache.tuscany.model.assembly.impl.AggregateImpl#accept(org.apache.tuscany.model.assembly.AssemblyModelVisitor)
+     */
+    public boolean accept(AssemblyModelVisitor visitor) {
+        if (!super.accept(visitor))
+            return false;
+        
+        if (componentType!=null) {
+            if (!componentType.accept(visitor))
+                return false;
+        }
+        
+        if (!accept(moduleFragments, visitor))
+            return false;
+        
+        return true;
+    }
+    
+} //ModuleImpl

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

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

Added: incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/PortImpl.java
URL: http://svn.apache.org/viewcvs/incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/PortImpl.java?rev=379052&view=auto
==============================================================================
--- incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/PortImpl.java (added)
+++ incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/PortImpl.java Mon Feb 20 00:15:10 2006
@@ -0,0 +1,106 @@
+/**
+ *
+ *  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.impl;
+
+import org.apache.tuscany.model.assembly.AssemblyModelContext;
+import org.apache.tuscany.model.assembly.AssemblyModelVisitor;
+import org.apache.tuscany.model.assembly.Port;
+import org.apache.tuscany.model.assembly.ServiceContract;
+
+/**
+ * An implementation of Port.
+ */
+public abstract class PortImpl extends AssemblyModelObjectImpl implements Port {
+    
+    private ServiceContract serviceContract;
+    private String name;
+
+    /**
+     * Constructor
+     */
+    protected PortImpl() {
+    }
+    
+    /**
+     * @see org.apache.tuscany.model.assembly.Port#getName()
+     */
+    public String getName() {
+        return name;
+    }
+    
+    /**
+     * @see org.apache.tuscany.model.assembly.Port#setName(java.lang.String)
+     */
+    public void setName(String value) {
+        checkNotFrozen();
+        name=value;
+    }
+    
+    /**
+     * @see org.apache.tuscany.model.assembly.Port#getServiceContract()
+     */
+    public ServiceContract getServiceContract() {
+        return serviceContract;
+    }
+    
+    /**
+     * @see org.apache.tuscany.model.assembly.Port#setServiceContract(org.apache.tuscany.model.assembly.ServiceContract)
+     */
+    public void setServiceContract(ServiceContract value) {
+        checkNotFrozen();
+        serviceContract=value;
+    }
+    
+    /**
+     * @see org.apache.tuscany.model.assembly.impl.AssemblyModelObjectImpl#initialize(org.apache.tuscany.model.assembly.AssemblyModelContext)
+     */
+    public void initialize(AssemblyModelContext modelContext) {
+        if (isInitialized())
+            return;
+        super.initialize(modelContext);
+        
+        if (serviceContract!=null)
+            serviceContract.initialize(modelContext);
+    }
+    
+    /**
+     * @see org.apache.tuscany.model.assembly.impl.AssemblyModelObjectImpl#freeze()
+     */
+    public void freeze() {
+        if (isFrozen())
+            return;
+        super.freeze();
+        
+        if (serviceContract!=null)
+            serviceContract.freeze();
+    }
+    
+    /**
+     * @see org.apache.tuscany.model.assembly.impl.AssemblyModelObjectImpl#accept(org.apache.tuscany.model.assembly.AssemblyModelVisitor)
+     */
+    public boolean accept(AssemblyModelVisitor visitor) {
+        if (!super.accept(visitor))
+            return false;
+        
+        if (serviceContract!=null) {
+            if (!serviceContract.accept(visitor))
+                return false;
+        }
+        
+        return true;
+    }
+}

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

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

Added: incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/PropertyImpl.java
URL: http://svn.apache.org/viewcvs/incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/PropertyImpl.java?rev=379052&view=auto
==============================================================================
--- incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/PropertyImpl.java (added)
+++ incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/PropertyImpl.java Mon Feb 20 00:15:10 2006
@@ -0,0 +1,112 @@
+/**
+ *
+ *  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.impl;
+
+import org.apache.tuscany.model.assembly.Property;
+
+/**
+ * An implementation of Property.
+ */
+public class PropertyImpl extends ExtensibleImpl implements Property {
+    
+    private Object defaultValue; 
+    private String name;
+    private boolean many;
+    private boolean required;
+    private Class type;
+
+    /**
+     * Constructor
+     */
+    protected PropertyImpl() {
+    }
+
+    /**
+     * @see org.apache.tuscany.model.assembly.Property#getDefaultValue()
+     */
+    public Object getDefaultValue() {
+        return defaultValue;
+    }
+
+    /**
+     * @see org.apache.tuscany.model.assembly.Property#getName()
+     */
+    public String getName() {
+        return name;
+    }
+
+    /**
+     * @see org.apache.tuscany.model.assembly.Property#getType()
+     */
+    public Class getType() {
+        return type;
+    }
+
+    /**
+     * @see org.apache.tuscany.model.assembly.Property#isMany()
+     */
+    public boolean isMany() {
+        return many;
+    }
+
+    /**
+     * @see org.apache.tuscany.model.assembly.Property#isRequired()
+     */
+    public boolean isRequired() {
+        return required;
+    }
+
+    /**
+     * @see org.apache.tuscany.model.assembly.Property#setDefaultValue(java.lang.Object)
+     */
+    public void setDefaultValue(Object value) {
+        defaultValue=value;
+    }
+
+    /**
+     * @see org.apache.tuscany.model.assembly.Property#setMany(boolean)
+     */
+    public void setMany(boolean value) {
+        checkNotFrozen();
+        many=value;
+    }
+
+    /**
+     * @see org.apache.tuscany.model.assembly.Property#setName(java.lang.String)
+     */
+    public void setName(String value) {
+        checkNotFrozen();
+        name=value;
+    }
+
+    /**
+     * @see org.apache.tuscany.model.assembly.Property#setRequired(boolean)
+     */
+    public void setRequired(boolean value) {
+        checkNotFrozen();
+        required=value;
+    }
+
+    /**
+     * @see org.apache.tuscany.model.assembly.Property#setType(java.lang.Class)
+     */
+    public void setType(Class value) {
+        checkNotFrozen();
+        type=value;
+    }
+    
+}

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

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

Added: incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ReferenceImpl.java
URL: http://svn.apache.org/viewcvs/incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ReferenceImpl.java?rev=379052&view=auto
==============================================================================
--- incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ReferenceImpl.java (added)
+++ incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ReferenceImpl.java Mon Feb 20 00:15:10 2006
@@ -0,0 +1,50 @@
+/**
+ *
+ *  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.impl;
+
+import org.apache.tuscany.model.assembly.Multiplicity;
+import org.apache.tuscany.model.assembly.Reference;
+
+/**
+ * An implementation of Reference.
+ */
+public class ReferenceImpl extends PortImpl implements Reference {
+    
+    private Multiplicity multiplicity;
+    
+    /**
+     * Constructor
+     */
+    protected ReferenceImpl() {
+    }
+    
+    /**
+     * @see org.apache.tuscany.model.assembly.Reference#getMultiplicity()
+     */
+    public Multiplicity getMultiplicity() {
+        return multiplicity;
+    }
+    
+    /**
+     * @see org.apache.tuscany.model.assembly.Reference#setMultiplicity(org.apache.tuscany.model.assembly.Multiplicity)
+     */
+    public void setMultiplicity(Multiplicity multiplicity) {
+        checkNotFrozen();
+        this.multiplicity=multiplicity;
+    }
+
+}

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

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

Added: incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ServiceContractImpl.java
URL: http://svn.apache.org/viewcvs/incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ServiceContractImpl.java?rev=379052&view=auto
==============================================================================
--- incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ServiceContractImpl.java (added)
+++ incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ServiceContractImpl.java Mon Feb 20 00:15:10 2006
@@ -0,0 +1,81 @@
+/**
+ *
+ *  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.impl;
+
+import org.apache.tuscany.model.assembly.Scope;
+import org.apache.tuscany.model.assembly.ServiceContract;
+
+/**
+ * An implementation of ServiceContract.
+ */
+public class ServiceContractImpl extends ExtensibleImpl implements ServiceContract {
+    
+    private Class interface_;
+    private Class callbackInterface;
+    private Scope scope;
+    
+    /**
+     * Constructor
+     */
+    protected ServiceContractImpl() {
+    }
+
+    /**
+     * @see org.apache.tuscany.model.assembly.ServiceContract#getCallbackInterface()
+     */
+    public Class getCallbackInterface() {
+        return callbackInterface;
+    }
+
+    /**
+     * @see org.apache.tuscany.model.assembly.ServiceContract#getInterface()
+     */
+    public Class getInterface() {
+        return interface_;
+    }
+
+    /**
+     * @see org.apache.tuscany.model.assembly.ServiceContract#getScope()
+     */
+    public Scope getScope() {
+        return scope;
+    }
+
+    /**
+     * @see org.apache.tuscany.model.assembly.ServiceContract#setCallbackInterface(java.lang.Class)
+     */
+    public void setCallbackInterface(Class value) {
+        checkNotFrozen();
+        callbackInterface=value;
+    }
+
+    /**
+     * @see org.apache.tuscany.model.assembly.ServiceContract#setInterface(java.lang.Class)
+     */
+    public void setInterface(Class value) {
+        checkNotFrozen();
+        interface_=value;
+    }
+
+    /**
+     * @see org.apache.tuscany.model.assembly.ServiceContract#setScope(org.apache.tuscany.model.assembly.Scope)
+     */
+    public void setScope(Scope scope) {
+        checkNotFrozen();
+        this.scope=scope;
+    }
+}

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

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

Added: incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ServiceImpl.java
URL: http://svn.apache.org/viewcvs/incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ServiceImpl.java?rev=379052&view=auto
==============================================================================
--- incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ServiceImpl.java (added)
+++ incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ServiceImpl.java Mon Feb 20 00:15:10 2006
@@ -0,0 +1,32 @@
+/**
+ *
+ *  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.impl;
+
+import org.apache.tuscany.model.assembly.Service;
+
+/**
+ * An implementation of Service.
+ */
+public class ServiceImpl extends PortImpl implements Service {
+    
+    /**
+     * Constructor
+     */
+    protected ServiceImpl() {
+    }
+
+}

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

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

Added: incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ServiceURIImpl.java
URL: http://svn.apache.org/viewcvs/incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ServiceURIImpl.java?rev=379052&view=auto
==============================================================================
--- incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ServiceURIImpl.java (added)
+++ incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ServiceURIImpl.java Mon Feb 20 00:15:10 2006
@@ -0,0 +1,196 @@
+/**
+ *
+ *  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.impl;
+
+import org.eclipse.emf.common.util.URI;
+
+import org.apache.tuscany.model.assembly.ConfiguredPort;
+import org.apache.tuscany.model.assembly.ConfiguredReference;
+import org.apache.tuscany.model.assembly.ConfiguredService;
+import org.apache.tuscany.model.assembly.ModuleComponent;
+import org.apache.tuscany.model.assembly.AggregatePart;
+import org.apache.tuscany.model.assembly.Service;
+import org.apache.tuscany.model.assembly.ServiceURI;
+
+/**
+ * An implementation of ServiceURI.
+ */
+public class ServiceURIImpl implements ServiceURI {
+
+    private String address;
+    private Boolean isSCAScheme;
+    private boolean isParsed;
+    private String moduleComponentName;
+    private String partName;
+    private String serviceName;
+
+    /**
+     * Constructor
+     */
+    protected ServiceURIImpl(String address) {
+        this.address = address;
+    }
+
+    /**
+     * Constructor
+     *
+     * @param moduleComponent
+     * @param configuredPort
+     */
+    protected ServiceURIImpl(ModuleComponent moduleComponent, ConfiguredPort configuredPort) {
+        if (moduleComponent != null)
+            moduleComponentName = moduleComponent.getName();
+        else
+            moduleComponentName = "";
+        if (configuredPort instanceof ConfiguredService) {
+            ConfiguredService configuredService = (ConfiguredService) configuredPort;
+            partName = configuredService.getAggregatePart().getName();
+            Service service = configuredService.getService();
+            if (service != null) {
+                serviceName = configuredService.getService().getName();
+                address = "sca:///" + moduleComponentName + '/' + partName + '/' + serviceName;
+            } else {
+                address = "sca:///" + moduleComponentName + '/' + partName;
+            }
+
+        } else if (configuredPort instanceof ConfiguredReference) {
+            ConfiguredReference configuredReference = (ConfiguredReference) configuredPort;
+            AggregatePart part = configuredReference.getAggregatePart();
+            partName = part.getName();
+            serviceName = "reference." + configuredReference.getReference().getName();
+            address = "sca:///" + moduleComponentName + '/' + partName + '/' + serviceName;
+        }
+
+        isSCAScheme = Boolean.TRUE;
+        isParsed = true;
+    }
+
+    /**
+     * Constructor
+     *
+     * @param moduleComponent
+     * @param service
+     */
+    protected ServiceURIImpl(ModuleComponent moduleComponent, String targetServiceName) {
+        if (moduleComponent != null)
+            moduleComponentName = moduleComponent.getName();
+        else
+            moduleComponentName = "";
+        int s = targetServiceName.indexOf('/');
+        if (s == -1) {
+            partName = targetServiceName;
+            address = "sca:///" + moduleComponentName + '/' + partName;
+        } else {
+            partName = targetServiceName.substring(0, s);
+            this.serviceName = targetServiceName.substring(s + 1);
+            address = "sca:///" + moduleComponentName + '/' + partName + '/' + this.serviceName;
+        }
+        isSCAScheme = Boolean.TRUE;
+        isParsed = true;
+    }
+
+    /**
+     * Returns true if the address scheme is sca:
+     *
+     * @return
+     */
+    public boolean isSCAScheme() {
+        if (isSCAScheme == null) {
+            if (address.startsWith("sca://")) {
+                isSCAScheme = Boolean.TRUE;
+            } else {
+                isSCAScheme = Boolean.FALSE;
+            }
+        }
+        return isSCAScheme.booleanValue();
+    }
+
+    /**
+     * Returns a URI for this address
+     *
+     * @return
+     */
+    public URI getURI() {
+        return URI.createURI(address);
+    }
+
+    /**
+     * @return Returns the address.
+     */
+    public String getAddress() {
+        return address;
+    }
+
+    /**
+     * Parse the address.
+     */
+    private void parse() {
+        isParsed = true;
+        if (isSCAScheme()) {
+            int s1 = address.indexOf('/', 6);
+            if (s1 == -1)
+                return;
+            s1++;
+            int s2 = address.indexOf('/', s1);
+            if (s2 == -1)
+                return;
+            moduleComponentName = address.substring(s1, s2);
+            s2++;
+            int s3 = address.indexOf('/', s2);
+            if (s3 == -1) {
+                partName = address.substring(s2);
+                return;
+            }
+            partName = address.substring(s2, s3);
+            s3++;
+            serviceName = address.substring(s3);
+        }
+    }
+
+    /**
+     * Returns the module component name
+     *
+     * @return
+     */
+    public String getModuleComponentName() {
+        if (!isParsed)
+            parse();
+        return moduleComponentName;
+    }
+
+    /**
+     * Returns the part name
+     *
+     * @return
+     */
+    public String getPartName() {
+        if (!isParsed)
+            parse();
+        return partName;
+    }
+
+    /**
+     * Returns the service name
+     * @return
+     */
+    public String getServiceName() {
+        if (!isParsed)
+            parse();
+        return serviceName;
+	}
+
+}

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

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

Added: incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/SimpleComponentImpl.java
URL: http://svn.apache.org/viewcvs/incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/SimpleComponentImpl.java?rev=379052&view=auto
==============================================================================
--- incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/SimpleComponentImpl.java (added)
+++ incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/SimpleComponentImpl.java Mon Feb 20 00:15:10 2006
@@ -0,0 +1,32 @@
+/**
+ *
+ *  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.impl;
+
+import org.apache.tuscany.model.assembly.SimpleComponent;
+
+/**
+ * An implementation of SimpleComponent.
+ */
+public class SimpleComponentImpl extends ComponentImpl implements SimpleComponent {
+
+    /**
+     * Constructor
+     */
+    protected SimpleComponentImpl() {
+    }
+
+}

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

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

Added: incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/SubsystemImpl.java
URL: http://svn.apache.org/viewcvs/incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/SubsystemImpl.java?rev=379052&view=auto
==============================================================================
--- incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/SubsystemImpl.java (added)
+++ incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/SubsystemImpl.java Mon Feb 20 00:15:10 2006
@@ -0,0 +1,49 @@
+/**
+ *
+ *  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.impl;
+
+import org.apache.tuscany.model.assembly.Subsystem;
+
+/**
+ * An implementation of Subsystem.
+ */
+public class SubsystemImpl extends AggregateImpl implements Subsystem {
+    
+    private String uri;
+
+    /**
+     * Constructor
+     */
+    protected SubsystemImpl() {
+    }
+
+    /**
+     * @see org.apache.tuscany.model.assembly.Subsystem#getURI()
+     */
+    public String getURI() {
+        return uri;
+    }
+
+    /**
+     * @see org.apache.tuscany.model.assembly.Subsystem#setURI(java.lang.String)
+     */
+    public void setURI(String value) {
+        checkNotFrozen();
+        uri=value;
+    }
+
+}

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

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

Added: incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/scdl/Binding.java
URL: http://svn.apache.org/viewcvs/incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/scdl/Binding.java?rev=379052&view=auto
==============================================================================
--- incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/scdl/Binding.java (added)
+++ incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/scdl/Binding.java Mon Feb 20 00:15:10 2006
@@ -0,0 +1,50 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id$
+ */
+package org.apache.tuscany.model.assembly.scdl;
+
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>Binding</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * <ul>
+ *   <li>{@link org.apache.tuscany.model.assembly.scdl.Binding#getUri <em>Uri</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ */
+public interface Binding
+{
+  /**
+   * Returns the value of the '<em><b>Uri</b></em>' attribute.
+   * <!-- begin-user-doc -->
+   * <p>
+   * If the meaning of the '<em>Uri</em>' attribute isn't clear,
+   * there really should be more of a description here...
+   * </p>
+   * <!-- end-user-doc -->
+   * @return the value of the '<em>Uri</em>' attribute.
+   * @see #setUri(String)
+   * @generated
+   */
+  String getUri();
+
+  /**
+   * Sets the value of the '{@link org.apache.tuscany.model.assembly.scdl.Binding#getUri <em>Uri</em>}' attribute.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @param value the new value of the '<em>Uri</em>' attribute.
+   * @see #getUri()
+   * @generated
+   */
+  void setUri(String value);
+
+} // Binding

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

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