You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tuscany.apache.org by Jim Marino <ji...@gmail.com> on 2006/04/13 04:04:16 UTC

Fwd: svn commit: r393677 [5/6] - in /incubator/tuscany/java/sca: bindings/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/assembly/impl/ bindings/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/builder/ bindings/binding.axis2/src/m...

So I think Sebastien hold the record for largest commit - 6 parts ;-)  
I tried but could only get up to 4!

Jim



Begin forwarded message:

> From: jsdelfino@apache.org
> Date: April 12, 2006 6:04:14 PM PDT
> To: tuscany-commits@ws.apache.org
> Subject: svn commit: r393677 [5/6] - in /incubator/tuscany/java/ 
> sca: bindings/binding.axis2/src/main/java/org/apache/tuscany/ 
> binding/axis2/assembly/impl/ bindings/binding.axis2/src/main/java/ 
> org/apache/tuscany/binding/axis2/builder/ bindings/binding.axis2/ 
> src/m...
> Reply-To: tuscany-dev@ws.apache.org
>
>
> Modified: incubator/tuscany/java/sca/model/src/main/java/org/apache/ 
> tuscany/model/assembly/Port.java
> URL: http://svn.apache.org/viewcvs/incubator/tuscany/java/sca/model/ 
> src/main/java/org/apache/tuscany/model/assembly/Port.java? 
> rev=393677&r1=393676&r2=393677&view=diff
> ====================================================================== 
> ========
> --- incubator/tuscany/java/sca/model/src/main/java/org/apache/ 
> tuscany/model/assembly/Port.java (original)
> +++ incubator/tuscany/java/sca/model/src/main/java/org/apache/ 
> tuscany/model/assembly/Port.java Wed Apr 12 18:03:55 2006
> @@ -19,7 +19,7 @@
>  /**
>   * Abstraction for the association of a service contract with a  
> requestor or provider.
>   */
> -public interface Port extends AssemblyModelObject {
> +public interface Port extends AssemblyObject {
>      /**
>       * Returns the contract for invocations of a service using  
> this port.
>       * @return the oontract for invocations of a service using  
> this port
>
> Added: incubator/tuscany/java/sca/model/src/main/java/org/apache/ 
> tuscany/model/assembly/ProxyFactoryHolder.java
> URL: http://svn.apache.org/viewcvs/incubator/tuscany/java/sca/model/ 
> src/main/java/org/apache/tuscany/model/assembly/ 
> ProxyFactoryHolder.java?rev=393677&view=auto
> ====================================================================== 
> ========
> --- incubator/tuscany/java/sca/model/src/main/java/org/apache/ 
> tuscany/model/assembly/ProxyFactoryHolder.java (added)
> +++ incubator/tuscany/java/sca/model/src/main/java/org/apache/ 
> tuscany/model/assembly/ProxyFactoryHolder.java Wed Apr 12 18:03:55  
> 2006
> @@ -0,0 +1,34 @@
> +/**
> + *
> + *  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;
> +
> +/**
> + * A model object that can hold a runtime proxy factory object.
> + */
> +public interface ProxyFactoryHolder {
> +
> +    /**
> +     * Sets the proxy factory
> +     */
> +    void setProxyFactory(Object proxyFactory);
> +
> +    /**
> +     * Returns the proxy factory
> +     */
> +    Object getProxyFactory();
> +
> +}
>
> Propchange: incubator/tuscany/java/sca/model/src/main/java/org/ 
> apache/tuscany/model/assembly/ProxyFactoryHolder.java
> ---------------------------------------------------------------------- 
> --------
>     svn:eol-style = native
>
> Propchange: incubator/tuscany/java/sca/model/src/main/java/org/ 
> apache/tuscany/model/assembly/ProxyFactoryHolder.java
> ---------------------------------------------------------------------- 
> --------
>     svn:keywords = Rev,Date
>
> Modified: incubator/tuscany/java/sca/model/src/main/java/org/apache/ 
> tuscany/model/assembly/ServiceContract.java
> URL: http://svn.apache.org/viewcvs/incubator/tuscany/java/sca/model/ 
> src/main/java/org/apache/tuscany/model/assembly/ 
> ServiceContract.java?rev=393677&r1=393676&r2=393677&view=diff
> ====================================================================== 
> ========
> --- incubator/tuscany/java/sca/model/src/main/java/org/apache/ 
> tuscany/model/assembly/ServiceContract.java (original)
> +++ incubator/tuscany/java/sca/model/src/main/java/org/apache/ 
> tuscany/model/assembly/ServiceContract.java Wed Apr 12 18:03:55 2006
> @@ -48,14 +48,12 @@
>      /**
>       * Returns the scope of this service contract.
>       * @return
> -     * todo missing javadoc
>       */
>      Scope getScope();
>
>      /**
>       * Sets the scope.
>       * @param scope of this service contract.
> -     * todo missing javadoc
>       */
>      void setScope(Scope scope);
>
>
> Modified: incubator/tuscany/java/sca/model/src/main/java/org/apache/ 
> tuscany/model/assembly/Subsystem.java
> URL: http://svn.apache.org/viewcvs/incubator/tuscany/java/sca/model/ 
> src/main/java/org/apache/tuscany/model/assembly/Subsystem.java? 
> rev=393677&r1=393676&r2=393677&view=diff
> ====================================================================== 
> ========
> --- incubator/tuscany/java/sca/model/src/main/java/org/apache/ 
> tuscany/model/assembly/Subsystem.java (original)
> +++ incubator/tuscany/java/sca/model/src/main/java/org/apache/ 
> tuscany/model/assembly/Subsystem.java Wed Apr 12 18:03:55 2006
> @@ -21,7 +21,7 @@
>  /**
>   * Represents a subsystem.
>   */
> -public interface Subsystem extends Aggregate {
> +public interface Subsystem extends Composite {
>
>      /**
>       * Returns the subsystem uri.
>
> Added: incubator/tuscany/java/sca/model/src/main/java/org/apache/ 
> tuscany/model/assembly/impl/AssemblyContextImpl.java
> URL: http://svn.apache.org/viewcvs/incubator/tuscany/java/sca/model/ 
> src/main/java/org/apache/tuscany/model/assembly/impl/ 
> AssemblyContextImpl.java?rev=393677&view=auto
> ====================================================================== 
> ========
> --- incubator/tuscany/java/sca/model/src/main/java/org/apache/ 
> tuscany/model/assembly/impl/AssemblyContextImpl.java (added)
> +++ incubator/tuscany/java/sca/model/src/main/java/org/apache/ 
> tuscany/model/assembly/impl/AssemblyContextImpl.java Wed Apr 12  
> 18:03:55 2006
> @@ -0,0 +1,75 @@
> +/**
> + *
> + *  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.common.resource.ResourceLoader;
> +import org.apache.tuscany.model.assembly.AssemblyFactory;
> +import org.apache.tuscany.model.assembly.AssemblyContext;
> +import org.apache.tuscany.model.assembly.loader.AssemblyModelLoader;
> +import org.apache.tuscany.sdo.util.SDOUtil;
> +
> +import commonj.sdo.helper.TypeHelper;
> +
> +/**
> + */
> +public class AssemblyContextImpl implements AssemblyContext {
> +
> +    private final AssemblyFactory assemblyFactory;
> +    private final AssemblyModelLoader assemblyLoader;
> +    private final ResourceLoader applicationResourceLoader;
> +    private final TypeHelper typeHelper;
> +
> +    public AssemblyContextImpl(AssemblyModelLoader assemblyLoader,  
> ResourceLoader resourceLoader) {
> +        this(new AssemblyFactoryImpl(), assemblyLoader,  
> resourceLoader);
> +    }
> +
> +    public AssemblyContextImpl(AssemblyFactory assemblyFactory,  
> AssemblyModelLoader assemblyLoader, ResourceLoader artifactLoader) {
> +        this(assemblyFactory, assemblyLoader, artifactLoader,  
> SDOUtil.createTypeHelper());
> +    }
> +
> +    public AssemblyContextImpl(AssemblyFactory assemblyFactory,  
> AssemblyModelLoader assemblyLoader, ResourceLoader artifactLoader,  
> TypeHelper typeHelper) {
> +        this.assemblyFactory = assemblyFactory;
> +        this.assemblyLoader = assemblyLoader;
> +        this.applicationResourceLoader = artifactLoader;
> +        this.typeHelper=typeHelper;
> +    }
> +
> +    /**
> +     * @see  
> org.apache.tuscany.model.assembly.AssemblyContext#getAssemblyFactory()
> +     */
> +    public AssemblyFactory getAssemblyFactory() {
> +        return assemblyFactory;
> +    }
> +
> +    public ResourceLoader getApplicationResourceLoader() {
> +        return applicationResourceLoader;
> +    }
> +
> +    /**
> +     * @see  
> org.apache.tuscany.model.assembly.AssemblyContext#getAssemblyLoader()
> +     */
> +    public AssemblyModelLoader getAssemblyLoader() {
> +        return assemblyLoader;
> +    }
> +
> +    /**
> +     * @see  
> org.apache.tuscany.model.assembly.AssemblyContext#getTypeHelper()
> +     */
> +    public TypeHelper getTypeHelper() {
> +        return typeHelper;
> +    }
> +}
>
> Propchange: incubator/tuscany/java/sca/model/src/main/java/org/ 
> apache/tuscany/model/assembly/impl/AssemblyContextImpl.java
> ---------------------------------------------------------------------- 
> --------
>     svn:eol-style = native
>
> Propchange: incubator/tuscany/java/sca/model/src/main/java/org/ 
> apache/tuscany/model/assembly/impl/AssemblyContextImpl.java
> ---------------------------------------------------------------------- 
> --------
>     svn:keywords = Rev,Date
>
> Modified: incubator/tuscany/java/sca/model/src/main/java/org/apache/ 
> tuscany/model/assembly/impl/AssemblyFactoryImpl.java
> URL: http://svn.apache.org/viewcvs/incubator/tuscany/java/sca/model/ 
> src/main/java/org/apache/tuscany/model/assembly/impl/ 
> AssemblyFactoryImpl.java?rev=393677&r1=393676&r2=393677&view=diff
> ====================================================================== 
> ========
> --- incubator/tuscany/java/sca/model/src/main/java/org/apache/ 
> tuscany/model/assembly/impl/AssemblyFactoryImpl.java (original)
> +++ incubator/tuscany/java/sca/model/src/main/java/org/apache/ 
> tuscany/model/assembly/impl/AssemblyFactoryImpl.java Wed Apr 12  
> 18:03:55 2006
> @@ -18,9 +18,9 @@
>
>  import javax.xml.namespace.QName;
>
> -import org.apache.tuscany.model.assembly.AggregatePart;
> +import org.apache.tuscany.model.assembly.Part;
>  import org.apache.tuscany.model.assembly.AssemblyFactory;
> -import org.apache.tuscany.model.assembly.ComponentType;
> +import org.apache.tuscany.model.assembly.ComponentInfo;
>  import org.apache.tuscany.model.assembly.ConfiguredPort;
>  import org.apache.tuscany.model.assembly.ConfiguredProperty;
>  import org.apache.tuscany.model.assembly.ConfiguredReference;
> @@ -35,7 +35,7 @@
>  import org.apache.tuscany.model.assembly.Reference;
>  import org.apache.tuscany.model.assembly.Service;
>  import org.apache.tuscany.model.assembly.ServiceURI;
> -import org.apache.tuscany.model.assembly.SimpleComponent;
> +import org.apache.tuscany.model.assembly.AtomicComponent;
>  import org.apache.tuscany.model.assembly.Subsystem;
>  import org.apache.tuscany.model.assembly.Wire;
>  import org.apache.tuscany.model.assembly.Binding;
> @@ -58,150 +58,87 @@
>          super();
>      }
>
> -    /**
> -     * @see  
> org.apache.tuscany.model.assembly.AssemblyFactory#createSimpleComponen 
> t()
> -     */
> -    public SimpleComponent createSimpleComponent() {
> -        return new SimpleComponentImpl();
> +    public AtomicComponent createSimpleComponent() {
> +        return new AtomicComponentImpl();
>      }
>
> -    /**
> -     * @see  
> org.apache.tuscany.model.assembly.AssemblyFactory#createComponentType( 
> )
> -     */
> -    public ComponentType createComponentType() {
> -        return new ComponentTypeImpl();
> +    public ComponentInfo createComponentInfo() {
> +        return new ComponentInfoImpl();
>      }
>
> -    /**
> -     * @see  
> org.apache.tuscany.model.assembly.AssemblyFactory#createEntryPoint()
> -     */
>      public EntryPoint createEntryPoint() {
>          return new EntryPointImpl();
>      }
>
> -    /**
> -     * @see  
> org.apache.tuscany.model.assembly.AssemblyFactory#createExternalServic 
> e()
> -     */
>      public ExternalService createExternalService() {
>          return new ExternalServiceImpl();
>      }
>
> -    /**
> -     * @see  
> org.apache.tuscany.model.assembly.AssemblyFactory#createJavaServiceCon 
> tract()
> -     */
>      public JavaServiceContract createJavaServiceContract() {
>          return new JavaServiceContractImpl();
>      }
>
> -    /**
> -     * @see  
> org.apache.tuscany.model.assembly.AssemblyFactory#createModule()
> -     */
>      public Module createModule() {
>          return new ModuleImpl();
>      }
>
> -    /**
> -     * @see  
> org.apache.tuscany.model.assembly.AssemblyFactory#createModuleFragment 
> ()
> -     */
>      public ModuleFragment createModuleFragment() {
>          return new ModuleFragmentImpl();
>      }
>
> -    /**
> -     * @see  
> org.apache.tuscany.model.assembly.AssemblyFactory#createModuleComponen 
> t()
> -     */
>      public ModuleComponent createModuleComponent() {
>          return new ModuleComponentImpl();
>      }
>
> -    /**
> -     * @see  
> org.apache.tuscany.model.assembly.AssemblyFactory#createProperty()
> -     */
>      public Property createProperty() {
>          return new PropertyImpl();
>      }
>
> -    /**
> -     * @see  
> org.apache.tuscany.model.assembly.AssemblyFactory#createConfiguredProp 
> erty()
> -     */
>      public ConfiguredProperty createConfiguredProperty() {
>          return new ConfiguredPropertyImpl();
>      }
>
> -    /**
> -     * @see  
> org.apache.tuscany.model.assembly.AssemblyFactory#createReference()
> -     */
>      public Reference createReference() {
>          return new ReferenceImpl();
>      }
>
> -    /**
> -     * @see  
> org.apache.tuscany.model.assembly.AssemblyFactory#createConfiguredRefe 
> rence()
> -     */
>      public ConfiguredReference createConfiguredReference() {
>          return new ConfiguredReferenceImpl();
>      }
>
> -    /**
> -     * @see  
> org.apache.tuscany.model.assembly.AssemblyFactory#createService()
> -     */
>      public Service createService() {
>          return new ServiceImpl();
>      }
>
> -    /**
> -     * @see  
> org.apache.tuscany.model.assembly.AssemblyFactory#createConfiguredServ 
> ice()
> -     */
>      public ConfiguredService createConfiguredService() {
>          return new ConfiguredServiceImpl();
>      }
>
> -    /**
> -     * @see  
> org.apache.tuscany.model.assembly.AssemblyFactory#createSubsystem()
> -     */
>      public Subsystem createSubsystem() {
>          return new SubsystemImpl();
>      }
>
> -    /**
> -     * @see  
> org.apache.tuscany.model.assembly.AssemblyFactory#createWSDLServiceCon 
> tract()
> -     */
>      public WSDLServiceContract createWSDLServiceContract() {
>          return new WSDLServiceContractImpl();
>      }
>
> -    /**
> -     * @see  
> org.apache.tuscany.model.assembly.AssemblyFactory#createServiceURI 
> (java.lang.String)
> -     */
>      public ServiceURI createServiceURI(String uri) {
>          return new ServiceURIImpl(uri);
>      }
>
> -    /**
> -     * @see  
> org.apache.tuscany.model.assembly.AssemblyFactory#createServiceURI 
> (org.apache.tuscany.model.assembly.ModuleComponent, java.lang.String)
> -     */
>      public ServiceURI createServiceURI(ModuleComponent  
> moduleComponent, String serviceName) {
>          return new ServiceURIImpl(moduleComponent, serviceName);
>      }
>
> -    /*
> -     * @see  
> org.apache.tuscany.model.assembly.AssemblyFactory#createServiceURI 
> (org.apache.tuscany.model.assembly.ModuleComponent,  
> org.apache.tuscany.model.assembly.AggregatePart,  
> org.apache.tuscany.model.assembly.ConfiguredPort)
> -     */
> -    public ServiceURI createServiceURI(ModuleComponent  
> moduleComponent, AggregatePart aggregatePart, ConfiguredPort  
> configuredPort) {
> +    public ServiceURI createServiceURI(ModuleComponent  
> moduleComponent, Part aggregatePart, ConfiguredPort configuredPort) {
>          return new ServiceURIImpl(moduleComponent, aggregatePart,  
> configuredPort);
>      }
>
> -    /**
> -     * @see  
> org.apache.tuscany.model.assembly.AssemblyFactory#createQName 
> (java.lang.String)
> -     */
>      public QName createQName(String uri) {
>          int h = uri.indexOf('#');
>          return new QName(uri.substring(0, h), uri.substring(h + 1));
>      }
>
> -    /**
> -     * @see  
> org.apache.tuscany.model.assembly.AssemblyFactory#createWire()
> -     */
>      public Wire createWire() {
>          return new WireImpl();
>      }
> @@ -235,13 +172,13 @@
>          service.setName(entryPointName);
>          service.setServiceContract(serviceContract);
>          ConfiguredService configuredService =  
> createConfiguredService();
> -        configuredService.setService(service);
> +        configuredService.setPort(service);
>
>          // create and configure a reference to target
>          Reference reference = createReference();
>          reference.setMultiplicity(Multiplicity.ONE_ONE);
>          ConfiguredReference configuredReference =  
> createConfiguredReference(null, targetName);
> -        configuredReference.setReference(reference);
> +        configuredReference.setPort(reference);
>
>          return createEntryPoint(entryPointName, configuredService,  
> binding, configuredReference);
>      }
>
> Added: incubator/tuscany/java/sca/model/src/main/java/org/apache/ 
> tuscany/model/assembly/impl/AssemblyObjectImpl.java
> URL: http://svn.apache.org/viewcvs/incubator/tuscany/java/sca/model/ 
> src/main/java/org/apache/tuscany/model/assembly/impl/ 
> AssemblyObjectImpl.java?rev=393677&view=auto
> ====================================================================== 
> ========
> --- incubator/tuscany/java/sca/model/src/main/java/org/apache/ 
> tuscany/model/assembly/impl/AssemblyObjectImpl.java (added)
> +++ incubator/tuscany/java/sca/model/src/main/java/org/apache/ 
> tuscany/model/assembly/impl/AssemblyObjectImpl.java Wed Apr 12  
> 18:03:55 2006
> @@ -0,0 +1,124 @@
> +/**
> + *
> + *  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.Collection;
> +import java.util.Collections;
> +import java.util.List;
> +
> +import org.apache.tuscany.model.assembly.AssemblyContext;
> +import org.apache.tuscany.model.assembly.AssemblyObject;
> +import org.apache.tuscany.model.assembly.AssemblyVisitor;
> +
> +/**
> + * A base class for assembly model objects.
> + */
> +public abstract class AssemblyObjectImpl implements AssemblyObject {
> +
> +    private boolean frozen;
> +    private boolean initialized;
> +
> +    protected AssemblyObjectImpl() {
> +    }
> +
> +    public boolean accept(AssemblyVisitor visitor) {
> +        return visitor.visit(this);
> +    }
> +
> +    /**
> +     * Walk a visitor through a collection of model objects.
> +     * @param collection
> +     * @param visitor
> +     * @return
> +     */
> +    protected boolean accept(Collection collection,  
> AssemblyVisitor visitor) {
> +        for (Object member : collection) {
> +            if (member instanceof AssemblyObject) {
> +                if (!((AssemblyObject)member).accept(visitor))
> +                    return false;
> +            }
> +        }
> +        return true;
> +    }
> +
> +    public void freeze() {
> +        if (!frozen)
> +            frozen=true;
> +    }
> +
> +    /**
> +     * Returns true if the object is frozen
> +     */
> +    protected boolean isFrozen() {
> +        return frozen;
> +    }
> +
> +    /**
> +     * Freeze a list and its members
> +     */
> +    protected <T> List<T> freeze(List<T> list) {
> +        list=Collections.unmodifiableList(list);
> +        for (Object member : list) {
> +            if (member instanceof AssemblyObject) {
> +                ((AssemblyObject)member).freeze();
> +            }
> +        }
> +        return list;
> +    }
> +
> +    /**
> +     * Check that the current model object can be modified.
> +     * @throws IllegalStateException
> +     */
> +    protected void checkNotFrozen() {
> +        if (frozen)
> +            throw new IllegalStateException("Attempt to modify a  
> frozen assembly model");
> +    }
> +
> +    public void initialize(AssemblyContext modelContext) {
> +        if (!initialized)
> +            initialized=true;
> +    }
> +
> +    /**
> +     * Returns true if the object is initialized
> +     */
> +    protected boolean isInitialized() {
> +        return initialized;
> +    }
> +
> +    /**
> +     * Initialize members of a collection
> +     */
> +    protected void initialize(Collection collection,  
> AssemblyContext modelContext) {
> +        for (Object member : collection) {
> +            if (member instanceof AssemblyObject) {
> +                ((AssemblyObject)member).initialize(modelContext);
> +            }
> +        }
> +    }
> +
> +    /**
> +     * Check that the current model object is initialized.
> +     * @throws IllegalStateException
> +     */
> +    protected void checkInitialized() {
> +        if (!initialized)
> +            throw new IllegalStateException("Attempt to use an  
> uninitialized assembly model");
> +    }
> +
> +}
>
> Propchange: incubator/tuscany/java/sca/model/src/main/java/org/ 
> apache/tuscany/model/assembly/impl/AssemblyObjectImpl.java
> ---------------------------------------------------------------------- 
> --------
>     svn:eol-style = native
>
> Propchange: incubator/tuscany/java/sca/model/src/main/java/org/ 
> apache/tuscany/model/assembly/impl/AssemblyObjectImpl.java
> ---------------------------------------------------------------------- 
> --------
>     svn:keywords = Rev,Date
>
> Added: incubator/tuscany/java/sca/model/src/main/java/org/apache/ 
> tuscany/model/assembly/impl/AtomicComponentImpl.java
> URL: http://svn.apache.org/viewcvs/incubator/tuscany/java/sca/model/ 
> src/main/java/org/apache/tuscany/model/assembly/impl/ 
> AtomicComponentImpl.java?rev=393677&view=auto
> ====================================================================== 
> ========
> --- incubator/tuscany/java/sca/model/src/main/java/org/apache/ 
> tuscany/model/assembly/impl/AtomicComponentImpl.java (added)
> +++ incubator/tuscany/java/sca/model/src/main/java/org/apache/ 
> tuscany/model/assembly/impl/AtomicComponentImpl.java Wed Apr 12  
> 18:03:55 2006
> @@ -0,0 +1,30 @@
> +/**
> + *
> + *  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.AtomicComponent;
> +import org.apache.tuscany.model.assembly.AtomicImplementation;
> +
> +/**
> + * An implementation of AtomicComponent.
> + */
> +public class AtomicComponentImpl extends  
> ComponentImpl<AtomicImplementation> implements AtomicComponent {
> +
> +    protected AtomicComponentImpl() {
> +    }
> +
> +}
>
> Propchange: incubator/tuscany/java/sca/model/src/main/java/org/ 
> apache/tuscany/model/assembly/impl/AtomicComponentImpl.java
> ---------------------------------------------------------------------- 
> --------
>     svn:eol-style = native
>
> Propchange: incubator/tuscany/java/sca/model/src/main/java/org/ 
> apache/tuscany/model/assembly/impl/AtomicComponentImpl.java
> ---------------------------------------------------------------------- 
> --------
>     svn:keywords = Rev,Date
>
> Added: incubator/tuscany/java/sca/model/src/main/java/org/apache/ 
> tuscany/model/assembly/impl/AtomicImplementationImpl.java
> URL: http://svn.apache.org/viewcvs/incubator/tuscany/java/sca/model/ 
> src/main/java/org/apache/tuscany/model/assembly/impl/ 
> AtomicImplementationImpl.java?rev=393677&view=auto
> ====================================================================== 
> ========
> --- incubator/tuscany/java/sca/model/src/main/java/org/apache/ 
> tuscany/model/assembly/impl/AtomicImplementationImpl.java (added)
> +++ incubator/tuscany/java/sca/model/src/main/java/org/apache/ 
> tuscany/model/assembly/impl/AtomicImplementationImpl.java Wed Apr  
> 12 18:03:55 2006
> @@ -0,0 +1,29 @@
> +/**
> + *
> + *  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.AtomicImplementation;
> +
> +/**
> + * An implementation of AtomicImplementation.
> + */
> +public abstract class AtomicImplementationImpl extends  
> ImplementationImpl implements AtomicImplementation {
> +
> +    protected AtomicImplementationImpl() {
> +    }
> +
> +}
>
> Propchange: incubator/tuscany/java/sca/model/src/main/java/org/ 
> apache/tuscany/model/assembly/impl/AtomicImplementationImpl.java
> ---------------------------------------------------------------------- 
> --------
>     svn:eol-style = native
>
> Propchange: incubator/tuscany/java/sca/model/src/main/java/org/ 
> apache/tuscany/model/assembly/impl/AtomicImplementationImpl.java
> ---------------------------------------------------------------------- 
> --------
>     svn:keywords = Rev,Date
>
> Modified: incubator/tuscany/java/sca/model/src/main/java/org/apache/ 
> tuscany/model/assembly/impl/BindingImpl.java
> URL: http://svn.apache.org/viewcvs/incubator/tuscany/java/sca/model/ 
> src/main/java/org/apache/tuscany/model/assembly/impl/ 
> BindingImpl.java?rev=393677&r1=393676&r2=393677&view=diff
> ====================================================================== 
> ========
> --- incubator/tuscany/java/sca/model/src/main/java/org/apache/ 
> tuscany/model/assembly/impl/BindingImpl.java (original)
> +++ incubator/tuscany/java/sca/model/src/main/java/org/apache/ 
> tuscany/model/assembly/impl/BindingImpl.java Wed Apr 12 18:03:55 2006
> @@ -16,8 +16,8 @@
>   */
>  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.AssemblyContext;
> +import org.apache.tuscany.model.assembly.AssemblyVisitor;
>  import org.apache.tuscany.model.assembly.Binding;
>
>  /**
> @@ -26,41 +26,25 @@
>  public class BindingImpl extends ExtensibleImpl implements Binding {
>
>      private String uri;
> -    private Object contextFactory;
>
> -    /**
> -     * Constructor
> -     */
>      protected BindingImpl() {
>      }
>
> -    /**
> -     * @see org.apache.tuscany.model.assembly.Binding#getURI()
> -     */
>      public String getURI() {
>          return uri;
>      }
>
> -    /**
> -     * @see org.apache.tuscany.model.assembly.Binding#setURI 
> (java.lang.String)
> -     */
>      public void setURI(String value) {
>          checkNotFrozen();
>          uri=value;
>      }
>
> -    /**
> -     * @see  
> org.apache.tuscany.model.assembly.AssemblyModelObject#initialize 
> (org.apache.tuscany.model.assembly.AssemblyModelContext)
> -     */
> -    public void initialize(AssemblyModelContext modelContext) {
> +    public void initialize(AssemblyContext modelContext) {
>          if (isInitialized())
>              return;
>          super.initialize(modelContext);
>      }
>
> -    /**
> -     * @see  
> org.apache.tuscany.model.assembly.AssemblyModelObject#freeze()
> -     */
>      public void freeze() {
>          if (isFrozen())
>              return;
> @@ -68,25 +52,7 @@
>
>      }
>
> -    /**
> -     * @see  
> org.apache.tuscany.model.assembly.ContextFactoryHolder#getContextFacto 
> ry()
> -     */
> -    public Object getContextFactory() {
> -        return contextFactory;
> -    }
> -
> -    /**
> -     * @see  
> org.apache.tuscany.model.assembly.ContextFactoryHolder#setContextFacto 
> ry(java.lang.Object)
> -     */
> -    public void setContextFactory(Object configuration) {
> -        checkNotFrozen();
> -        this.contextFactory = configuration;
> -    }
> -
> -    /**
> -     * @see  
> org.apache.tuscany.model.assembly.impl.AggregateImpl#accept 
> (org.apache.tuscany.model.assembly.AssemblyModelVisitor)
> -     */
> -    public boolean accept(AssemblyModelVisitor visitor) {
> +    public boolean accept(AssemblyVisitor visitor) {
>          if (!super.accept(visitor))
>              return false;
>
>
> Modified: incubator/tuscany/java/sca/model/src/main/java/org/apache/ 
> tuscany/model/assembly/impl/ComponentImpl.java
> URL: http://svn.apache.org/viewcvs/incubator/tuscany/java/sca/model/ 
> src/main/java/org/apache/tuscany/model/assembly/impl/ 
> ComponentImpl.java?rev=393677&r1=393676&r2=393677&view=diff
> ====================================================================== 
> ========
> --- incubator/tuscany/java/sca/model/src/main/java/org/apache/ 
> tuscany/model/assembly/impl/ComponentImpl.java (original)
> +++ incubator/tuscany/java/sca/model/src/main/java/org/apache/ 
> tuscany/model/assembly/impl/ComponentImpl.java Wed Apr 12 18:03:55  
> 2006
> @@ -16,180 +16,194 @@
>   */
>  package org.apache.tuscany.model.assembly.impl;
>
> -import java.util.ArrayList;
> -import java.util.Collections;
>  import java.util.HashMap;
>  import java.util.List;
>  import java.util.Map;
>
> +import org.apache.tuscany.model.assembly.AssemblyContext;
>  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.AssemblyInitializationException;
> +import org.apache.tuscany.model.assembly.AssemblyVisitor;
>  import org.apache.tuscany.model.assembly.Component;
> -import org.apache.tuscany.model.assembly.ComponentImplementation;
> -import org.apache.tuscany.model.assembly.ComponentType;
> +import org.apache.tuscany.model.assembly.ComponentInfo;
> +import org.apache.tuscany.model.assembly.ConfiguredPort;
>  import org.apache.tuscany.model.assembly.ConfiguredProperty;
>  import org.apache.tuscany.model.assembly.ConfiguredReference;
>  import org.apache.tuscany.model.assembly.ConfiguredService;
> +import org.apache.tuscany.model.assembly.Implementation;
> +import org.apache.tuscany.model.assembly.Property;
>  import org.apache.tuscany.model.assembly.Reference;
>  import org.apache.tuscany.model.assembly.Service;
> +import org.apache.tuscany.model.util.NotifyingList;
>
>  /**
>   * An implementation of Component.
>   */
> -public abstract class ComponentImpl extends AggregatePartImpl  
> implements Component {
> -
> -    private Map<String, ConfiguredReference>  
> configuredReferencesMap = new HashMap<String, ConfiguredReference>();
> -    private List<ConfiguredService> configuredServices = new  
> ArrayList<ConfiguredService>();
> -    private Map<String, ConfiguredService> configuredServicesMap;
> -    private List<ConfiguredProperty> configuredProperties = new  
> ArrayList<ConfiguredProperty>();
> -    private Map<String, ConfiguredProperty> configuredPropertiesMap;
> -    private ComponentImplementation implementation;
> +public abstract class ComponentImpl<I extends Implementation>  
> extends PartImpl implements Component<I> {
>
>      /**
> -     * @see  
> org.apache.tuscany.model.assembly.Component#getComponentImplementation 
> ()
> +     * A list of configured ports synchronized with a map
>       */
> -    public ComponentImplementation getComponentImplementation() {
> +    private class ConfiguredPortList<E extends ConfiguredPort>  
> extends NotifyingList<E>{
> +
> +        Map<String, E> map;
> +
> +        private ConfiguredPortList(Map<String, E> map) {
> +            this.map=map;
> +        }
> +
> +        protected void added(E element) {
> +            String name=element.getPort()!=null? element.getPort 
> ().getName():element.getName();
> +            map.put(name, element);
> +            element.setPart(ComponentImpl.this);
> +        }
> +        protected void removed(E element) {
> +            String name=element.getPort()!=null? element.getPort 
> ().getName():element.getName();
> +            map.remove(name);
> +            element.setPart(null);
> +        }
> +    }
> +
> +    private Map<String, ConfiguredReference>  
> configuredReferencesMap = new HashMap<String, ConfiguredReference>();
> +    private List<ConfiguredReference> configuredReferences = new  
> ConfiguredPortList<ConfiguredReference>(configuredReferencesMap);
> +
> +    private Map<String, ConfiguredService> configuredServicesMap =  
> new HashMap<String, ConfiguredService>();
> +    private List<ConfiguredService> configuredServices = new  
> ConfiguredPortList<ConfiguredService>(configuredServicesMap);
> +
> +    /**
> +     * A list of properties synchronized with a map
> +     */
> +    private class ConfiguredPropertyList<E extends  
> ConfiguredProperty> extends NotifyingList<E>{
> +
> +        protected void added(E element) {
> +            String name=element.getProperty()!=null?  
> element.getProperty().getName():element.getName();
> +            configuredPropertiesMap.put(name, element);
> +        }
> +        protected void removed(E element) {
> +            String name=element.getProperty()!=null?  
> element.getProperty().getName():element.getName();
> +            configuredPropertiesMap.remove(name);
> +        }
> +    }
> +
> +    private List<ConfiguredProperty> configuredProperties = new  
> ConfiguredPropertyList<ConfiguredProperty>();
> +    private Map<String, ConfiguredProperty>  
> configuredPropertiesMap=new HashMap<String, ConfiguredProperty>();
> +
> +    private I implementation;
> +
> +    public I getImplementation() {
>          return implementation;
>      }
>
> -    /**
> -     * @see  
> org.apache.tuscany.model.assembly.Component#setComponentImplementation 
> (org.apache.tuscany.model.assembly.ComponentImplementation)
> -     */
> -    public void setComponentImplementation(ComponentImplementation  
> value) {
> +    public void setImplementation(I value) {
>          checkNotFrozen();
>          implementation = value;
>      }
>
> -    /**
> -     * @see  
> org.apache.tuscany.model.assembly.Component#getConfiguredServices()
> -     */
>      public List<ConfiguredService> getConfiguredServices() {
>          return configuredServices;
>      }
>
>      public ConfiguredService getConfiguredService(String name) {
> -        checkInitialized();
>          return configuredServicesMap.get(name);
>      }
>
> -    public Map<String, ConfiguredReference> getConfiguredReferences 
> () {
> -        return configuredReferencesMap;
> +    public List<ConfiguredReference> getConfiguredReferences() {
> +        return configuredReferences;
>      }
>
> -    /**
> -     * @see  
> org.apache.tuscany.model.assembly.Component#getConfiguredReference 
> (java.lang.String)
> -     */
>      public ConfiguredReference getConfiguredReference(String name) {
>          return configuredReferencesMap.get(name);
>      }
>
> -    /**
> -     * @see  
> org.apache.tuscany.model.assembly.Component#getConfiguredProperties()
> -     */
>      public List<ConfiguredProperty> getConfiguredProperties() {
>          return configuredProperties;
>      }
>
> -    /**
> -     * @see  
> org.apache.tuscany.model.assembly.Component#getConfiguredProperty 
> (java.lang.String)
> -     */
>      public ConfiguredProperty getConfiguredProperty(String name) {
> -        checkInitialized();
>          return configuredPropertiesMap.get(name);
>      }
>
> -    /**
> -     * @see  
> org.apache.tuscany.model.assembly.AssemblyModelObject#initialize 
> (org.apache.tuscany.model.assembly.AssemblyModelContext)
> -     */
> -    public void initialize(AssemblyModelContext modelContext) {
> +    public void initialize(AssemblyContext modelContext) {
>          if (isInitialized())
>              return;
>          super.initialize(modelContext);
>
>          // Initialize the implementation
> -        ComponentImplementation implementation =  
> getComponentImplementation();
>          if (implementation == null) {
> -            throw new IllegalStateException("No implementation for  
> component [" + getName() + ']');
> +            throw new AssemblyInitializationException("No  
> implementation for component [" + getName() + ']');
>          }
>          implementation.initialize(modelContext);
> -        ComponentType componentType =  
> implementation.getComponentType();
>
> -        // Derive the configured services, references and  
> properties from the component implementation
> -        //FIXME we have two options here: either just index the  
> configured services, references and properties
> -        // that we find in the corresponding lists, or derive them  
> from the services, references and properties on
> -        // the component type, for now just check if the lists are  
> empty or not to determine which option to go with
> -        configuredServicesMap = new HashMap<String,  
> ConfiguredService>();
> -        if (configuredServices.isEmpty()) {
> -            AssemblyFactory factory =  
> modelContext.getAssemblyFactory();
> -            for (Service service : componentType.getServices()) {
> -                ConfiguredService configuredService =  
> factory.createConfiguredService();
> -                configuredService.setPort(service);
> -                configuredServices.add(configuredService);
> -                configuredServicesMap.put(service.getName(),  
> configuredService);
> -                ((ConfiguredPortImpl)  
> configuredService).setAggregatePart(this);
> -                configuredService.initialize(modelContext);
> -            }
> -        } else {
> +        // Derive the configured services from the component  
> implementation
> +        ComponentInfo componentInfo=implementation.getComponentInfo 
> ();
> +        AssemblyFactory factory = modelContext.getAssemblyFactory();
> +        for (Service service : componentInfo.getServices()) {
> +            ConfiguredService configuredService =  
> factory.createConfiguredService();
> +            configuredService.setPort(service);
> +            configuredServices.add(configuredService);
> +            configuredService.initialize(modelContext);
> +        }
>
> -            // Just populate the maps of services, references and  
> properties from the contents of
> -            // the corresponding lists
> -            for (ConfiguredService configuredService :  
> configuredServices) {
> -                configuredServicesMap.put 
> (configuredService.getService().getName(), configuredService);
> -                ((ConfiguredPortImpl)  
> configuredService).setAggregatePart(this);
> -                configuredService.initialize(modelContext);
> +        // Derive the configured references from the references on  
> the component info
> +        for (Reference reference : componentInfo.getReferences()) {
> +            ConfiguredReference configuredReference =  
> configuredReferencesMap.get(reference.getName());
> +            if (configuredReference==null) {
> +                 
> configuredReference=factory.createConfiguredReference();
> +                configuredReference.setPort(reference);
> +                configuredReferences.add(configuredReference);
> +                configuredReference.initialize(modelContext);
> +            } else {
> +                configuredReference.setPort(reference);
> +                configuredReference.initialize(modelContext);
> +            }
> +        }
> +        for (ConfiguredReference configuredReference :  
> configuredReferences) {
> +            if (configuredReference.getPort()==null) {
> +                throw new AssemblyInitializationException 
> ("Undefined reference ["+configuredReference.getName()+"]");
>              }
> -
>          }
>
> -        // Match configured properties to the properties on the  
> component type
> -        configuredPropertiesMap = new HashMap<String,  
> ConfiguredProperty>(configuredProperties.size());
> +        // Derive the configured properties from the properties on  
> the component info
> +        for (Property property : componentInfo.getProperties()) {
> +            ConfiguredProperty configuredProperty =  
> configuredPropertiesMap.get(property.getName());
> +            if (configuredProperty==null) {
> +                configuredProperty=factory.createConfiguredProperty 
> ();
> +                configuredProperty.setProperty(property);
> +                configuredProperties.add(configuredProperty);
> +                configuredProperty.initialize(modelContext);
> +            } else {
> +                configuredProperty.setProperty(property);
> +                configuredProperty.initialize(modelContext);
> +            }
> +        }
>          for (ConfiguredProperty configuredProperty :  
> configuredProperties) {
> -            String name = configuredProperty.getName();
> -            configuredProperty.setProperty 
> (componentType.getProperty(name));
> -            configuredProperty.initialize(modelContext);
> -            configuredPropertiesMap.put(name, configuredProperty);
> +            if (configuredProperty.getProperty()==null) {
> +                throw new AssemblyInitializationException 
> ("Undefined property ["+configuredProperty.getName()+"]");
> +            }
>          }
>
> -        // Match configured references to the references on the  
> component type
> -        for (ConfiguredReference configuredReference :  
> configuredReferencesMap.values()) {
> -            String name = configuredReference.getName();
> -            ((ConfiguredPortImpl)  
> configuredReference).setAggregatePart(this);
> -            Reference reference = componentType.getReference(name);
> -            configuredReference.setReference(reference);
> -            configuredReference.initialize(modelContext);
> -        }
>      }
>
> -    /**
> -     * @see  
> org.apache.tuscany.model.assembly.AssemblyModelObject#freeze()
> -     */
>      public void freeze() {
>          if (isFrozen())
>              return;
>          super.freeze();
>
>          // Freeze configured services, references and properties
> -        configuredServices = Collections.unmodifiableList 
> (configuredServices);
> -        freeze(configuredServices);
> -        configuredReferencesMap = Collections.unmodifiableMap 
> (configuredReferencesMap);
> -        freeze(configuredReferencesMap.values());
> -        configuredProperties = Collections.unmodifiableList 
> (configuredProperties);
> -        freeze(configuredProperties);
> +        configuredServices = freeze(configuredServices);
> +        configuredReferences = freeze(configuredReferences);
> +        configuredProperties = freeze(configuredProperties);
>          if (implementation != null)
>              implementation.freeze();
>      }
>
> -    /**
> -     * @see  
> org.apache.tuscany.model.assembly.impl.AssemblyModelObjectImpl#accept( 
> org.apache.tuscany.model.assembly.AssemblyModelVisitor)
> -     */
> -    public boolean accept(AssemblyModelVisitor visitor) {
> +    public boolean accept(AssemblyVisitor visitor) {
>          if (!super.accept(visitor))
>              return false;
>
>          if (!accept(configuredServices, visitor))
>              return false;
> -        if (!accept(configuredReferencesMap.values(), visitor))
> +        if (!accept(configuredReferences, visitor))
>              return false;
>          if (!accept(configuredProperties, visitor))
>              return false;
>
> Added: incubator/tuscany/java/sca/model/src/main/java/org/apache/ 
> tuscany/model/assembly/impl/ComponentInfoImpl.java
> URL: http://svn.apache.org/viewcvs/incubator/tuscany/java/sca/model/ 
> src/main/java/org/apache/tuscany/model/assembly/impl/ 
> ComponentInfoImpl.java?rev=393677&view=auto
> ====================================================================== 
> ========
> --- incubator/tuscany/java/sca/model/src/main/java/org/apache/ 
> tuscany/model/assembly/impl/ComponentInfoImpl.java (added)
> +++ incubator/tuscany/java/sca/model/src/main/java/org/apache/ 
> tuscany/model/assembly/impl/ComponentInfoImpl.java Wed Apr 12  
> 18:03:55 2006
> @@ -0,0 +1,147 @@
> +/**
> + *
> + *  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.HashMap;
> +import java.util.List;
> +import java.util.Map;
> +
> +import org.apache.tuscany.model.assembly.AssemblyContext;
> +import org.apache.tuscany.model.assembly.AssemblyVisitor;
> +import org.apache.tuscany.model.assembly.ComponentInfo;
> +import org.apache.tuscany.model.assembly.Port;
> +import org.apache.tuscany.model.assembly.Property;
> +import org.apache.tuscany.model.assembly.Reference;
> +import org.apache.tuscany.model.assembly.Service;
> +import org.apache.tuscany.model.util.NotifyingList;
> +
> +/**
> + * An implementation of ComponentInfo.
> + */
> +public class ComponentInfoImpl extends ExtensibleImpl implements  
> ComponentInfo {
> +
> +    /**
> +     * A list of ports synchronized with a map
> +     */
> +    private class PortList<E extends Port> extends NotifyingList<E>{
> +
> +        Map<String, E> map;
> +
> +        private PortList(Map<String, E> map) {
> +            this.map=map;
> +        }
> +
> +        protected void added(E element) {
> +            map.put(element.getName(), element);
> +        }
> +        protected void removed(E element) {
> +            map.remove(element.getName());
> +        }
> +    }
> +
> +    private Map<String, Reference> referencesMap=new  
> HashMap<String, Reference>();
> +    private List<Reference> references=new PortList<Reference> 
> (referencesMap);
> +
> +    private Map<String, Service> servicesMap=new HashMap<String,  
> Service>();
> +    private List<Service> services=new PortList<Service> 
> (servicesMap);
> +
> +    /**
> +     * A list of properties synchronized with a map
> +     */
> +    private class PropertyList<E extends Property> extends  
> NotifyingList<E>{
> +
> +        protected void added(E element) {
> +            propertiesMap.put(element.getName(), element);
> +        }
> +        protected void removed(E element) {
> +            propertiesMap.remove(element.getName());
> +        }
> +    }
> +
> +    private Map<String, Property> propertiesMap=new  
> HashMap<String, Property>();
> +    private List<Property> properties=new PropertyList<Property>();
> +
> +    protected ComponentInfoImpl() {
> +    }
> +
> +    public List<Reference> getReferences() {
> +        return references;
> +    }
> +
> +    public Reference getReference(String name) {
> +        return referencesMap.get(name);
> +    }
> +
> +    public List<Service> getServices() {
> +        return services;
> +    }
> +
> +    public Service getService(String name) {
> +        return servicesMap.get(name);
> +    }
> +
> +    public List<Property> getProperties() {
> +        return properties;
> +    }
> +
> +    public Property getProperty(String name) {
> +        return propertiesMap.get(name);
> +    }
> +
> +    public void initialize(AssemblyContext modelContext) {
> +        if (isInitialized())
> +            return;
> +        super.initialize(modelContext);
> +
> +        // Initialize references, properties and services
> +        for (Reference reference : references) {
> +            reference.initialize(modelContext);
> +        }
> +        for (Property property : properties) {
> +            property.initialize(modelContext);
> +        }
> +        for (Service service : services) {
> +            service.initialize(modelContext);
> +        }
> +    }
> +
> +    public void freeze() {
> +        if (isFrozen())
> +            return;
> +        super.freeze();
> +
> +        // Freeze lists of services, references and properties
> +        services=freeze(services);
> +        references=freeze(references);
> +        properties=freeze(properties);
> +    }
> +
> +    public boolean accept(AssemblyVisitor visitor) {
> +        if (!super.accept(visitor))
> +            return false;
> +
> +        if (!accept(services, visitor))
> +            return false;
> +        if (!accept(references, visitor))
> +            return false;
> +        if (!accept(properties, visitor))
> +            return false;
> +
> +        return true;
> +    }
> +
> +}
>
> Propchange: incubator/tuscany/java/sca/model/src/main/java/org/ 
> apache/tuscany/model/assembly/impl/ComponentInfoImpl.java
> ---------------------------------------------------------------------- 
> --------
>     svn:eol-style = native
>
> Propchange: incubator/tuscany/java/sca/model/src/main/java/org/ 
> apache/tuscany/model/assembly/impl/ComponentInfoImpl.java
> ---------------------------------------------------------------------- 
> --------
>     svn:keywords = Rev,Date
>
> Added: incubator/tuscany/java/sca/model/src/main/java/org/apache/ 
> tuscany/model/assembly/impl/CompositeImpl.java
> URL: http://svn.apache.org/viewcvs/incubator/tuscany/java/sca/model/ 
> src/main/java/org/apache/tuscany/model/assembly/impl/ 
> CompositeImpl.java?rev=393677&view=auto
> ====================================================================== 
> ========
> --- incubator/tuscany/java/sca/model/src/main/java/org/apache/ 
> tuscany/model/assembly/impl/CompositeImpl.java (added)
> +++ incubator/tuscany/java/sca/model/src/main/java/org/apache/ 
> tuscany/model/assembly/impl/CompositeImpl.java Wed Apr 12 18:03:55  
> 2006
> @@ -0,0 +1,343 @@
> +/**
> + *
> + *  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.HashMap;
> +import java.util.List;
> +import java.util.Map;
> +
> +import org.apache.tuscany.model.assembly.AssemblyContext;
> +import org.apache.tuscany.model.assembly.AssemblyFactory;
> +import org.apache.tuscany.model.assembly.AssemblyVisitor;
> +import org.apache.tuscany.model.assembly.Component;
> +import org.apache.tuscany.model.assembly.ComponentInfo;
> +import org.apache.tuscany.model.assembly.Composite;
> +import org.apache.tuscany.model.assembly.ConfiguredProperty;
> +import org.apache.tuscany.model.assembly.ConfiguredReference;
> +import org.apache.tuscany.model.assembly.ConfiguredService;
> +import org.apache.tuscany.model.assembly.EntryPoint;
> +import org.apache.tuscany.model.assembly.ExternalService;
> +import org.apache.tuscany.model.assembly.Implementation;
> +import org.apache.tuscany.model.assembly.ImportWSDL;
> +import org.apache.tuscany.model.assembly.Multiplicity;
> +import org.apache.tuscany.model.assembly.OverrideOption;
> +import org.apache.tuscany.model.assembly.Part;
> +import org.apache.tuscany.model.assembly.Reference;
> +import org.apache.tuscany.model.assembly.Service;
> +import org.apache.tuscany.model.assembly.ServiceContract;
> +import org.apache.tuscany.model.assembly.ServiceURI;
> +import org.apache.tuscany.model.assembly.Wire;
> +import org.apache.tuscany.model.util.NotifyingList;
> +
> +/**
> + * An implementation of Composite.
> + */
> +public abstract class CompositeImpl extends ExtensibleImpl  
> implements Composite {
> +
> +    private String name;
> +    private ComponentInfo componentInfo;
> +
> +    /**
> +     * A list of parts synchronized with a map
> +     */
> +    private class PartList<E extends Part> extends NotifyingList<E>{
> +        protected void added(E element) {
> +            partsMap.put(element.getName(), element);
> +            element.setComposite(CompositeImpl.this);
> +        }
> +        protected void removed(E element) {
> +            partsMap.remove(element.getName());
> +            element.setComposite(null);
> +        }
> +    }
> +
> +    private Map<String, Part> partsMap = new HashMap<String, Part>();
> +
> +    private List<Component> components = new PartList<Component>();
> +    private List<EntryPoint> entryPoints = new PartList<EntryPoint> 
> ();
> +    private List<ExternalService> externalServices = new  
> PartList<ExternalService>();
> +
> +    private List<Wire> wires = new ArrayList<Wire>();
> +
> +    /**
> +     * A list of WSDL imports synchronized with a map
> +     */
> +    private class ImportWSDLList extends NotifyingList<ImportWSDL>{
> +        protected void added(ImportWSDL element) {
> +            List<ImportWSDL> importList=wsdlImportsMap.get 
> (element.getNamespace());
> +            if (importList==null) {
> +                importList=new ArrayList<ImportWSDL>();
> +                wsdlImportsMap.put(element.getNamespace(),  
> importList);
> +            }
> +            importList.add(element);
> +        }
> +        protected void removed(ImportWSDL element) {
> +            List<ImportWSDL> importList=wsdlImportsMap.get 
> (element.getNamespace());
> +            if (importList!=null) {
> +                importList.remove(element);
> +                if (importList.isEmpty())
> +                    wsdlImportsMap.remove(element.getNamespace());
> +            }
> +        }
> +    }
> +
> +    private Map<String, List<ImportWSDL>> wsdlImportsMap = new  
> HashMap<String, List<ImportWSDL>>();
> +
> +    private List<ImportWSDL> wsdlImports = new ImportWSDLList();
> +
> +    private AssemblyContext modelContext;
> +
> +    protected CompositeImpl() {
> +    }
> +
> +    public String getName() {
> +        return name;
> +    }
> +
> +    public void setName(String newName) {
> +        checkNotFrozen();
> +        name = newName;
> +    }
> +
> +    public List<Component> getComponents() {
> +        return components;
> +    }
> +
> +    public List<EntryPoint> getEntryPoints() {
> +        return entryPoints;
> +    }
> +
> +    public List<ExternalService> getExternalServices() {
> +        return externalServices;
> +    }
> +
> +    public Part getPart(String name) {
> +        return partsMap.get(name);
> +    }
> +
> +    public List<Wire> getWires() {
> +        return wires;
> +    }
> +
> +    public List<ImportWSDL> getWSDLImports() {
> +        return wsdlImports;
> +    }
> +
> +    public List<ImportWSDL> getWSDLImports(String namespace) {
> +        return wsdlImportsMap.get(namespace);
> +    }
> +
> +    public ComponentInfo getComponentInfo() {
> +        return componentInfo;
> +    }
> +
> +    public void setComponentInfo(ComponentInfo componentType) {
> +        checkNotFrozen();
> +        this.componentInfo=componentType;
> +    }
> +
> +    public AssemblyContext getAssemblyContext() {
> +        checkInitialized();
> +        return modelContext;
> +    }
> +
> +    public ConfiguredService getConfiguredService(ServiceURI  
> address) {
> +        String partName = address.getPartName();
> +        String serviceName = address.getServiceName();
> +        Part part = getPart(partName);
> +        if (part instanceof Component) {
> +            Component<Implementation> component=(Component)part;
> +            if (serviceName != null) {
> +                return component.getConfiguredService(serviceName);
> +            } else {
> +                if (!component.getConfiguredServices().isEmpty()) {
> +                    return component.getConfiguredServices().get(0);
> +                } else {
> +                    return null;
> +                }
> +            }
> +
> +        } if (part instanceof ExternalService) {
> +            ExternalService externalService = (ExternalService)part;
> +            return externalService.getConfiguredService();
> +        } else
> +            return null;
> +    }
> +
> +    public void initialize(AssemblyContext modelContext) {
> +        if (isInitialized())
> +            return;
> +        super.initialize(modelContext);
> +
> +        // Save the model context
> +        this.modelContext = modelContext;
> +
> +        // Initialize WSDL imports
> +        for (ImportWSDL importWSDL : wsdlImports) {
> +            importWSDL.initialize(modelContext);
> +        }
> +
> +        // Initialize parts
> +        for (Part part : externalServices) {
> +            part.initialize(modelContext);
> +        }
> +        for (Part part : components) {
> +            part.initialize(modelContext);
> +        }
> +        for (Part part : entryPoints) {
> +            part.initialize(modelContext);
> +        }
> +
> +        // Derive the component info from the entry points and  
> external services in the composite
> +        // Also derive properties from the overridable properties  
> of the components in the composite
> +        if (componentInfo==null) {
> +            AssemblyFactory factory =  
> modelContext.getAssemblyFactory();
> +            componentInfo = factory.createComponentInfo();
> +            for (EntryPoint entryPoint : getEntryPoints()) {
> +                Service service = factory.createService();
> +                service.setName(entryPoint.getName());
> +                ServiceContract serviceContract =  
> entryPoint.getConfiguredService().getPort().getServiceContract();
> +                if (serviceContract != null)
> +                    service.setServiceContract(serviceContract);
> +                componentInfo.getServices().add(service);
> +
> +                ConfiguredReference configuredReference =  
> entryPoint.getConfiguredReference();
> +                ServiceURI sourceURI = factory.createServiceURI 
> (null, entryPoint, configuredReference);
> +                for (String target : configuredReference.getTargets 
> ()) {
> +                    ServiceURI targetURI =factory.createServiceURI 
> (null, target);
> +                    Wire wire=factory.createWire();
> +                    wire.setSource(sourceURI);
> +                    wire.setTarget(targetURI);
> +                    getWires().add(wire);
> +                }
> +            }
> +            for (ExternalService externalService :  
> getExternalServices()) {
> +                if (externalService.getOverrideOption()==null ||  
> externalService.getOverrideOption()==OverrideOption.NO)
> +                    continue;
> +                Reference reference = factory.createReference();
> +                reference.setName(externalService.getName());
> +                ServiceContract serviceContract =  
> externalService.getConfiguredService().getPort().getServiceContract();
> +                if (serviceContract != null)
> +                    reference.setServiceContract(serviceContract);
> +                componentInfo.getReferences().add(reference);
> +            }
> +            for (Component<Implementation> component :  
> getComponents()) {
> +                for (ConfiguredProperty configuredProperty :  
> component.getConfiguredProperties()) {
> +                    if (configuredProperty.getOverrideOption() 
> ==null || configuredProperty.getOverrideOption()==OverrideOption.NO)
> +                        continue;
> +                    componentInfo.getProperties().add 
> (configuredProperty.getProperty());
> +                }
> +
> +                for (ConfiguredReference configuredReference :  
> component.getConfiguredReferences()) {
> +                    // Create a wire
> +                    ServiceURI sourceURI =factory.createServiceURI 
> (null, component, configuredReference);
> +                    for (String target :  
> configuredReference.getTargets()) {
> +                        ServiceURI targetURI  
> =factory.createServiceURI(null, target);
> +                        Wire wire=factory.createWire();
> +                        wire.setSource(sourceURI);
> +                        wire.setTarget(targetURI);
> +                        getWires().add(wire);
> +                    }
> +                }
> +            }
> +        }
> +        componentInfo.initialize(modelContext);
> +
> +        // Wire the module parts
> +        for (Wire wire : getWires()) {
> +
> +            // Get the source reference
> +            ServiceURI sourceURI=wire.getSource();
> +            ConfiguredReference configuredReference = null;
> +            String partName = sourceURI.getPartName();
> +            String referenceName = sourceURI.getServiceName();
> +            if (referenceName != null) {
> +                Component component = (Component)getPart(partName);
> +                if (component != null) {
> +                    configuredReference =  
> component.getConfiguredReference(referenceName);
> +                }
> +            } else {
> +                EntryPoint entryPoint = (EntryPoint)getPart 
> (partName);
> +                if (entryPoint != null) {
> +                    configuredReference =  
> entryPoint.getConfiguredReference();
> +                }
> +            }
> +            if (configuredReference == null) {
> +                throw new IllegalArgumentException("Cannot find  
> wire source " + sourceURI.getAddress());
> +            } else {
> +
> +                // Resolve the target service endpoint
> +                ServiceURI targetURI = wire.getTarget();
> +                ConfiguredService configuredService =  
> getConfiguredService(targetURI);
> +                if (configuredService != null) {
> +
> +                    // Wire the reference to the target
> +                    Multiplicity  
> multiplicity=configuredReference.getPort().getMultiplicity();
> +                    if (multiplicity==Multiplicity.ZERO_N ||  
> multiplicity==Multiplicity.ONE_N) {
> +                         
> configuredReference.getTargetConfiguredServices().add 
> (configuredService);
> +                    } else {
> +                         
> configuredReference.getTargetConfiguredServices().clear();
> +                         
> configuredReference.getTargetConfiguredServices().add 
> (configuredService);
> +                    }
> +                } else {
> +                    throw new IllegalArgumentException("Cannot  
> find service for " + targetURI.getAddress());
> +                }
> +            }
> +        }
> +
> +    }
> +
> +    public void freeze() {
> +        if (isFrozen())
> +            return;
> +        super.freeze();
> +
> +        // Freeze component info
> +        if (componentInfo!=null)
> +            componentInfo.freeze();
> +
> +        // Freeze lists
> +        wsdlImports=freeze(wsdlImports);
> +        components = freeze(components);
> +        entryPoints = freeze(entryPoints);
> +        externalServices = freeze(externalServices);
> +        wires = freeze(wires);
> +    }
> +
> +    public boolean accept(AssemblyVisitor visitor) {
> +        if (!super.accept(visitor))
> +            return false;
> +
> +        if (!accept(wsdlImports, visitor))
> +            return false;
> +
> +        if (!accept(partsMap.values(), visitor))
> +            return false;
> +
> +        if (!accept(wires, visitor))
> +            return false;
> +
> +        if (componentInfo!=null) {
> +            if (!componentInfo.accept(visitor))
> +                return false;
> +        }
> +
> +        return true;
> +    }
> +
> +}
>
> Propchange: incubator/tuscany/java/sca/model/src/main/java/org/ 
> apache/tuscany/model/assembly/impl/CompositeImpl.java
> ---------------------------------------------------------------------- 
> --------
>     svn:eol-style = native
>
> Propchange: incubator/tuscany/java/sca/model/src/main/java/org/ 
> apache/tuscany/model/assembly/impl/CompositeImpl.java
> ---------------------------------------------------------------------- 
> --------
>     svn:keywords = Rev,Date
>
> Modified: incubator/tuscany/java/sca/model/src/main/java/org/apache/ 
> tuscany/model/assembly/impl/ConfiguredPortImpl.java
> URL: http://svn.apache.org/viewcvs/incubator/tuscany/java/sca/model/ 
> src/main/java/org/apache/tuscany/model/assembly/impl/ 
> ConfiguredPortImpl.java?rev=393677&r1=393676&r2=393677&view=diff
> ====================================================================== 
> ========
> --- incubator/tuscany/java/sca/model/src/main/java/org/apache/ 
> tuscany/model/assembly/impl/ConfiguredPortImpl.java (original)
> +++ incubator/tuscany/java/sca/model/src/main/java/org/apache/ 
> tuscany/model/assembly/impl/ConfiguredPortImpl.java Wed Apr 12  
> 18:03:55 2006
> @@ -16,105 +16,72 @@
>   */
>  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.Part;
> +import org.apache.tuscany.model.assembly.AssemblyContext;
> +import org.apache.tuscany.model.assembly.AssemblyVisitor;
>  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;
> +public abstract class ConfiguredPortImpl<P extends Port> extends  
> AssemblyObjectImpl implements ConfiguredPort<P> {
> +    private String name;
> +    private Part part;
> +    private P port;
>
> -    private Object contextFactory;
>      private Object proxyFactory;
>
> -    /**
> -     * Constructor
> -     */
>      protected ConfiguredPortImpl() {
>      }
> +
> +    public String getName() {
> +        return name;
> +    }
> +
> +    public void setName(String name) {
> +        checkNotFrozen();
> +        this.name=name;
> +    }
>
> -    /**
> -     * @see  
> org.apache.tuscany.model.assembly.ConfiguredPort#getPort()
> -     */
> -    public Port getPort() {
> +    public P getPort() {
>          return port;
>      }
>
> -    /**
> -     * @see  
> org.apache.tuscany.model.assembly.ConfiguredPort#setPort 
> (org.apache.tuscany.model.assembly.Port)
> -     */
> -    public void setPort(Port port) {
> +    public void setPort(P port) {
>          checkNotFrozen();
>          this.port = port;
>      }
>
> -    /**
> -     * @see  
> org.apache.tuscany.model.assembly.ConfiguredPort#getAggregatePart()
> -     */
> -    public AggregatePart getAggregatePart() {
> -        checkInitialized();
> -        return aggregatePart;
> +    public Part getPart() {
> +        return part;
>      }
> -
> -    /**
> -     * Sets the aggregate part containing this configured port.
> -     * @param aggregatePart
> -     */
> -    protected void setAggregatePart(AggregatePart aggregatePart) {
> +
> +    public void setPart(Part part) {
>          checkNotFrozen();
> -        this.aggregatePart=aggregatePart;
> +        this.part=part;
>      }
>
> -    /**
> -     * @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.ContextFactoryHolder#getContextFacto 
> ry()
> -     */
> -    public Object getContextFactory() {
> -        return contextFactory;
> -    }
> -
> -    /**
> -     * @see  
> org.apache.tuscany.model.assembly.ContextFactoryHolder#setContextFacto 
> ry(java.lang.Object)
> -     */
> -    public void setContextFactory(Object configuration) {
> -        checkNotFrozen();
> -        contextFactory = configuration;
> -    }
> -
> -    /**
> -     * @see  
> org.apache.tuscany.model.assembly.impl.AssemblyModelObjectImpl#initial 
> ize(org.apache.tuscany.model.assembly.AssemblyModelContext)
> -     */
> -    public void initialize(AssemblyModelContext modelContext) {
> +    public void initialize(AssemblyContext modelContext) {
>          if (isInitialized())
>              return;
>          super.initialize(modelContext);
>
> -        if (port!=null)
> +        if (port!=null) {
> +            name=port.getName();
>              port.initialize(modelContext);
> +        }
>      }
>
> -    /**
> -     * @see  
> org.apache.tuscany.model.assembly.impl.AssemblyModelObjectImpl#freeze( 
> )
> -     */
>      public void freeze() {
>          if (isFrozen())
>              return;
> @@ -124,10 +91,7 @@
>              port.freeze();
>      }
>
> -    /**
> -     * @see  
> org.apache.tuscany.model.assembly.impl.AssemblyModelObjectImpl#accept( 
> org.apache.tuscany.model.assembly.AssemblyModelVisitor)
> -     */
> -    public boolean accept(AssemblyModelVisitor visitor) {
> +    public boolean accept(AssemblyVisitor visitor) {
>          if (!super.accept(visitor))
>              return false;
>
>
> Modified: incubator/tuscany/java/sca/model/src/main/java/org/apache/ 
> tuscany/model/assembly/impl/ConfiguredPropertyImpl.java
> URL: http://svn.apache.org/viewcvs/incubator/tuscany/java/sca/model/ 
> src/main/java/org/apache/tuscany/model/assembly/impl/ 
> ConfiguredPropertyImpl.java?rev=393677&r1=393676&r2=393677&view=diff
> ====================================================================== 
> ========
> --- incubator/tuscany/java/sca/model/src/main/java/org/apache/ 
> tuscany/model/assembly/impl/ConfiguredPropertyImpl.java (original)
> +++ incubator/tuscany/java/sca/model/src/main/java/org/apache/ 
> tuscany/model/assembly/impl/ConfiguredPropertyImpl.java Wed Apr 12  
> 18:03:55 2006
> @@ -16,8 +16,8 @@
>   */
>  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.AssemblyContext;
> +import org.apache.tuscany.model.assembly.AssemblyVisitor;
>  import org.apache.tuscany.model.assembly.ConfiguredProperty;
>  import org.apache.tuscany.model.assembly.OverrideOption;
>  import org.apache.tuscany.model.assembly.Property;
> @@ -25,15 +25,12 @@
>  /**
>   * Implementation of ConfiguredProperty
>   */
> -public class ConfiguredPropertyImpl extends  
> AssemblyModelObjectImpl implements ConfiguredProperty {
> +public class ConfiguredPropertyImpl extends AssemblyObjectImpl  
> implements ConfiguredProperty {
>      private String name;
>      private OverrideOption overrideOption;
>      private Object value;
>      private Property property;
>
> -    /**
> -     * Constructor
> -     */
>      protected ConfiguredPropertyImpl() {
>      }
>
> @@ -45,55 +42,34 @@
>          this.name = name;
>      }
>
> -    /**
> -     * @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.ConfiguredProperty#getOverrideOption 
> ()
> -     */
>      public OverrideOption getOverrideOption() {
>          return overrideOption;
>      }
>
> -    /*
> -     * @see  
> org.apache.tuscany.model.assembly.ConfiguredProperty#setOverrideOption 
> (org.apache.tuscany.model.assembly.OverrideOption)
> -     */
>      public void setOverrideOption(OverrideOption value) {
>          checkNotFrozen();
>          this.overrideOption=value;
>      }
>
> -    /**
> -     * @see  
> org.apache.tuscany.model.assembly.impl.AssemblyModelObjectImpl#initial 
> ize(org.apache.tuscany.model.assembly.AssemblyModelContext)
> -     */
> -    public void initialize(AssemblyModelContext modelContext) {
> +    public void initialize(AssemblyContext modelContext) {
>          if (isInitialized())
>              return;
>          super.initialize(modelContext);
> @@ -102,9 +78,6 @@
>              property.initialize(modelContext);
>      }
>
> -    /**
> -     * @see  
> org.apache.tuscany.model.assembly.impl.AssemblyModelObjectImpl#freeze( 
> )
> -     */
>      public void freeze() {
>          if (isFrozen())
>              return;
> @@ -114,10 +87,7 @@
>              property.freeze();
>      }
>
> -    /**
> -     * @see  
> org.apache.tuscany.model.assembly.impl.AssemblyModelObjectImpl#accept( 
> org.apache.tuscany.model.assembly.AssemblyModelVisitor)
> -     */
> -    public boolean accept(AssemblyModelVisitor visitor) {
> +    public boolean accept(AssemblyVisitor visitor) {
>          if (!super.accept(visitor))
>              return false;
>
>
> Modified: incubator/tuscany/java/sca/model/src/main/java/org/apache/ 
> tuscany/model/assembly/impl/ConfiguredReferenceImpl.java
> URL: http://svn.apache.org/viewcvs/incubator/tuscany/java/sca/model/ 
> src/main/java/org/apache/tuscany/model/assembly/impl/ 
> ConfiguredReferenceImpl.java?rev=393677&r1=393676&r2=393677&view=diff
> ====================================================================== 
> ========
> --- incubator/tuscany/java/sca/model/src/main/java/org/apache/ 
> tuscany/model/assembly/impl/ConfiguredReferenceImpl.java (original)
> +++ incubator/tuscany/java/sca/model/src/main/java/org/apache/ 
> tuscany/model/assembly/impl/ConfiguredReferenceImpl.java Wed Apr 12  
> 18:03:55 2006
> @@ -17,7 +17,6 @@
>  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;
> @@ -27,59 +26,28 @@
>  /**
>   * An implementation of ConfiguredReference.
>   */
> -public class ConfiguredReferenceImpl extends ConfiguredPortImpl  
> implements ConfiguredReference {
> +public class ConfiguredReferenceImpl extends  
> ConfiguredPortImpl<Reference> implements ConfiguredReference {
>
> -    private String name;
>      private List<String> targets = new ArrayList<String>();
>
>      private List<ConfiguredService> targetConfiguredServices = new  
> ArrayList<ConfiguredService>();
>
>      protected ConfiguredReferenceImpl() {
>      }
> -
> -    public String getName() {
> -        return name;
> -    }
> -
> -    public void setName(String name) {
> -        this.name = name;
> -    }
> -
> +
>      public List<String> getTargets() {
>          return targets;
>      }
>
> -    /**
> -     * @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#getTargetConfigu 
> redServices()
> -     */
>      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);
> -        targets = Collections.unmodifiableList(targets);
> +        targetConfiguredServices = freeze(targetConfiguredServices);
> +        targets = freeze(targets);
>      }
>
>  }
>
> Modified: incubator/tuscany/java/sca/model/src/main/java/org/apache/ 
> tuscany/model/assembly/impl/ConfiguredServiceImpl.java
> URL: http://svn.apache.org/viewcvs/incubator/tuscany/java/sca/model/ 
> src/main/java/org/apache/tuscany/model/assembly/impl/ 
> ConfiguredServiceImpl.java?rev=393677&r1=393676&r2=393677&view=diff
> ====================================================================== 
> ========
> --- incubator/tuscany/java/sca/model/src/main/java/org/apache/ 
> tuscany/model/assembly/impl/ConfiguredServiceImpl.java (original)
> +++ incubator/tuscany/java/sca/model/src/main/java/org/apache/ 
> tuscany/model/assembly/impl/ConfiguredServiceImpl.java Wed Apr 12  
> 18:03:55 2006
> @@ -22,27 +22,9 @@
>  /**
>   * An implementation of ConfiguredService.
>   */
> -public class ConfiguredServiceImpl extends ConfiguredPortImpl  
> implements ConfiguredService {
> +public class ConfiguredServiceImpl extends  
> ConfiguredPortImpl<Service> 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);
>      }
>
>  }
>
> Modified: incubator/tuscany/java/sca/model/src/main/java/org/apache/ 
> tuscany/model/assembly/impl/EntryPointImpl.java
> URL: http://svn.apache.org/viewcvs/incubator/tuscany/java/sca/model/ 
> src/main/java/org/apache/tuscany/model/assembly/impl/ 
> EntryPointImpl.java?rev=393677&r1=393676&r2=393677&view=diff
> ====================================================================== 
> ========
> --- incubator/tuscany/java/sca/model/src/main/java/org/apache/ 
> tuscany/model/assembly/impl/EntryPointImpl.java (original)
> +++ incubator/tuscany/java/sca/model/src/main/java/org/apache/ 
> tuscany/model/assembly/impl/EntryPointImpl.java Wed Apr 12 18:03:55  
> 2006
> @@ -17,11 +17,10 @@
>  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.AssemblyContext;
> +import org.apache.tuscany.model.assembly.AssemblyVisitor;
>  import org.apache.tuscany.model.assembly.Binding;
>  import org.apache.tuscany.model.assembly.ConfiguredReference;
>  import org.apache.tuscany.model.assembly.ConfiguredService;
> @@ -30,70 +29,49 @@
>  /**
>   * An implementation of EntryPoint.
>   */
> -public class EntryPointImpl extends AggregatePartImpl implements  
> EntryPoint {
> +public class EntryPointImpl extends PartImpl 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();
> +        configuredReference.setPart(this);
>          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();
> +        configuredService.setPart(this);
>          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) {
> +
> +    public void initialize(AssemblyContext modelContext) {
>          if (isInitialized())
>              return;
>          super.initialize(modelContext);
>
>          // Initialize the service contract and reference to the  
> published service
>          if (configuredReference != null) {
> -            ((ConfiguredPortImpl) 
> configuredReference).setAggregatePart(this);
>              configuredReference.initialize(modelContext);
>          }
>          if (configuredService != null) {
> -            ((ConfiguredPortImpl) 
> configuredService).setAggregatePart(this);
>              configuredService.initialize(modelContext);
>          }
>
> @@ -101,9 +79,6 @@
>          initialize(bindings, modelContext);
>      }
>
> -    /**
> -     * @see  
> org.apache.tuscany.model.assembly.AssemblyModelObject#freeze()
> -     */
>      public void freeze() {
>          if (isFrozen())
>              return;
> @@ -116,14 +91,10 @@
>              configuredService.freeze();
>
>          // Freeze the bindings
> -        bindings=Collections.unmodifiableList(bindings);
> -        freeze(bindings);
> +        bindings=freeze(bindings);
>      }
>
> -    /**
> -     * @see  
> org.apache.tuscany.model.assembly.impl.AssemblyModelObjectImpl#accept( 
> org.apache.tuscany.model.assembly.AssemblyModelVisitor)
> -     */
> -    public boolean accept(AssemblyModelVisitor visitor) {
> +    public boolean accept(AssemblyVisitor visitor) {
>          if (!super.accept(visitor))
>              return false;
>
>
> Modified: incubator/tuscany/java/sca/model/src/main/java/org/apache/ 
> tuscany/model/assembly/impl/ExtensibleImpl.java
> URL: http://svn.apache.org/viewcvs/incubator/tuscany/java/sca/model/ 
> src/main/java/org/apache/tuscany/model/assembly/impl/ 
> ExtensibleImpl.java?rev=393677&r1=393676&r2=393677&view=diff
> ====================================================================== 
> ========
> --- incubator/tuscany/java/sca/model/src/main/java/org/apache/ 
> tuscany/model/assembly/impl/ExtensibleImpl.java (original)
> +++ incubator/tuscany/java/sca/model/src/main/java/org/apache/ 
> tuscany/model/assembly/impl/ExtensibleImpl.java Wed Apr 12 18:03:55  
> 2006
> @@ -19,42 +19,30 @@
>  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.AssemblyContext;
> +import org.apache.tuscany.model.assembly.AssemblyVisitor;
>  import org.apache.tuscany.model.assembly.Extensible;
>
>  /**
>   * An implementation of Extensible.
>   */
> -public abstract class ExtensibleImpl extends  
> AssemblyModelObjectImpl implements Extensible {
> +public abstract class ExtensibleImpl extends AssemblyObjectImpl  
> 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#getExtensibilityAttribute 
> s()
> -     */
>      public List getExtensibilityAttributes() {
>          return extensibilityAttributes;
>      }
>
> -    /**
> -     * @see  
> org.apache.tuscany.model.assembly.AssemblyModelObject#initialize 
> (org.apache.tuscany.model.assembly.AssemblyModelContext)
> -     */
> -    public void initialize(AssemblyModelContext modelContext) {
> +    public void initialize(AssemblyContext modelContext) {
>          if (isInitialized())
>              return;
>          super.initialize(modelContext);
> @@ -74,10 +62,7 @@
>          freeze(extensibilityAttributes);
>      }
>
> -    /**
> -     * @see  
> org.apache.tuscany.model.assembly.impl.AssemblyModelObjectImpl#accept( 
> org.apache.tuscany.model.assembly.AssemblyModelVisitor)
> -     */
> -    public boolean accept(AssemblyModelVisitor visitor) {
> +    public boolean accept(AssemblyVisitor visitor) {
>          if (!super.accept(visitor))
>              return false;
>
>
> Modified: incubator/tuscany/java/sca/model/src/main/java/org/apache/ 
> tuscany/model/assembly/impl/ExternalServiceImpl.java
> URL: http://svn.apache.org/viewcvs/incubator/tuscany/java/sca/model/ 
> src/main/java/org/apache/tuscany/model/assembly/impl/ 
> ExternalServiceImpl.java?rev=393677&r1=393676&r2=393677&view=diff
> ====================================================================== 
> ========
> --- incubator/tuscany/java/sca/model/src/main/java/org/apache/ 
> tuscany/model/assembly/impl/ExternalServiceImpl.java (original)
> +++ incubator/tuscany/java/sca/model/src/main/java/org/apache/ 
> tuscany/model/assembly/impl/ExternalServiceImpl.java Wed Apr 12  
> 18:03:55 2006
> @@ -17,11 +17,10 @@
>  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.AssemblyContext;
> +import org.apache.tuscany.model.assembly.AssemblyVisitor;
>  import org.apache.tuscany.model.assembly.Binding;
>  import org.apache.tuscany.model.assembly.ConfiguredService;
>  import org.apache.tuscany.model.assembly.ExternalService;
> @@ -30,66 +29,55 @@
>  /**
>   * An implementation ExternalService.
>   */
> -public class ExternalServiceImpl extends AggregatePartImpl  
> implements ExternalService {
> +public class ExternalServiceImpl extends PartImpl implements  
> ExternalService {
>
>      private ConfiguredService configuredService;
>      private OverrideOption overrideOption;
>      private List<Binding> bindings=new ArrayList<Binding>();
> +
> +    private Object contextFactory;
>
> -    /**
> -     * Constructor
> -     */
>      protected ExternalServiceImpl() {
>      }
>
> -    /**
> -     * @see  
> org.apache.tuscany.model.assembly.sdo.impl.ExternalServiceImpl#getOver 
> rideOption()
> -     */
>      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();
> +        configuredService.setPart(this);
>          this.configuredService=configuredService;
>      }
> +
> +    public Object getContextFactory() {
> +        return contextFactory;
> +    }
> +
> +    public void setContextFactory(Object contextFactory) {
> +        this.contextFactory=contextFactory;
> +    }
>
> -    /**
> -     * @see  
> org.apache.tuscany.model.assembly.AssemblyModelObject#initialize 
> (org.apache.tuscany.model.assembly.AssemblyModelContext)
> -     */
> -    public void initialize(AssemblyModelContext modelContext) {
> +    public void initialize(AssemblyContext modelContext) {
>          if (isInitialized())
>              return;
>          super.initialize(modelContext);
>
>          // Initialize the configured service
>          if (configuredService != null) {
> -            ((ConfiguredPortImpl) 
> configuredService).setAggregatePart(this);
>              configuredService.initialize(modelContext);
>          }
>
> @@ -97,9 +85,6 @@
>          initialize(bindings, modelContext);
>      }
>
> -    /**
> -     * @see  
> org.apache.tuscany.model.assembly.AssemblyModelObject#freeze()
> -     */
>      public void freeze() {
>          if (isFrozen())
>              return;
> @@ -110,14 +95,10 @@
>              configuredService.freeze();
>
>          // Freeze the bindings
> -        bindings=Collections.unmodifiableList(bindings);
> -        freeze(bindings);
> +        bindings=freeze(bindings);
>      }
>
> -    /**
> -     * @see  
> org.apache.tuscany.model.assembly.impl.ExtensibleImpl#accept 
> (org.apache.tuscany.model.assembly.AssemblyModelVisitor)
> -     */
> -    public boolean accept(AssemblyModelVisitor visitor) {
> +    public boolean accept(AssemblyVisitor visitor) {
>          if (!super.accept(visitor))
>              return false;
>
>
>
>


Big commits, was: svn commit: r393677 [5/6] - in /incubator/tuscany/java/sca: bindings/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/assembly/impl/ bindings/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/builder/ bindings/binding.axis2/src/m...

Posted by Jeremy Boynes <jb...@apache.org>.
Jean-Sebastien Delfino wrote:
> Jim,
> 
> Yes, usually we should have smaller commits but this one was tricky
> since I needed to have the complete model in place in the sandbox first
> to allow people to review it. So in an attempt to start a new trend with
> smaller commits, I'm about to do probably one of the smallest commits,
> adding a OneWay annotation to the spec project to support the SCA async
> programming model :)
> 
> 

I prefer this direction :-)

I know there are times when a lot of stuff changes but, in general,
little and often is better as it is much easier for people to review the
change.

We should all be reviewing changes as when it comes to a release we
collectively vote that the code is OK (not just technically but also
from a legal perspective).

--
Jeremy

Re: svn commit: r393677 [5/6] - in /incubator/tuscany/java/sca: bindings/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/assembly/impl/ bindings/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/builder/ bindings/binding.axis2/src/m...

Posted by Jim Marino <ji...@gmail.com>.
I was impressed with the large commit - I guess you're now showing  
you can scale down as well as up :-)
On Apr 12, 2006, at 7:45 PM, Jean-Sebastien Delfino wrote:

> Jim,
>
> Yes, usually we should have smaller commits but this one was tricky  
> since I needed to have the complete model in place in the sandbox  
> first to allow people to review it. So in an attempt to start a new  
> trend with smaller commits, I'm about to do probably one of the  
> smallest commits, adding a OneWay annotation to the spec project to  
> support the SCA async programming model :)
>
>
> Jim Marino wrote:
>
>> So I think Sebastien hold the record for largest commit - 6  
>> parts ;-) I tried but could only get up to 4!
>>
>> Jim
>>
>>
>>
>> Begin forwarded message:
>>
>>
>>> From: jsdelfino@apache.org
>>> Date: April 12, 2006 6:04:14 PM PDT
>>> To: tuscany-commits@ws.apache.org
>>> Subject: svn commit: r393677 [5/6] - in /incubator/tuscany/java/ 
>>> sca: bindings/binding.axis2/src/main/java/org/apache/tuscany/ 
>>> binding/axis2/assembly/impl/ bindings/binding.axis2/src/main/java/ 
>>> org/apache/tuscany/binding/axis2/builder/ bindings/binding.axis2/ 
>>> src/m...
>>> Reply-To: tuscany-dev@ws.apache.org
>>>
>>>
>>> Modified: incubator/tuscany/java/sca/model/src/main/java/org/ 
>>> apache/tuscany/model/assembly/Port.java
>>> URL: http://svn.apache.org/viewcvs/incubator/tuscany/java/sca/ 
>>> model/src/main/java/org/apache/tuscany/model/assembly/Port.java? 
>>> rev=393677&r1=393676&r2=393677&view=diff
>>> ==================================================================== 
>>> ==========
>>> --- incubator/tuscany/java/sca/model/src/main/java/org/apache/ 
>>> tuscany/model/assembly/Port.java (original)
>>> +++ incubator/tuscany/java/sca/model/src/main/java/org/apache/ 
>>> tuscany/model/assembly/Port.java Wed Apr 12 18:03:55 2006
>>> @@ -19,7 +19,7 @@
>>>  /**
>>>   * Abstraction for the association of a service contract with a  
>>> requestor or provider.
>>>   */
>>> -public interface Port extends AssemblyModelObject {
>>> +public interface Port extends AssemblyObject {
>>>      /**
>>>       * Returns the contract for invocations of a service using  
>>> this port.
>>>       * @return the oontract for invocations of a service using  
>>> this port
>>>
>>> Added: incubator/tuscany/java/sca/model/src/main/java/org/apache/ 
>>> tuscany/model/assembly/ProxyFactoryHolder.java
>>> URL: http://svn.apache.org/viewcvs/incubator/tuscany/java/sca/ 
>>> model/src/main/java/org/apache/tuscany/model/assembly/ 
>>> ProxyFactoryHolder.java?rev=393677&view=auto
>>> ==================================================================== 
>>> ==========
>>> --- incubator/tuscany/java/sca/model/src/main/java/org/apache/ 
>>> tuscany/model/assembly/ProxyFactoryHolder.java (added)
>>> +++ incubator/tuscany/java/sca/model/src/main/java/org/apache/ 
>>> tuscany/model/assembly/ProxyFactoryHolder.java Wed Apr 12  
>>> 18:03:55 2006
>>> @@ -0,0 +1,34 @@
>>> +/**
>>> + *
>>> + *  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;
>>> +
>>> +/**
>>> + * A model object that can hold a runtime proxy factory object.
>>> + */
>>> +public interface ProxyFactoryHolder {
>>> +
>>> +    /**
>>> +     * Sets the proxy factory
>>> +     */
>>> +    void setProxyFactory(Object proxyFactory);
>>> +
>>> +    /**
>>> +     * Returns the proxy factory
>>> +     */
>>> +    Object getProxyFactory();
>>> +
>>> +}
>>>
>>> Propchange: incubator/tuscany/java/sca/model/src/main/java/org/ 
>>> apache/tuscany/model/assembly/ProxyFactoryHolder.java
>>> -------------------------------------------------------------------- 
>>> ----------
>>>     svn:eol-style = native
>>>
>>> Propchange: incubator/tuscany/java/sca/model/src/main/java/org/ 
>>> apache/tuscany/model/assembly/ProxyFactoryHolder.java
>>> -------------------------------------------------------------------- 
>>> ----------
>>>     svn:keywords = Rev,Date
>>>
>>> Modified: incubator/tuscany/java/sca/model/src/main/java/org/ 
>>> apache/tuscany/model/assembly/ServiceContract.java
>>> URL: http://svn.apache.org/viewcvs/incubator/tuscany/java/sca/ 
>>> model/src/main/java/org/apache/tuscany/model/assembly/ 
>>> ServiceContract.java?rev=393677&r1=393676&r2=393677&view=diff
>>> ==================================================================== 
>>> ==========
>>> --- incubator/tuscany/java/sca/model/src/main/java/org/apache/ 
>>> tuscany/model/assembly/ServiceContract.java (original)
>>> +++ incubator/tuscany/java/sca/model/src/main/java/org/apache/ 
>>> tuscany/model/assembly/ServiceContract.java Wed Apr 12 18:03:55 2006
>>> @@ -48,14 +48,12 @@
>>>      /**
>>>       * Returns the scope of this service contract.
>>>       * @return
>>> -     * todo missing javadoc
>>>       */
>>>      Scope getScope();
>>>
>>>      /**
>>>       * Sets the scope.
>>>       * @param scope of this service contract.
>>> -     * todo missing javadoc
>>>       */
>>>      void setScope(Scope scope);
>>>
>>>
>>> Modified: incubator/tuscany/java/sca/model/src/main/java/org/ 
>>> apache/tuscany/model/assembly/Subsystem.java
>>> URL: http://svn.apache.org/viewcvs/incubator/tuscany/java/sca/ 
>>> model/src/main/java/org/apache/tuscany/model/assembly/ 
>>> Subsystem.java?rev=393677&r1=393676&r2=393677&view=diff
>>> ==================================================================== 
>>> ==========
>>> --- incubator/tuscany/java/sca/model/src/main/java/org/apache/ 
>>> tuscany/model/assembly/Subsystem.java (original)
>>> +++ incubator/tuscany/java/sca/model/src/main/java/org/apache/ 
>>> tuscany/model/assembly/Subsystem.java Wed Apr 12 18:03:55 2006
>>> @@ -21,7 +21,7 @@
>>>  /**
>>>   * Represents a subsystem.
>>>   */
>>> -public interface Subsystem extends Aggregate {
>>> +public interface Subsystem extends Composite {
>>>
>>>      /**
>>>       * Returns the subsystem uri.
>>>
>>> Added: incubator/tuscany/java/sca/model/src/main/java/org/apache/ 
>>> tuscany/model/assembly/impl/AssemblyContextImpl.java
>>> URL: http://svn.apache.org/viewcvs/incubator/tuscany/java/sca/ 
>>> model/src/main/java/org/apache/tuscany/model/assembly/impl/ 
>>> AssemblyContextImpl.java?rev=393677&view=auto
>>> ==================================================================== 
>>> ==========
>>> --- incubator/tuscany/java/sca/model/src/main/java/org/apache/ 
>>> tuscany/model/assembly/impl/AssemblyContextImpl.java (added)
>>> +++ incubator/tuscany/java/sca/model/src/main/java/org/apache/ 
>>> tuscany/model/assembly/impl/AssemblyContextImpl.java Wed Apr 12  
>>> 18:03:55 2006
>>> @@ -0,0 +1,75 @@
>>> +/**
>>> + *
>>> + *  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.common.resource.ResourceLoader;
>>> +import org.apache.tuscany.model.assembly.AssemblyFactory;
>>> +import org.apache.tuscany.model.assembly.AssemblyContext;
>>> +import  
>>> org.apache.tuscany.model.assembly.loader.AssemblyModelLoader;
>>> +import org.apache.tuscany.sdo.util.SDOUtil;
>>> +
>>> +import commonj.sdo.helper.TypeHelper;
>>> +
>>> +/**
>>> + */
>>> +public class AssemblyContextImpl implements AssemblyContext {
>>> +
>>> +    private final AssemblyFactory assemblyFactory;
>>> +    private final AssemblyModelLoader assemblyLoader;
>>> +    private final ResourceLoader applicationResourceLoader;
>>> +    private final TypeHelper typeHelper;
>>> +
>>> +    public AssemblyContextImpl(AssemblyModelLoader  
>>> assemblyLoader, ResourceLoader resourceLoader) {
>>> +        this(new AssemblyFactoryImpl(), assemblyLoader,  
>>> resourceLoader);
>>> +    }
>>> +
>>> +    public AssemblyContextImpl(AssemblyFactory assemblyFactory,  
>>> AssemblyModelLoader assemblyLoader, ResourceLoader artifactLoader) {
>>> +        this(assemblyFactory, assemblyLoader, artifactLoader,  
>>> SDOUtil.createTypeHelper());
>>> +    }
>>> +
>>> +    public AssemblyContextImpl(AssemblyFactory assemblyFactory,  
>>> AssemblyModelLoader assemblyLoader, ResourceLoader  
>>> artifactLoader, TypeHelper typeHelper) {
>>> +        this.assemblyFactory = assemblyFactory;
>>> +        this.assemblyLoader = assemblyLoader;
>>> +        this.applicationResourceLoader = artifactLoader;
>>> +        this.typeHelper=typeHelper;
>>> +    }
>>> +
>>> +    /**
>>> +     * @see  
>>> org.apache.tuscany.model.assembly.AssemblyContext#getAssemblyFactory 
>>> ()
>>> +     */
>>> +    public AssemblyFactory getAssemblyFactory() {
>>> +        return assemblyFactory;
>>> +    }
>>> +
>>> +    public ResourceLoader getApplicationResourceLoader() {
>>> +        return applicationResourceLoader;
>>> +    }
>>> +
>>> +    /**
>>> +     * @see  
>>> org.apache.tuscany.model.assembly.AssemblyContext#getAssemblyLoader( 
>>> )
>>> +     */
>>> +    public AssemblyModelLoader getAssemblyLoader() {
>>> +        return assemblyLoader;
>>> +    }
>>> +
>>> +    /**
>>> +     * @see  
>>> org.apache.tuscany.model.assembly.AssemblyContext#getTypeHelper()
>>> +     */
>>> +    public TypeHelper getTypeHelper() {
>>> +        return typeHelper;
>>> +    }
>>> +}
>>>
>>> Propchange: incubator/tuscany/java/sca/model/src/main/java/org/ 
>>> apache/tuscany/model/assembly/impl/AssemblyContextImpl.java
>>> -------------------------------------------------------------------- 
>>> ----------
>>>     svn:eol-style = native
>>>
>>> Propchange: incubator/tuscany/java/sca/model/src/main/java/org/ 
>>> apache/tuscany/model/assembly/impl/AssemblyContextImpl.java
>>> -------------------------------------------------------------------- 
>>> ----------
>>>     svn:keywords = Rev,Date
>>>
>>> Modified: incubator/tuscany/java/sca/model/src/main/java/org/ 
>>> apache/tuscany/model/assembly/impl/AssemblyFactoryImpl.java
>>> URL: http://svn.apache.org/viewcvs/incubator/tuscany/java/sca/ 
>>> model/src/main/java/org/apache/tuscany/model/assembly/impl/ 
>>> AssemblyFactoryImpl.java?rev=393677&r1=393676&r2=393677&view=diff
>>> ==================================================================== 
>>> ==========
>>> --- incubator/tuscany/java/sca/model/src/main/java/org/apache/ 
>>> tuscany/model/assembly/impl/AssemblyFactoryImpl.java (original)
>>> +++ incubator/tuscany/java/sca/model/src/main/java/org/apache/ 
>>> tuscany/model/assembly/impl/AssemblyFactoryImpl.java Wed Apr 12  
>>> 18:03:55 2006
>>> @@ -18,9 +18,9 @@
>>>
>>>  import javax.xml.namespace.QName;
>>>
>>> -import org.apache.tuscany.model.assembly.AggregatePart;
>>> +import org.apache.tuscany.model.assembly.Part;
>>>  import org.apache.tuscany.model.assembly.AssemblyFactory;
>>> -import org.apache.tuscany.model.assembly.ComponentType;
>>> +import org.apache.tuscany.model.assembly.ComponentInfo;
>>>  import org.apache.tuscany.model.assembly.ConfiguredPort;
>>>  import org.apache.tuscany.model.assembly.ConfiguredProperty;
>>>  import org.apache.tuscany.model.assembly.ConfiguredReference;
>>> @@ -35,7 +35,7 @@
>>>  import org.apache.tuscany.model.assembly.Reference;
>>>  import org.apache.tuscany.model.assembly.Service;
>>>  import org.apache.tuscany.model.assembly.ServiceURI;
>>> -import org.apache.tuscany.model.assembly.SimpleComponent;
>>> +import org.apache.tuscany.model.assembly.AtomicComponent;
>>>  import org.apache.tuscany.model.assembly.Subsystem;
>>>  import org.apache.tuscany.model.assembly.Wire;
>>>  import org.apache.tuscany.model.assembly.Binding;
>>> @@ -58,150 +58,87 @@
>>>          super();
>>>      }
>>>
>>> -    /**
>>> -     * @see  
>>> org.apache.tuscany.model.assembly.AssemblyFactory#createSimpleCompon 
>>> ent()
>>> -     */
>>> -    public SimpleComponent createSimpleComponent() {
>>> -        return new SimpleComponentImpl();
>>> +    public AtomicComponent createSimpleComponent() {
>>> +        return new AtomicComponentImpl();
>>>      }
>>>
>>> -    /**
>>> -     * @see  
>>> org.apache.tuscany.model.assembly.AssemblyFactory#createComponentTyp 
>>> e()
>>> -     */
>>> -    public ComponentType createComponentType() {
>>> -        return new ComponentTypeImpl();
>>> +    public ComponentInfo createComponentInfo() {
>>> +        return new ComponentInfoImpl();
>>>      }
>>>
>>> -    /**
>>> -     * @see  
>>> org.apache.tuscany.model.assembly.AssemblyFactory#createEntryPoint()
>>> -     */
>>>      public EntryPoint createEntryPoint() {
>>>          return new EntryPointImpl();
>>>      }
>>>
>>> -    /**
>>> -     * @see  
>>> org.apache.tuscany.model.assembly.AssemblyFactory#createExternalServ 
>>> ice()
>>> -     */
>>>      public ExternalService createExternalService() {
>>>          return new ExternalServiceImpl();
>>>      }
>>>
>>> -    /**
>>> -     * @see  
>>> org.apache.tuscany.model.assembly.AssemblyFactory#createJavaServiceC 
>>> ontract()
>>> -     */
>>>      public JavaServiceContract createJavaServiceContract() {
>>>          return new JavaServiceContractImpl();
>>>      }
>>>
>>> -    /**
>>> -     * @see  
>>> org.apache.tuscany.model.assembly.AssemblyFactory#createModule()
>>> -     */
>>>      public Module createModule() {
>>>          return new ModuleImpl();
>>>      }
>>>
>>> -    /**
>>> -     * @see  
>>> org.apache.tuscany.model.assembly.AssemblyFactory#createModuleFragme 
>>> nt()
>>> -     */
>>>      public ModuleFragment createModuleFragment() {
>>>          return new ModuleFragmentImpl();
>>>      }
>>>
>>> -    /**
>>> -     * @see  
>>> org.apache.tuscany.model.assembly.AssemblyFactory#createModuleCompon 
>>> ent()
>>> -     */
>>>      public ModuleComponent createModuleComponent() {
>>>          return new ModuleComponentImpl();
>>>      }
>>>
>>> -    /**
>>> -     * @see  
>>> org.apache.tuscany.model.assembly.AssemblyFactory#createProperty()
>>> -     */
>>>      public Property createProperty() {
>>>          return new PropertyImpl();
>>>      }
>>>
>>> -    /**
>>> -     * @see  
>>> org.apache.tuscany.model.assembly.AssemblyFactory#createConfiguredPr 
>>> operty()
>>> -     */
>>>      public ConfiguredProperty createConfiguredProperty() {
>>>          return new ConfiguredPropertyImpl();
>>>      }
>>>
>>> -    /**
>>> -     * @see  
>>> org.apache.tuscany.model.assembly.AssemblyFactory#createReference()
>>> -     */
>>>      public Reference createReference() {
>>>          return new ReferenceImpl();
>>>      }
>>>
>>> -    /**
>>> -     * @see  
>>> org.apache.tuscany.model.assembly.AssemblyFactory#createConfiguredRe 
>>> ference()
>>> -     */
>>>      public ConfiguredReference createConfiguredReference() {
>>>          return new ConfiguredReferenceImpl();
>>>      }
>>>
>>> -    /**
>>> -     * @see  
>>> org.apache.tuscany.model.assembly.AssemblyFactory#createService()
>>> -     */
>>>      public Service createService() {
>>>          return new ServiceImpl();
>>>      }
>>>
>>> -    /**
>>> -     * @see  
>>> org.apache.tuscany.model.assembly.AssemblyFactory#createConfiguredSe 
>>> rvice()
>>> -     */
>>>      public ConfiguredService createConfiguredService() {
>>>          return new ConfiguredServiceImpl();
>>>      }
>>>
>>> -    /**
>>> -     * @see  
>>> org.apache.tuscany.model.assembly.AssemblyFactory#createSubsystem()
>>> -     */
>>>      public Subsystem createSubsystem() {
>>>          return new SubsystemImpl();
>>>      }
>>>
>>> -    /**
>>> -     * @see  
>>> org.apache.tuscany.model.assembly.AssemblyFactory#createWSDLServiceC 
>>> ontract()
>>> -     */
>>>      public WSDLServiceContract createWSDLServiceContract() {
>>>          return new WSDLServiceContractImpl();
>>>      }
>>>
>>> -    /**
>>> -     * @see  
>>> org.apache.tuscany.model.assembly.AssemblyFactory#createServiceURI 
>>> (java.lang.String)
>>> -     */
>>>      public ServiceURI createServiceURI(String uri) {
>>>          return new ServiceURIImpl(uri);
>>>      }
>>>
>>> -    /**
>>> -     * @see  
>>> org.apache.tuscany.model.assembly.AssemblyFactory#createServiceURI 
>>> (org.apache.tuscany.model.assembly.ModuleComponent,  
>>> java.lang.String)
>>> -     */
>>>      public ServiceURI createServiceURI(ModuleComponent  
>>> moduleComponent, String serviceName) {
>>>          return new ServiceURIImpl(moduleComponent, serviceName);
>>>      }
>>>
>>> -    /*
>>> -     * @see  
>>> org.apache.tuscany.model.assembly.AssemblyFactory#createServiceURI 
>>> (org.apache.tuscany.model.assembly.ModuleComponent,  
>>> org.apache.tuscany.model.assembly.AggregatePart,  
>>> org.apache.tuscany.model.assembly.ConfiguredPort)
>>> -     */
>>> -    public ServiceURI createServiceURI(ModuleComponent  
>>> moduleComponent, AggregatePart aggregatePart, ConfiguredPort  
>>> configuredPort) {
>>> +    public ServiceURI createServiceURI(ModuleComponent  
>>> moduleComponent, Part aggregatePart, ConfiguredPort  
>>> configuredPort) {
>>>          return new ServiceURIImpl(moduleComponent,  
>>> aggregatePart, configuredPort);
>>>      }
>>>
>>> -    /**
>>> -     * @see  
>>> org.apache.tuscany.model.assembly.AssemblyFactory#createQName 
>>> (java.lang.String)
>>> -     */
>>>      public QName createQName(String uri) {
>>>          int h = uri.indexOf('#');
>>>          return new QName(uri.substring(0, h), uri.substring(h +  
>>> 1));
>>>      }
>>>
>>> -    /**
>>> -     * @see  
>>> org.apache.tuscany.model.assembly.AssemblyFactory#createWire()
>>> -     */
>>>      public Wire createWire() {
>>>          return new WireImpl();
>>>      }
>>> @@ -235,13 +172,13 @@
>>>          service.setName(entryPointName);
>>>          service.setServiceContract(serviceContract);
>>>          ConfiguredService configuredService =  
>>> createConfiguredService();
>>> -        configuredService.setService(service);
>>> +        configuredService.setPort(service);
>>>
>>>          // create and configure a reference to target
>>>          Reference reference = createReference();
>>>          reference.setMultiplicity(Multiplicity.ONE_ONE);
>>>          ConfiguredReference configuredReference =  
>>> createConfiguredReference(null, targetName);
>>> -        configuredReference.setReference(reference);
>>> +        configuredReference.setPort(reference);
>>>
>>>          return createEntryPoint(entryPointName,  
>>> configuredService, binding, configuredReference);
>>>      }
>>>
>>> Added: incubator/tuscany/java/sca/model/src/main/java/org/apache/ 
>>> tuscany/model/assembly/impl/AssemblyObjectImpl.java
>>> URL: http://svn.apache.org/viewcvs/incubator/tuscany/java/sca/ 
>>> model/src/main/java/org/apache/tuscany/model/assembly/impl/ 
>>> AssemblyObjectImpl.java?rev=393677&view=auto
>>> ==================================================================== 
>>> ==========
>>> --- incubator/tuscany/java/sca/model/src/main/java/org/apache/ 
>>> tuscany/model/assembly/impl/AssemblyObjectImpl.java (added)
>>> +++ incubator/tuscany/java/sca/model/src/main/java/org/apache/ 
>>> tuscany/model/assembly/impl/AssemblyObjectImpl.java Wed Apr 12  
>>> 18:03:55 2006
>>> @@ -0,0 +1,124 @@
>>> +/**
>>> + *
>>> + *  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.Collection;
>>> +import java.util.Collections;
>>> +import java.util.List;
>>> +
>>> +import org.apache.tuscany.model.assembly.AssemblyContext;
>>> +import org.apache.tuscany.model.assembly.AssemblyObject;
>>> +import org.apache.tuscany.model.assembly.AssemblyVisitor;
>>> +
>>> +/**
>>> + * A base class for assembly model objects.
>>> + */
>>> +public abstract class AssemblyObjectImpl implements  
>>> AssemblyObject {
>>> +
>>> +    private boolean frozen;
>>> +    private boolean initialized;
>>> +
>>> +    protected AssemblyObjectImpl() {
>>> +    }
>>> +
>>> +    public boolean accept(AssemblyVisitor visitor) {
>>> +        return visitor.visit(this);
>>> +    }
>>> +
>>> +    /**
>>> +     * Walk a visitor through a collection of model objects.
>>> +     * @param collection
>>> +     * @param visitor
>>> +     * @return
>>> +     */
>>> +    protected boolean accept(Collection collection,  
>>> AssemblyVisitor visitor) {
>>> +        for (Object member : collection) {
>>> +            if (member instanceof AssemblyObject) {
>>> +                if (!((AssemblyObject)member).accept(visitor))
>>> +                    return false;
>>> +            }
>>> +        }
>>> +        return true;
>>> +    }
>>> +
>>> +    public void freeze() {
>>> +        if (!frozen)
>>> +            frozen=true;
>>> +    }
>>> +
>>> +    /**
>>> +     * Returns true if the object is frozen
>>> +     */
>>> +    protected boolean isFrozen() {
>>> +        return frozen;
>>> +    }
>>> +
>>> +    /**
>>> +     * Freeze a list and its members
>>> +     */
>>> +    protected <T> List<T> freeze(List<T> list) {
>>> +        list=Collections.unmodifiableList(list);
>>> +        for (Object member : list) {
>>> +            if (member instanceof AssemblyObject) {
>>> +                ((AssemblyObject)member).freeze();
>>> +            }
>>> +        }
>>> +        return list;
>>> +    }
>>> +
>>> +    /**
>>> +     * Check that the current model object can be modified.
>>> +     * @throws IllegalStateException
>>> +     */
>>> +    protected void checkNotFrozen() {
>>> +        if (frozen)
>>> +            throw new IllegalStateException("Attempt to modify a  
>>> frozen assembly model");
>>> +    }
>>> +
>>> +    public void initialize(AssemblyContext modelContext) {
>>> +        if (!initialized)
>>> +            initialized=true;
>>> +    }
>>> +
>>> +    /**
>>> +     * Returns true if the object is initialized
>>> +     */
>>> +    protected boolean isInitialized() {
>>> +        return initialized;
>>> +    }
>>> +
>>> +    /**
>>> +     * Initialize members of a collection
>>> +     */
>>> +    protected void initialize(Collection collection,  
>>> AssemblyContext modelContext) {
>>> +        for (Object member : collection) {
>>> +            if (member instanceof AssemblyObject) {
>>> +                ((AssemblyObject)member).initialize(modelContext);
>>> +            }
>>> +        }
>>> +    }
>>> +
>>> +    /**
>>> +     * Check that the current model object is initialized.
>>> +     * @throws IllegalStateException
>>> +     */
>>> +    protected void checkInitialized() {
>>> +        if (!initialized)
>>> +            throw new IllegalStateException("Attempt to use an  
>>> uninitialized assembly model");
>>> +    }
>>> +
>>> +}
>>>
>>> Propchange: incubator/tuscany/java/sca/model/src/main/java/org/ 
>>> apache/tuscany/model/assembly/impl/AssemblyObjectImpl.java
>>> -------------------------------------------------------------------- 
>>> ----------
>>>     svn:eol-style = native
>>>
>>> Propchange: incubator/tuscany/java/sca/model/src/main/java/org/ 
>>> apache/tuscany/model/assembly/impl/AssemblyObjectImpl.java
>>> -------------------------------------------------------------------- 
>>> ----------
>>>     svn:keywords = Rev,Date
>>>
>>> Added: incubator/tuscany/java/sca/model/src/main/java/org/apache/ 
>>> tuscany/model/assembly/impl/AtomicComponentImpl.java
>>> URL: http://svn.apache.org/viewcvs/incubator/tuscany/java/sca/ 
>>> model/src/main/java/org/apache/tuscany/model/assembly/impl/ 
>>> AtomicComponentImpl.java?rev=393677&view=auto
>>> ==================================================================== 
>>> ==========
>>> --- incubator/tuscany/java/sca/model/src/main/java/org/apache/ 
>>> tuscany/model/assembly/impl/AtomicComponentImpl.java (added)
>>> +++ incubator/tuscany/java/sca/model/src/main/java/org/apache/ 
>>> tuscany/model/assembly/impl/AtomicComponentImpl.java Wed Apr 12  
>>> 18:03:55 2006
>>> @@ -0,0 +1,30 @@
>>> +/**
>>> + *
>>> + *  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.AtomicComponent;
>>> +import org.apache.tuscany.model.assembly.AtomicImplementation;
>>> +
>>> +/**
>>> + * An implementation of AtomicComponent.
>>> + */
>>> +public class AtomicComponentImpl extends  
>>> ComponentImpl<AtomicImplementation> implements AtomicComponent {
>>> +
>>> +    protected AtomicComponentImpl() {
>>> +    }
>>> +
>>> +}
>>>
>>> Propchange: incubator/tuscany/java/sca/model/src/main/java/org/ 
>>> apache/tuscany/model/assembly/impl/AtomicComponentImpl.java
>>> -------------------------------------------------------------------- 
>>> ----------
>>>     svn:eol-style = native
>>>
>>> Propchange: incubator/tuscany/java/sca/model/src/main/java/org/ 
>>> apache/tuscany/model/assembly/impl/AtomicComponentImpl.java
>>> -------------------------------------------------------------------- 
>>> ----------
>>>     svn:keywords = Rev,Date
>>>
>>> Added: incubator/tuscany/java/sca/model/src/main/java/org/apache/ 
>>> tuscany/model/assembly/impl/AtomicImplementationImpl.java
>>> URL: http://svn.apache.org/viewcvs/incubator/tuscany/java/sca/ 
>>> model/src/main/java/org/apache/tuscany/model/assembly/impl/ 
>>> AtomicImplementationImpl.java?rev=393677&view=auto
>>> ==================================================================== 
>>> ==========
>>> --- incubator/tuscany/java/sca/model/src/main/java/org/apache/ 
>>> tuscany/model/assembly/impl/AtomicImplementationImpl.java (added)
>>> +++ incubator/tuscany/java/sca/model/src/main/java/org/apache/ 
>>> tuscany/model/assembly/impl/AtomicImplementationImpl.java Wed Apr  
>>> 12 18:03:55 2006
>>> @@ -0,0 +1,29 @@
>>> +/**
>>> + *
>>> + *  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.AtomicImplementation;
>>> +
>>> +/**
>>> + * An implementation of AtomicImplementation.
>>> + */
>>> +public abstract class AtomicImplementationImpl extends  
>>> ImplementationImpl implements AtomicImplementation {
>>> +
>>> +    protected AtomicImplementationImpl() {
>>> +    }
>>> +
>>> +}
>>>
>>> Propchange: incubator/tuscany/java/sca/model/src/main/java/org/ 
>>> apache/tuscany/model/assembly/impl/AtomicImplementationImpl.java
>>> -------------------------------------------------------------------- 
>>> ----------
>>>     svn:eol-style = native
>>>
>>> Propchange: incubator/tuscany/java/sca/model/src/main/java/org/ 
>>> apache/tuscany/model/assembly/impl/AtomicImplementationImpl.java
>>> -------------------------------------------------------------------- 
>>> ----------
>>>     svn:keywords = Rev,Date
>>>
>>> Modified: incubator/tuscany/java/sca/model/src/main/java/org/ 
>>> apache/tuscany/model/assembly/impl/BindingImpl.java
>>> URL: http://svn.apache.org/viewcvs/incubator/tuscany/java/sca/ 
>>> model/src/main/java/org/apache/tuscany/model/assembly/impl/ 
>>> BindingImpl.java?rev=393677&r1=393676&r2=393677&view=diff
>>> ==================================================================== 
>>> ==========
>>> --- incubator/tuscany/java/sca/model/src/main/java/org/apache/ 
>>> tuscany/model/assembly/impl/BindingImpl.java (original)
>>> +++ incubator/tuscany/java/sca/model/src/main/java/org/apache/ 
>>> tuscany/model/assembly/impl/BindingImpl.java Wed Apr 12 18:03:55  
>>> 2006
>>> @@ -16,8 +16,8 @@
>>>   */
>>>  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.AssemblyContext;
>>> +import org.apache.tuscany.model.assembly.AssemblyVisitor;
>>>  import org.apache.tuscany.model.assembly.Binding;
>>>
>>>  /**
>>> @@ -26,41 +26,25 @@
>>>  public class BindingImpl extends ExtensibleImpl implements  
>>> Binding {
>>>
>>>      private String uri;
>>> -    private Object contextFactory;
>>>
>>> -    /**
>>> -     * Constructor
>>> -     */
>>>      protected BindingImpl() {
>>>      }
>>>
>>> -    /**
>>> -     * @see org.apache.tuscany.model.assembly.Binding#getURI()
>>> -     */
>>>      public String getURI() {
>>>          return uri;
>>>      }
>>>
>>> -    /**
>>> -     * @see org.apache.tuscany.model.assembly.Binding#setURI 
>>> (java.lang.String)
>>> -     */
>>>      public void setURI(String value) {
>>>          checkNotFrozen();
>>>          uri=value;
>>>      }
>>>
>>> -    /**
>>> -     * @see  
>>> org.apache.tuscany.model.assembly.AssemblyModelObject#initialize 
>>> (org.apache.tuscany.model.assembly.AssemblyModelContext)
>>> -     */
>>> -    public void initialize(AssemblyModelContext modelContext) {
>>> +    public void initialize(AssemblyContext modelContext) {
>>>          if (isInitialized())
>>>              return;
>>>          super.initialize(modelContext);
>>>      }
>>>
>>> -    /**
>>> -     * @see  
>>> org.apache.tuscany.model.assembly.AssemblyModelObject#freeze()
>>> -     */
>>>      public void freeze() {
>>>          if (isFrozen())
>>>              return;
>>> @@ -68,25 +52,7 @@
>>>
>>>      }
>>>
>>> -    /**
>>> -     * @see  
>>> org.apache.tuscany.model.assembly.ContextFactoryHolder#getContextFac 
>>> tory()
>>> -     */
>>> -    public Object getContextFactory() {
>>> -        return contextFactory;
>>> -    }
>>> -
>>> -    /**
>>> -     * @see  
>>> org.apache.tuscany.model.assembly.ContextFactoryHolder#setContextFac 
>>> tory(java.lang.Object)
>>> -     */
>>> -    public void setContextFactory(Object configuration) {
>>> -        checkNotFrozen();
>>> -        this.contextFactory = configuration;
>>> -    }
>>> -
>>> -    /**
>>> -     * @see  
>>> org.apache.tuscany.model.assembly.impl.AggregateImpl#accept 
>>> (org.apache.tuscany.model.assembly.AssemblyModelVisitor)
>>> -     */
>>> -    public boolean accept(AssemblyModelVisitor visitor) {
>>> +    public boolean accept(AssemblyVisitor visitor) {
>>>          if (!super.accept(visitor))
>>>              return false;
>>>
>>>
>>> Modified: incubator/tuscany/java/sca/model/src/main/java/org/ 
>>> apache/tuscany/model/assembly/impl/ComponentImpl.java
>>> URL: http://svn.apache.org/viewcvs/incubator/tuscany/java/sca/ 
>>> model/src/main/java/org/apache/tuscany/model/assembly/impl/ 
>>> ComponentImpl.java?rev=393677&r1=393676&r2=393677&view=diff
>>> ==================================================================== 
>>> ==========
>>> --- incubator/tuscany/java/sca/model/src/main/java/org/apache/ 
>>> tuscany/model/assembly/impl/ComponentImpl.java (original)
>>> +++ incubator/tuscany/java/sca/model/src/main/java/org/apache/ 
>>> tuscany/model/assembly/impl/ComponentImpl.java Wed Apr 12  
>>> 18:03:55 2006
>>> @@ -16,180 +16,194 @@
>>>   */
>>>  package org.apache.tuscany.model.assembly.impl;
>>>
>>> -import java.util.ArrayList;
>>> -import java.util.Collections;
>>>  import java.util.HashMap;
>>>  import java.util.List;
>>>  import java.util.Map;
>>>
>>> +import org.apache.tuscany.model.assembly.AssemblyContext;
>>>  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.AssemblyInitializationException;
>>> +import org.apache.tuscany.model.assembly.AssemblyVisitor;
>>>  import org.apache.tuscany.model.assembly.Component;
>>> -import org.apache.tuscany.model.assembly.ComponentImplementation;
>>> -import org.apache.tuscany.model.assembly.ComponentType;
>>> +import org.apache.tuscany.model.assembly.ComponentInfo;
>>> +import org.apache.tuscany.model.assembly.ConfiguredPort;
>>>  import org.apache.tuscany.model.assembly.ConfiguredProperty;
>>>  import org.apache.tuscany.model.assembly.ConfiguredReference;
>>>  import org.apache.tuscany.model.assembly.ConfiguredService;
>>> +import org.apache.tuscany.model.assembly.Implementation;
>>> +import org.apache.tuscany.model.assembly.Property;
>>>  import org.apache.tuscany.model.assembly.Reference;
>>>  import org.apache.tuscany.model.assembly.Service;
>>> +import org.apache.tuscany.model.util.NotifyingList;
>>>
>>>  /**
>>>   * An implementation of Component.
>>>   */
>>> -public abstract class ComponentImpl extends AggregatePartImpl  
>>> implements Component {
>>> -
>>> -    private Map<String, ConfiguredReference>  
>>> configuredReferencesMap = new HashMap<String, ConfiguredReference> 
>>> ();
>>> -    private List<ConfiguredService> configuredServices = new  
>>> ArrayList<ConfiguredService>();
>>> -    private Map<String, ConfiguredService> configuredServicesMap;
>>> -    private List<ConfiguredProperty> configuredProperties = new  
>>> ArrayList<ConfiguredProperty>();
>>> -    private Map<String, ConfiguredProperty>  
>>> configuredPropertiesMap;
>>> -    private ComponentImplementation implementation;
>>> +public abstract class ComponentImpl<I extends Implementation>  
>>> extends PartImpl implements Component<I> {
>>>
>>>      /**
>>> -     * @see  
>>> org.apache.tuscany.model.assembly.Component#getComponentImplementati 
>>> on()
>>> +     * A list of configured ports synchronized with a map
>>>       */
>>> -    public ComponentImplementation getComponentImplementation() {
>>> +    private class ConfiguredPortList<E extends ConfiguredPort>  
>>> extends NotifyingList<E>{
>>> +
>>> +        Map<String, E> map;
>>> +
>>> +        private ConfiguredPortList(Map<String, E> map) {
>>> +            this.map=map;
>>> +        }
>>> +
>>> +        protected void added(E element) {
>>> +            String name=element.getPort()!=null? element.getPort 
>>> ().getName():element.getName();
>>> +            map.put(name, element);
>>> +            element.setPart(ComponentImpl.this);
>>> +        }
>>> +        protected void removed(E element) {
>>> +            String name=element.getPort()!=null? element.getPort 
>>> ().getName():element.getName();
>>> +            map.remove(name);
>>> +            element.setPart(null);
>>> +        }
>>> +    }
>>> +
>>> +    private Map<String, ConfiguredReference>  
>>> configuredReferencesMap = new HashMap<String, ConfiguredReference> 
>>> ();
>>> +    private List<ConfiguredReference> configuredReferences = new  
>>> ConfiguredPortList<ConfiguredReference>(configuredReferencesMap);
>>> +
>>> +    private Map<String, ConfiguredService> configuredServicesMap  
>>> = new HashMap<String, ConfiguredService>();
>>> +    private List<ConfiguredService> configuredServices = new  
>>> ConfiguredPortList<ConfiguredService>(configuredServicesMap);
>>> +
>>> +    /**
>>> +     * A list of properties synchronized with a map
>>> +     */
>>> +    private class ConfiguredPropertyList<E extends  
>>> ConfiguredProperty> extends NotifyingList<E>{
>>> +
>>> +        protected void added(E element) {
>>> +            String name=element.getProperty()!=null?  
>>> element.getProperty().getName():element.getName();
>>> +            configuredPropertiesMap.put(name, element);
>>> +        }
>>> +        protected void removed(E element) {
>>> +            String name=element.getProperty()!=null?  
>>> element.getProperty().getName():element.getName();
>>> +            configuredPropertiesMap.remove(name);
>>> +        }
>>> +    }
>>> +
>>> +    private List<ConfiguredProperty> configuredProperties = new  
>>> ConfiguredPropertyList<ConfiguredProperty>();
>>> +    private Map<String, ConfiguredProperty>  
>>> configuredPropertiesMap=new HashMap<String, ConfiguredProperty>();
>>> +
>>> +    private I implementation;
>>> +
>>> +    public I getImplementation() {
>>>          return implementation;
>>>      }
>>>
>>> -    /**
>>> -     * @see  
>>> org.apache.tuscany.model.assembly.Component#setComponentImplementati 
>>> on(org.apache.tuscany.model.assembly.ComponentImplementation)
>>> -     */
>>> -    public void setComponentImplementation 
>>> (ComponentImplementation value) {
>>> +    public void setImplementation(I value) {
>>>          checkNotFrozen();
>>>          implementation = value;
>>>      }
>>>
>>> -    /**
>>> -     * @see  
>>> org.apache.tuscany.model.assembly.Component#getConfiguredServices()
>>> -     */
>>>      public List<ConfiguredService> getConfiguredServices() {
>>>          return configuredServices;
>>>      }
>>>
>>>      public ConfiguredService getConfiguredService(String name) {
>>> -        checkInitialized();
>>>          return configuredServicesMap.get(name);
>>>      }
>>>
>>> -    public Map<String, ConfiguredReference>  
>>> getConfiguredReferences() {
>>> -        return configuredReferencesMap;
>>> +    public List<ConfiguredReference> getConfiguredReferences() {
>>> +        return configuredReferences;
>>>      }
>>>
>>> -    /**
>>> -     * @see  
>>> org.apache.tuscany.model.assembly.Component#getConfiguredReference 
>>> (java.lang.String)
>>> -     */
>>>      public ConfiguredReference getConfiguredReference(String  
>>> name) {
>>>          return configuredReferencesMap.get(name);
>>>      }
>>>
>>> -    /**
>>> -     * @see  
>>> org.apache.tuscany.model.assembly.Component#getConfiguredProperties( 
>>> )
>>> -     */
>>>      public List<ConfiguredProperty> getConfiguredProperties() {
>>>          return configuredProperties;
>>>      }
>>>
>>> -    /**
>>> -     * @see  
>>> org.apache.tuscany.model.assembly.Component#getConfiguredProperty 
>>> (java.lang.String)
>>> -     */
>>>      public ConfiguredProperty getConfiguredProperty(String name) {
>>> -        checkInitialized();
>>>          return configuredPropertiesMap.get(name);
>>>      }
>>>
>>> -    /**
>>> -     * @see  
>>> org.apache.tuscany.model.assembly.AssemblyModelObject#initialize 
>>> (org.apache.tuscany.model.assembly.AssemblyModelContext)
>>> -     */
>>> -    public void initialize(AssemblyModelContext modelContext) {
>>> +    public void initialize(AssemblyContext modelContext) {
>>>          if (isInitialized())
>>>              return;
>>>          super.initialize(modelContext);
>>>
>>>          // Initialize the implementation
>>> -        ComponentImplementation implementation =  
>>> getComponentImplementation();
>>>          if (implementation == null) {
>>> -            throw new IllegalStateException("No implementation  
>>> for component [" + getName() + ']');
>>> +            throw new AssemblyInitializationException("No  
>>> implementation for component [" + getName() + ']');
>>>          }
>>>          implementation.initialize(modelContext);
>>> -        ComponentType componentType =  
>>> implementation.getComponentType();
>>>
>>> -        // Derive the configured services, references and  
>>> properties from the component implementation
>>> -        //FIXME we have two options here: either just index the  
>>> configured services, references and properties
>>> -        // that we find in the corresponding lists, or derive  
>>> them from the services, references and properties on
>>> -        // the component type, for now just check if the lists  
>>> are empty or not to determine which option to go with
>>> -        configuredServicesMap = new HashMap<String,  
>>> ConfiguredService>();
>>> -        if (configuredServices.isEmpty()) {
>>> -            AssemblyFactory factory =  
>>> modelContext.getAssemblyFactory();
>>> -            for (Service service : componentType.getServices()) {
>>> -                ConfiguredService configuredService =  
>>> factory.createConfiguredService();
>>> -                configuredService.setPort(service);
>>> -                configuredServices.add(configuredService);
>>> -                configuredServicesMap.put(service.getName(),  
>>> configuredService);
>>> -                ((ConfiguredPortImpl)  
>>> configuredService).setAggregatePart(this);
>>> -                configuredService.initialize(modelContext);
>>> -            }
>>> -        } else {
>>> +        // Derive the configured services from the component  
>>> implementation
>>> +        ComponentInfo  
>>> componentInfo=implementation.getComponentInfo();
>>> +        AssemblyFactory factory = modelContext.getAssemblyFactory 
>>> ();
>>> +        for (Service service : componentInfo.getServices()) {
>>> +            ConfiguredService configuredService =  
>>> factory.createConfiguredService();
>>> +            configuredService.setPort(service);
>>> +            configuredServices.add(configuredService);
>>> +            configuredService.initialize(modelContext);
>>> +        }
>>>
>>> -            // Just populate the maps of services, references  
>>> and properties from the contents of
>>> -            // the corresponding lists
>>> -            for (ConfiguredService configuredService :  
>>> configuredServices) {
>>> -                configuredServicesMap.put 
>>> (configuredService.getService().getName(), configuredService);
>>> -                ((ConfiguredPortImpl)  
>>> configuredService).setAggregatePart(this);
>>> -                configuredService.initialize(modelContext);
>>> +        // Derive the configured references from the references  
>>> on the component info
>>> +        for (Reference reference : componentInfo.getReferences()) {
>>> +            ConfiguredReference configuredReference =  
>>> configuredReferencesMap.get(reference.getName());
>>> +            if (configuredReference==null) {
>>> +                 
>>> configuredReference=factory.createConfiguredReference();
>>> +                configuredReference.setPort(reference);
>>> +                configuredReferences.add(configuredReference);
>>> +                configuredReference.initialize(modelContext);
>>> +            } else {
>>> +                configuredReference.setPort(reference);
>>> +                configuredReference.initialize(modelContext);
>>> +            }
>>> +        }
>>> +        for (ConfiguredReference configuredReference :  
>>> configuredReferences) {
>>> +            if (configuredReference.getPort()==null) {
>>> +                throw new AssemblyInitializationException 
>>> ("Undefined reference ["+configuredReference.getName()+"]");
>>>              }
>>> -
>>>          }
>>>
>>> -        // Match configured properties to the properties on the  
>>> component type
>>> -        configuredPropertiesMap = new HashMap<String,  
>>> ConfiguredProperty>(configuredProperties.size());
>>> +        // Derive the configured properties from the properties  
>>> on the component info
>>> +        for (Property property : componentInfo.getProperties()) {
>>> +            ConfiguredProperty configuredProperty =  
>>> configuredPropertiesMap.get(property.getName());
>>> +            if (configuredProperty==null) {
>>> +                 
>>> configuredProperty=factory.createConfiguredProperty();
>>> +                configuredProperty.setProperty(property);
>>> +                configuredProperties.add(configuredProperty);
>>> +                configuredProperty.initialize(modelContext);
>>> +            } else {
>>> +                configuredProperty.setProperty(property);
>>> +                configuredProperty.initialize(modelContext);
>>> +            }
>>> +        }
>>>          for (ConfiguredProperty configuredProperty :  
>>> configuredProperties) {
>>> -            String name = configuredProperty.getName();
>>> -            configuredProperty.setProperty 
>>> (componentType.getProperty(name));
>>> -            configuredProperty.initialize(modelContext);
>>> -            configuredPropertiesMap.put(name, configuredProperty);
>>> +            if (configuredProperty.getProperty()==null) {
>>> +                throw new AssemblyInitializationException 
>>> ("Undefined property ["+configuredProperty.getName()+"]");
>>> +            }
>>>          }
>>>
>>> -        // Match configured references to the references on the  
>>> component type
>>> -        for (ConfiguredReference configuredReference :  
>>> configuredReferencesMap.values()) {
>>> -            String name = configuredReference.getName();
>>> -            ((ConfiguredPortImpl)  
>>> configuredReference).setAggregatePart(this);
>>> -            Reference reference = componentType.getReference(name);
>>> -            configuredReference.setReference(reference);
>>> -            configuredReference.initialize(modelContext);
>>> -        }
>>>      }
>>>
>>> -    /**
>>> -     * @see  
>>> org.apache.tuscany.model.assembly.AssemblyModelObject#freeze()
>>> -     */
>>>      public void freeze() {
>>>          if (isFrozen())
>>>              return;
>>>          super.freeze();
>>>
>>>          // Freeze configured services, references and properties
>>> -        configuredServices = Collections.unmodifiableList 
>>> (configuredServices);
>>> -        freeze(configuredServices);
>>> -        configuredReferencesMap = Collections.unmodifiableMap 
>>> (configuredReferencesMap);
>>> -        freeze(configuredReferencesMap.values());
>>> -        configuredProperties = Collections.unmodifiableList 
>>> (configuredProperties);
>>> -        freeze(configuredProperties);
>>> +        configuredServices = freeze(configuredServices);
>>> +        configuredReferences = freeze(configuredReferences);
>>> +        configuredProperties = freeze(configuredProperties);
>>>          if (implementation != null)
>>>              implementation.freeze();
>>>      }
>>>
>>> -    /**
>>> -     * @see  
>>> org.apache.tuscany.model.assembly.impl.AssemblyModelObjectImpl#accep 
>>> t(org.apache.tuscany.model.assembly.AssemblyModelVisitor)
>>> -     */
>>> -    public boolean accept(AssemblyModelVisitor visitor) {
>>> +    public boolean accept(AssemblyVisitor visitor) {
>>>          if (!super.accept(visitor))
>>>              return false;
>>>
>>>          if (!accept(configuredServices, visitor))
>>>              return false;
>>> -        if (!accept(configuredReferencesMap.values(), visitor))
>>> +        if (!accept(configuredReferences, visitor))
>>>              return false;
>>>          if (!accept(configuredProperties, visitor))
>>>              return false;
>>>
>>> Added: incubator/tuscany/java/sca/model/src/main/java/org/apache/ 
>>> tuscany/model/assembly/impl/ComponentInfoImpl.java
>>> URL: http://svn.apache.org/viewcvs/incubator/tuscany/java/sca/ 
>>> model/src/main/java/org/apache/tuscany/model/assembly/impl/ 
>>> ComponentInfoImpl.java?rev=393677&view=auto
>>> ==================================================================== 
>>> ==========
>>> --- incubator/tuscany/java/sca/model/src/main/java/org/apache/ 
>>> tuscany/model/assembly/impl/ComponentInfoImpl.java (added)
>>> +++ incubator/tuscany/java/sca/model/src/main/java/org/apache/ 
>>> tuscany/model/assembly/impl/ComponentInfoImpl.java Wed Apr 12  
>>> 18:03:55 2006
>>> @@ -0,0 +1,147 @@
>>> +/**
>>> + *
>>> + *  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.HashMap;
>>> +import java.util.List;
>>> +import java.util.Map;
>>> +
>>> +import org.apache.tuscany.model.assembly.AssemblyContext;
>>> +import org.apache.tuscany.model.assembly.AssemblyVisitor;
>>> +import org.apache.tuscany.model.assembly.ComponentInfo;
>>> +import org.apache.tuscany.model.assembly.Port;
>>> +import org.apache.tuscany.model.assembly.Property;
>>> +import org.apache.tuscany.model.assembly.Reference;
>>> +import org.apache.tuscany.model.assembly.Service;
>>> +import org.apache.tuscany.model.util.NotifyingList;
>>> +
>>> +/**
>>> + * An implementation of ComponentInfo.
>>> + */
>>> +public class ComponentInfoImpl extends ExtensibleImpl implements  
>>> ComponentInfo {
>>> +
>>> +    /**
>>> +     * A list of ports synchronized with a map
>>> +     */
>>> +    private class PortList<E extends Port> extends  
>>> NotifyingList<E>{
>>> +
>>> +        Map<String, E> map;
>>> +
>>> +        private PortList(Map<String, E> map) {
>>> +            this.map=map;
>>> +        }
>>> +
>>> +        protected void added(E element) {
>>> +            map.put(element.getName(), element);
>>> +        }
>>> +        protected void removed(E element) {
>>> +            map.remove(element.getName());
>>> +        }
>>> +    }
>>> +
>>> +    private Map<String, Reference> referencesMap=new  
>>> HashMap<String, Reference>();
>>> +    private List<Reference> references=new PortList<Reference> 
>>> (referencesMap);
>>> +
>>> +    private Map<String, Service> servicesMap=new HashMap<String,  
>>> Service>();
>>> +    private List<Service> services=new PortList<Service> 
>>> (servicesMap);
>>> +
>>> +    /**
>>> +     * A list of properties synchronized with a map
>>> +     */
>>> +    private class PropertyList<E extends Property> extends  
>>> NotifyingList<E>{
>>> +
>>> +        protected void added(E element) {
>>> +            propertiesMap.put(element.getName(), element);
>>> +        }
>>> +        protected void removed(E element) {
>>> +            propertiesMap.remove(element.getName());
>>> +        }
>>> +    }
>>> +
>>> +    private Map<String, Property> propertiesMap=new  
>>> HashMap<String, Property>();
>>> +    private List<Property> properties=new PropertyList<Property>();
>>> +
>>> +    protected ComponentInfoImpl() {
>>> +    }
>>> +
>>> +    public List<Reference> getReferences() {
>>> +        return references;
>>> +    }
>>> +
>>> +    public Reference getReference(String name) {
>>> +        return referencesMap.get(name);
>>> +    }
>>> +
>>> +    public List<Service> getServices() {
>>> +        return services;
>>> +    }
>>> +
>>> +    public Service getService(String name) {
>>> +        return servicesMap.get(name);
>>> +    }
>>> +
>>> +    public List<Property> getProperties() {
>>> +        return properties;
>>> +    }
>>> +
>>> +    public Property getProperty(String name) {
>>> +        return propertiesMap.get(name);
>>> +    }
>>> +
>>> +    public void initialize(AssemblyContext modelContext) {
>>> +        if (isInitialized())
>>> +            return;
>>> +        super.initialize(modelContext);
>>> +
>>> +        // Initialize references, properties and services
>>> +        for (Reference reference : references) {
>>> +            reference.initialize(modelContext);
>>> +        }
>>> +        for (Property property : properties) {
>>> +            property.initialize(modelContext);
>>> +        }
>>> +        for (Service service : services) {
>>> +            service.initialize(modelContext);
>>> +        }
>>> +    }
>>> +
>>> +    public void freeze() {
>>> +        if (isFrozen())
>>> +            return;
>>> +        super.freeze();
>>> +
>>> +        // Freeze lists of services, references and properties
>>> +        services=freeze(services);
>>> +        references=freeze(references);
>>> +        properties=freeze(properties);
>>> +    }
>>> +
>>> +    public boolean accept(AssemblyVisitor visitor) {
>>> +        if (!super.accept(visitor))
>>> +            return false;
>>> +
>>> +        if (!accept(services, visitor))
>>> +            return false;
>>> +        if (!accept(references, visitor))
>>> +            return false;
>>> +        if (!accept(properties, visitor))
>>> +            return false;
>>> +
>>> +        return true;
>>> +    }
>>> +
>>> +}
>>>
>>> Propchange: incubator/tuscany/java/sca/model/src/main/java/org/ 
>>> apache/tuscany/model/assembly/impl/ComponentInfoImpl.java
>>> -------------------------------------------------------------------- 
>>> ----------
>>>     svn:eol-style = native
>>>
>>> Propchange: incubator/tuscany/java/sca/model/src/main/java/org/ 
>>> apache/tuscany/model/assembly/impl/ComponentInfoImpl.java
>>> -------------------------------------------------------------------- 
>>> ----------
>>>     svn:keywords = Rev,Date
>>>
>>> Added: incubator/tuscany/java/sca/model/src/main/java/org/apache/ 
>>> tuscany/model/assembly/impl/CompositeImpl.java
>>> URL: http://svn.apache.org/viewcvs/incubator/tuscany/java/sca/ 
>>> model/src/main/java/org/apache/tuscany/model/assembly/impl/ 
>>> CompositeImpl.java?rev=393677&view=auto
>>> ==================================================================== 
>>> ==========
>>> --- incubator/tuscany/java/sca/model/src/main/java/org/apache/ 
>>> tuscany/model/assembly/impl/CompositeImpl.java (added)
>>> +++ incubator/tuscany/java/sca/model/src/main/java/org/apache/ 
>>> tuscany/model/assembly/impl/CompositeImpl.java Wed Apr 12  
>>> 18:03:55 2006
>>> @@ -0,0 +1,343 @@
>>> +/**
>>> + *
>>> + *  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.HashMap;
>>> +import java.util.List;
>>> +import java.util.Map;
>>> +
>>> +import org.apache.tuscany.model.assembly.AssemblyContext;
>>> +import org.apache.tuscany.model.assembly.AssemblyFactory;
>>> +import org.apache.tuscany.model.assembly.AssemblyVisitor;
>>> +import org.apache.tuscany.model.assembly.Component;
>>> +import org.apache.tuscany.model.assembly.ComponentInfo;
>>> +import org.apache.tuscany.model.assembly.Composite;
>>> +import org.apache.tuscany.model.assembly.ConfiguredProperty;
>>> +import org.apache.tuscany.model.assembly.ConfiguredReference;
>>> +import org.apache.tuscany.model.assembly.ConfiguredService;
>>> +import org.apache.tuscany.model.assembly.EntryPoint;
>>> +import org.apache.tuscany.model.assembly.ExternalService;
>>> +import org.apache.tuscany.model.assembly.Implementation;
>>> +import org.apache.tuscany.model.assembly.ImportWSDL;
>>> +import org.apache.tuscany.model.assembly.Multiplicity;
>>> +import org.apache.tuscany.model.assembly.OverrideOption;
>>> +import org.apache.tuscany.model.assembly.Part;
>>> +import org.apache.tuscany.model.assembly.Reference;
>>> +import org.apache.tuscany.model.assembly.Service;
>>> +import org.apache.tuscany.model.assembly.ServiceContract;
>>> +import org.apache.tuscany.model.assembly.ServiceURI;
>>> +import org.apache.tuscany.model.assembly.Wire;
>>> +import org.apache.tuscany.model.util.NotifyingList;
>>> +
>>> +/**
>>> + * An implementation of Composite.
>>> + */
>>> +public abstract class CompositeImpl extends ExtensibleImpl  
>>> implements Composite {
>>> +
>>> +    private String name;
>>> +    private ComponentInfo componentInfo;
>>> +
>>> +    /**
>>> +     * A list of parts synchronized with a map
>>> +     */
>>> +    private class PartList<E extends Part> extends  
>>> NotifyingList<E>{
>>> +        protected void added(E element) {
>>> +            partsMap.put(element.getName(), element);
>>> +            element.setComposite(CompositeImpl.this);
>>> +        }
>>> +        protected void removed(E element) {
>>> +            partsMap.remove(element.getName());
>>> +            element.setComposite(null);
>>> +        }
>>> +    }
>>> +
>>> +    private Map<String, Part> partsMap = new HashMap<String,  
>>> Part>();
>>> +
>>> +    private List<Component> components = new PartList<Component>();
>>> +    private List<EntryPoint> entryPoints = new  
>>> PartList<EntryPoint>();
>>> +    private List<ExternalService> externalServices = new  
>>> PartList<ExternalService>();
>>> +
>>> +    private List<Wire> wires = new ArrayList<Wire>();
>>> +
>>> +    /**
>>> +     * A list of WSDL imports synchronized with a map
>>> +     */
>>> +    private class ImportWSDLList extends NotifyingList<ImportWSDL>{
>>> +        protected void added(ImportWSDL element) {
>>> +            List<ImportWSDL> importList=wsdlImportsMap.get 
>>> (element.getNamespace());
>>> +            if (importList==null) {
>>> +                importList=new ArrayList<ImportWSDL>();
>>> +                wsdlImportsMap.put(element.getNamespace(),  
>>> importList);
>>> +            }
>>> +            importList.add(element);
>>> +        }
>>> +        protected void removed(ImportWSDL element) {
>>> +            List<ImportWSDL> importList=wsdlImportsMap.get 
>>> (element.getNamespace());
>>> +            if (importList!=null) {
>>> +                importList.remove(element);
>>> +                if (importList.isEmpty())
>>> +                    wsdlImportsMap.remove(element.getNamespace());
>>> +            }
>>> +        }
>>> +    }
>>> +
>>> +    private Map<String, List<ImportWSDL>> wsdlImportsMap = new  
>>> HashMap<String, List<ImportWSDL>>();
>>> +
>>> +    private List<ImportWSDL> wsdlImports = new ImportWSDLList();
>>> +
>>> +    private AssemblyContext modelContext;
>>> +
>>> +    protected CompositeImpl() {
>>> +    }
>>> +
>>> +    public String getName() {
>>> +        return name;
>>> +    }
>>> +
>>> +    public void setName(String newName) {
>>> +        checkNotFrozen();
>>> +        name = newName;
>>> +    }
>>> +
>>> +    public List<Component> getComponents() {
>>> +        return components;
>>> +    }
>>> +
>>> +    public List<EntryPoint> getEntryPoints() {
>>> +        return entryPoints;
>>> +    }
>>> +
>>> +    public List<ExternalService> getExternalServices() {
>>> +        return externalServices;
>>> +    }
>>> +
>>> +    public Part getPart(String name) {
>>> +        return partsMap.get(name);
>>> +    }
>>> +
>>> +    public List<Wire> getWires() {
>>> +        return wires;
>>> +    }
>>> +
>>> +    public List<ImportWSDL> getWSDLImports() {
>>> +        return wsdlImports;
>>> +    }
>>> +
>>> +    public List<ImportWSDL> getWSDLImports(String namespace) {
>>> +        return wsdlImportsMap.get(namespace);
>>> +    }
>>> +
>>> +    public ComponentInfo getComponentInfo() {
>>> +        return componentInfo;
>>> +    }
>>> +
>>> +    public void setComponentInfo(ComponentInfo componentType) {
>>> +        checkNotFrozen();
>>> +        this.componentInfo=componentType;
>>> +    }
>>> +
>>> +    public AssemblyContext getAssemblyContext() {
>>> +        checkInitialized();
>>> +        return modelContext;
>>> +    }
>>> +
>>> +    public ConfiguredService getConfiguredService(ServiceURI  
>>> address) {
>>> +        String partName = address.getPartName();
>>> +        String serviceName = address.getServiceName();
>>> +        Part part = getPart(partName);
>>> +        if (part instanceof Component) {
>>> +            Component<Implementation> component=(Component)part;
>>> +            if (serviceName != null) {
>>> +                return component.getConfiguredService(serviceName);
>>> +            } else {
>>> +                if (!component.getConfiguredServices().isEmpty()) {
>>> +                    return component.getConfiguredServices().get 
>>> (0);
>>> +                } else {
>>> +                    return null;
>>> +                }
>>> +            }
>>> +
>>> +        } if (part instanceof ExternalService) {
>>> +            ExternalService externalService = (ExternalService) 
>>> part;
>>> +            return externalService.getConfiguredService();
>>> +        } else
>>> +            return null;
>>> +    }
>>> +
>>> +    public void initialize(AssemblyContext modelContext) {
>>> +        if (isInitialized())
>>> +            return;
>>> +        super.initialize(modelContext);
>>> +
>>> +        // Save the model context
>>> +        this.modelContext = modelContext;
>>> +
>>> +        // Initialize WSDL imports
>>> +        for (ImportWSDL importWSDL : wsdlImports) {
>>> +            importWSDL.initialize(modelContext);
>>> +        }
>>> +
>>> +        // Initialize parts
>>> +        for (Part part : externalServices) {
>>> +            part.initialize(modelContext);
>>> +        }
>>> +        for (Part part : components) {
>>> +            part.initialize(modelContext);
>>> +        }
>>> +        for (Part part : entryPoints) {
>>> +            part.initialize(modelContext);
>>> +        }
>>> +
>>> +        // Derive the component info from the entry points and  
>>> external services in the composite
>>> +        // Also derive properties from the overridable  
>>> properties of the components in the composite
>>> +        if (componentInfo==null) {
>>> +            AssemblyFactory factory =  
>>> modelContext.getAssemblyFactory();
>>> +            componentInfo = factory.createComponentInfo();
>>> +            for (EntryPoint entryPoint : getEntryPoints()) {
>>> +                Service service = factory.createService();
>>> +                service.setName(entryPoint.getName());
>>> +                ServiceContract serviceContract =  
>>> entryPoint.getConfiguredService().getPort().getServiceContract();
>>> +                if (serviceContract != null)
>>> +                    service.setServiceContract(serviceContract);
>>> +                componentInfo.getServices().add(service);
>>> +
>>> +                ConfiguredReference configuredReference =  
>>> entryPoint.getConfiguredReference();
>>> +                ServiceURI sourceURI = factory.createServiceURI 
>>> (null, entryPoint, configuredReference);
>>> +                for (String target :  
>>> configuredReference.getTargets()) {
>>> +                    ServiceURI targetURI  
>>> =factory.createServiceURI(null, target);
>>> +                    Wire wire=factory.createWire();
>>> +                    wire.setSource(sourceURI);
>>> +                    wire.setTarget(targetURI);
>>> +                    getWires().add(wire);
>>> +                }
>>> +            }
>>> +            for (ExternalService externalService :  
>>> getExternalServices()) {
>>> +                if (externalService.getOverrideOption()==null ||  
>>> externalService.getOverrideOption()==OverrideOption.NO)
>>> +                    continue;
>>> +                Reference reference = factory.createReference();
>>> +                reference.setName(externalService.getName());
>>> +                ServiceContract serviceContract =  
>>> externalService.getConfiguredService().getPort 
>>> ().getServiceContract();
>>> +                if (serviceContract != null)
>>> +                    reference.setServiceContract(serviceContract);
>>> +                componentInfo.getReferences().add(reference);
>>> +            }
>>> +            for (Component<Implementation> component :  
>>> getComponents()) {
>>> +                for (ConfiguredProperty configuredProperty :  
>>> component.getConfiguredProperties()) {
>>> +                    if (configuredProperty.getOverrideOption() 
>>> ==null || configuredProperty.getOverrideOption()==OverrideOption.NO)
>>> +                        continue;
>>> +                    componentInfo.getProperties().add 
>>> (configuredProperty.getProperty());
>>> +                }
>>> +
>>> +                for (ConfiguredReference configuredReference :  
>>> component.getConfiguredReferences()) {
>>> +                    // Create a wire
>>> +                    ServiceURI sourceURI  
>>> =factory.createServiceURI(null, component, configuredReference);
>>> +                    for (String target :  
>>> configuredReference.getTargets()) {
>>> +                        ServiceURI targetURI  
>>> =factory.createServiceURI(null, target);
>>> +                        Wire wire=factory.createWire();
>>> +                        wire.setSource(sourceURI);
>>> +                        wire.setTarget(targetURI);
>>> +                        getWires().add(wire);
>>> +                    }
>>> +                }
>>> +            }
>>> +        }
>>> +        componentInfo.initialize(modelContext);
>>> +
>>> +        // Wire the module parts
>>> +        for (Wire wire : getWires()) {
>>> +
>>> +            // Get the source reference
>>> +            ServiceURI sourceURI=wire.getSource();
>>> +            ConfiguredReference configuredReference = null;
>>> +            String partName = sourceURI.getPartName();
>>> +            String referenceName = sourceURI.getServiceName();
>>> +            if (referenceName != null) {
>>> +                Component component = (Component)getPart(partName);
>>> +                if (component != null) {
>>> +                    configuredReference =  
>>> component.getConfiguredReference(referenceName);
>>> +                }
>>> +            } else {
>>> +                EntryPoint entryPoint = (EntryPoint)getPart 
>>> (partName);
>>> +                if (entryPoint != null) {
>>> +                    configuredReference =  
>>> entryPoint.getConfiguredReference();
>>> +                }
>>> +            }
>>> +            if (configuredReference == null) {
>>> +                throw new IllegalArgumentException("Cannot find  
>>> wire source " + sourceURI.getAddress());
>>> +            } else {
>>> +
>>> +                // Resolve the target service endpoint
>>> +                ServiceURI targetURI = wire.getTarget();
>>> +                ConfiguredService configuredService =  
>>> getConfiguredService(targetURI);
>>> +                if (configuredService != null) {
>>> +
>>> +                    // Wire the reference to the target
>>> +                    Multiplicity  
>>> multiplicity=configuredReference.getPort().getMultiplicity();
>>> +                    if (multiplicity==Multiplicity.ZERO_N ||  
>>> multiplicity==Multiplicity.ONE_N) {
>>> +                         
>>> configuredReference.getTargetConfiguredServices().add 
>>> (configuredService);
>>> +                    } else {
>>> +                         
>>> configuredReference.getTargetConfiguredServices().clear();
>>> +                         
>>> configuredReference.getTargetConfiguredServices().add 
>>> (configuredService);
>>> +                    }
>>> +                } else {
>>> +                    throw new IllegalArgumentException("Cannot  
>>> find service for " + targetURI.getAddress());
>>> +                }
>>> +            }
>>> +        }
>>> +
>>> +    }
>>> +
>>> +    public void freeze() {
>>> +        if (isFrozen())
>>> +            return;
>>> +        super.freeze();
>>> +
>>> +        // Freeze component info
>>> +        if (componentInfo!=null)
>>> +            componentInfo.freeze();
>>> +
>>> +        // Freeze lists
>>> +        wsdlImports=freeze(wsdlImports);
>>> +        components = freeze(components);
>>> +        entryPoints = freeze(entryPoints);
>>> +        externalServices = freeze(externalServices);
>>> +        wires = freeze(wires);
>>> +    }
>>> +
>>> +    public boolean accept(AssemblyVisitor visitor) {
>>> +        if (!super.accept(visitor))
>>> +            return false;
>>> +
>>> +        if (!accept(wsdlImports, visitor))
>>> +            return false;
>>> +
>>> +        if (!accept(partsMap.values(), visitor))
>>> +            return false;
>>> +
>>> +        if (!accept(wires, visitor))
>>> +            return false;
>>> +
>>> +        if (componentInfo!=null) {
>>> +            if (!componentInfo.accept(visitor))
>>> +                return false;
>>> +        }
>>> +
>>> +        return true;
>>> +    }
>>> +
>>> +}
>>>
>>> Propchange: incubator/tuscany/java/sca/model/src/main/java/org/ 
>>> apache/tuscany/model/assembly/impl/CompositeImpl.java
>>> -------------------------------------------------------------------- 
>>> ----------
>>>     svn:eol-style = native
>>>
>>> Propchange: incubator/tuscany/java/sca/model/src/main/java/org/ 
>>> apache/tuscany/model/assembly/impl/CompositeImpl.java
>>> -------------------------------------------------------------------- 
>>> ----------
>>>     svn:keywords = Rev,Date
>>>
>>> Modified: incubator/tuscany/java/sca/model/src/main/java/org/ 
>>> apache/tuscany/model/assembly/impl/ConfiguredPortImpl.java
>>> URL: http://svn.apache.org/viewcvs/incubator/tuscany/java/sca/ 
>>> model/src/main/java/org/apache/tuscany/model/assembly/impl/ 
>>> ConfiguredPortImpl.java?rev=393677&r1=393676&r2=393677&view=diff
>>> ==================================================================== 
>>> ==========
>>> --- incubator/tuscany/java/sca/model/src/main/java/org/apache/ 
>>> tuscany/model/assembly/impl/ConfiguredPortImpl.java (original)
>>> +++ incubator/tuscany/java/sca/model/src/main/java/org/apache/ 
>>> tuscany/model/assembly/impl/ConfiguredPortImpl.java Wed Apr 12  
>>> 18:03:55 2006
>>> @@ -16,105 +16,72 @@
>>>   */
>>>  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.Part;
>>> +import org.apache.tuscany.model.assembly.AssemblyContext;
>>> +import org.apache.tuscany.model.assembly.AssemblyVisitor;
>>>  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;
>>> +public abstract class ConfiguredPortImpl<P extends Port> extends  
>>> AssemblyObjectImpl implements ConfiguredPort<P> {
>>> +    private String name;
>>> +    private Part part;
>>> +    private P port;
>>>
>>> -    private Object contextFactory;
>>>      private Object proxyFactory;
>>>
>>> -    /**
>>> -     * Constructor
>>> -     */
>>>      protected ConfiguredPortImpl() {
>>>      }
>>> +
>>> +    public String getName() {
>>> +        return name;
>>> +    }
>>> +
>>> +    public void setName(String name) {
>>> +        checkNotFrozen();
>>> +        this.name=name;
>>> +    }
>>>
>>> -    /**
>>> -     * @see  
>>> org.apache.tuscany.model.assembly.ConfiguredPort#getPort()
>>> -     */
>>> -    public Port getPort() {
>>> +    public P getPort() {
>>>          return port;
>>>      }
>>>
>>> -    /**
>>> -     * @see  
>>> org.apache.tuscany.model.assembly.ConfiguredPort#setPort 
>>> (org.apache.tuscany.model.assembly.Port)
>>> -     */
>>> -    public void setPort(Port port) {
>>> +    public void setPort(P port) {
>>>          checkNotFrozen();
>>>          this.port = port;
>>>      }
>>>
>>> -    /**
>>> -     * @see  
>>> org.apache.tuscany.model.assembly.ConfiguredPort#getAggregatePart()
>>> -     */
>>> -    public AggregatePart getAggregatePart() {
>>> -        checkInitialized();
>>> -        return aggregatePart;
>>> +    public Part getPart() {
>>> +        return part;
>>>      }
>>> -
>>> -    /**
>>> -     * Sets the aggregate part containing this configured port.
>>> -     * @param aggregatePart
>>> -     */
>>> -    protected void setAggregatePart(AggregatePart aggregatePart) {
>>> +
>>> +    public void setPart(Part part) {
>>>          checkNotFrozen();
>>> -        this.aggregatePart=aggregatePart;
>>> +        this.part=part;
>>>      }
>>>
>>> -    /**
>>> -     * @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.ContextFactoryHolder#getContextFac 
>>> tory()
>>> -     */
>>> -    public Object getContextFactory() {
>>> -        return contextFactory;
>>> -    }
>>> -
>>> -    /**
>>> -     * @see  
>>> org.apache.tuscany.model.assembly.ContextFactoryHolder#setContextFac 
>>> tory(java.lang.Object)
>>> -     */
>>> -    public void setContextFactory(Object configuration) {
>>> -        checkNotFrozen();
>>> -        contextFactory = configuration;
>>> -    }
>>> -
>>> -    /**
>>> -     * @see  
>>> org.apache.tuscany.model.assembly.impl.AssemblyModelObjectImpl#initi 
>>> alize(org.apache.tuscany.model.assembly.AssemblyModelContext)
>>> -     */
>>> -    public void initialize(AssemblyModelContext modelContext) {
>>> +    public void initialize(AssemblyContext modelContext) {
>>>          if (isInitialized())
>>>              return;
>>>          super.initialize(modelContext);
>>>
>>> -        if (port!=null)
>>> +        if (port!=null) {
>>> +            name=port.getName();
>>>              port.initialize(modelContext);
>>> +        }
>>>      }
>>>
>>> -    /**
>>> -     * @see  
>>> org.apache.tuscany.model.assembly.impl.AssemblyModelObjectImpl#freez 
>>> e()
>>> -     */
>>>      public void freeze() {
>>>          if (isFrozen())
>>>              return;
>>> @@ -124,10 +91,7 @@
>>>              port.freeze();
>>>      }
>>>
>>> -    /**
>>> -     * @see  
>>> org.apache.tuscany.model.assembly.impl.AssemblyModelObjectImpl#accep 
>>> t(org.apache.tuscany.model.assembly.AssemblyModelVisitor)
>>> -     */
>>> -    public boolean accept(AssemblyModelVisitor visitor) {
>>> +    public boolean accept(AssemblyVisitor visitor) {
>>>          if (!super.accept(visitor))
>>>              return false;
>>>
>>>
>>> Modified: incubator/tuscany/java/sca/model/src/main/java/org/ 
>>> apache/tuscany/model/assembly/impl/ConfiguredPropertyImpl.java
>>> URL: http://svn.apache.org/viewcvs/incubator/tuscany/java/sca/ 
>>> model/src/main/java/org/apache/tuscany/model/assembly/impl/ 
>>> ConfiguredPropertyImpl.java?rev=393677&r1=393676&r2=393677&view=diff
>>> ==================================================================== 
>>> ==========
>>> --- incubator/tuscany/java/sca/model/src/main/java/org/apache/ 
>>> tuscany/model/assembly/impl/ConfiguredPropertyImpl.java (original)
>>> +++ incubator/tuscany/java/sca/model/src/main/java/org/apache/ 
>>> tuscany/model/assembly/impl/ConfiguredPropertyImpl.java Wed Apr  
>>> 12 18:03:55 2006
>>> @@ -16,8 +16,8 @@
>>>   */
>>>  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.AssemblyContext;
>>> +import org.apache.tuscany.model.assembly.AssemblyVisitor;
>>>  import org.apache.tuscany.model.assembly.ConfiguredProperty;
>>>  import org.apache.tuscany.model.assembly.OverrideOption;
>>>  import org.apache.tuscany.model.assembly.Property;
>>> @@ -25,15 +25,12 @@
>>>  /**
>>>   * Implementation of ConfiguredProperty
>>>   */
>>> -public class ConfiguredPropertyImpl extends  
>>> AssemblyModelObjectImpl implements ConfiguredProperty {
>>> +public class ConfiguredPropertyImpl extends AssemblyObjectImpl  
>>> implements ConfiguredProperty {
>>>      private String name;
>>>      private OverrideOption overrideOption;
>>>      private Object value;
>>>      private Property property;
>>>
>>> -    /**
>>> -     * Constructor
>>> -     */
>>>      protected ConfiguredPropertyImpl() {
>>>      }
>>>
>>> @@ -45,55 +42,34 @@
>>>          this.name = name;
>>>      }
>>>
>>> -    /**
>>> -     * @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.ConfiguredProperty#getOverrideOpti 
>>> on()
>>> -     */
>>>      public OverrideOption getOverrideOption() {
>>>          return overrideOption;
>>>      }
>>>
>>> -    /*
>>> -     * @see  
>>> org.apache.tuscany.model.assembly.ConfiguredProperty#setOverrideOpti 
>>> on(org.apache.tuscany.model.assembly.OverrideOption)
>>> -     */
>>>      public void setOverrideOption(OverrideOption value) {
>>>          checkNotFrozen();
>>>          this.overrideOption=value;
>>>      }
>>>
>>> -    /**
>>> -     * @see  
>>> org.apache.tuscany.model.assembly.impl.AssemblyModelObjectImpl#initi 
>>> alize(org.apache.tuscany.model.assembly.AssemblyModelContext)
>>> -     */
>>> -    public void initialize(AssemblyModelContext modelContext) {
>>> +    public void initialize(AssemblyContext modelContext) {
>>>          if (isInitialized())
>>>              return;
>>>          super.initialize(modelContext);
>>> @@ -102,9 +78,6 @@
>>>              property.initialize(modelContext);
>>>      }
>>>
>>> -    /**
>>> -     * @see  
>>> org.apache.tuscany.model.assembly.impl.AssemblyModelObjectImpl#freez 
>>> e()
>>> -     */
>>>      public void freeze() {
>>>          if (isFrozen())
>>>              return;
>>> @@ -114,10 +87,7 @@
>>>              property.freeze();
>>>      }
>>>
>>> -    /**
>>> -     * @see  
>>> org.apache.tuscany.model.assembly.impl.AssemblyModelObjectImpl#accep 
>>> t(org.apache.tuscany.model.assembly.AssemblyModelVisitor)
>>> -     */
>>> -    public boolean accept(AssemblyModelVisitor visitor) {
>>> +    public boolean accept(AssemblyVisitor visitor) {
>>>          if (!super.accept(visitor))
>>>              return false;
>>>
>>>
>>> Modified: incubator/tuscany/java/sca/model/src/main/java/org/ 
>>> apache/tuscany/model/assembly/impl/ConfiguredReferenceImpl.java
>>> URL: http://svn.apache.org/viewcvs/incubator/tuscany/java/sca/ 
>>> model/src/main/java/org/apache/tuscany/model/assembly/impl/ 
>>> ConfiguredReferenceImpl.java? 
>>> rev=393677&r1=393676&r2=393677&view=diff
>>> ==================================================================== 
>>> ==========
>>> --- incubator/tuscany/java/sca/model/src/main/java/org/apache/ 
>>> tuscany/model/assembly/impl/ConfiguredReferenceImpl.java (original)
>>> +++ incubator/tuscany/java/sca/model/src/main/java/org/apache/ 
>>> tuscany/model/assembly/impl/ConfiguredReferenceImpl.java Wed Apr  
>>> 12 18:03:55 2006
>>> @@ -17,7 +17,6 @@
>>>  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;
>>> @@ -27,59 +26,28 @@
>>>  /**
>>>   * An implementation of ConfiguredReference.
>>>   */
>>> -public class ConfiguredReferenceImpl extends ConfiguredPortImpl  
>>> implements ConfiguredReference {
>>> +public class ConfiguredReferenceImpl extends  
>>> ConfiguredPortImpl<Reference> implements ConfiguredReference {
>>>
>>> -    private String name;
>>>      private List<String> targets = new ArrayList<String>();
>>>
>>>      private List<ConfiguredService> targetConfiguredServices =  
>>> new ArrayList<ConfiguredService>();
>>>
>>>      protected ConfiguredReferenceImpl() {
>>>      }
>>> -
>>> -    public String getName() {
>>> -        return name;
>>> -    }
>>> -
>>> -    public void setName(String name) {
>>> -        this.name = name;
>>> -    }
>>> -
>>> +
>>>      public List<String> getTargets() {
>>>          return targets;
>>>      }
>>>
>>> -    /**
>>> -     * @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#getTargetConfi 
>>> guredServices()
>>> -     */
>>>      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);
>>> -        targets = Collections.unmodifiableList(targets);
>>> +        targetConfiguredServices = freeze 
>>> (targetConfiguredServices);
>>> +        targets = freeze(targets);
>>>      }
>>>
>>>  }
>>>
>>> Modified: incubator/tuscany/java/sca/model/src/main/java/org/ 
>>> apache/tuscany/model/assembly/impl/ConfiguredServiceImpl.java
>>> URL: http://svn.apache.org/viewcvs/incubator/tuscany/java/sca/ 
>>> model/src/main/java/org/apache/tuscany/model/assembly/impl/ 
>>> ConfiguredServiceImpl.java?rev=393677&r1=393676&r2=393677&view=diff
>>> ==================================================================== 
>>> ==========
>>> --- incubator/tuscany/java/sca/model/src/main/java/org/apache/ 
>>> tuscany/model/assembly/impl/ConfiguredServiceImpl.java (original)
>>> +++ incubator/tuscany/java/sca/model/src/main/java/org/apache/ 
>>> tuscany/model/assembly/impl/ConfiguredServiceImpl.java Wed Apr 12  
>>> 18:03:55 2006
>>> @@ -22,27 +22,9 @@
>>>  /**
>>>   * An implementation of ConfiguredService.
>>>   */
>>> -public class ConfiguredServiceImpl extends ConfiguredPortImpl  
>>> implements ConfiguredService {
>>> +public class ConfiguredServiceImpl extends  
>>> ConfiguredPortImpl<Service> 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);
>>>      }
>>>
>>>  }
>>>
>>> Modified: incubator/tuscany/java/sca/model/src/main/java/org/ 
>>> apache/tuscany/model/assembly/impl/EntryPointImpl.java
>>> URL: http://svn.apache.org/viewcvs/incubator/tuscany/java/sca/ 
>>> model/src/main/java/org/apache/tuscany/model/assembly/impl/ 
>>> EntryPointImpl.java?rev=393677&r1=393676&r2=393677&view=diff
>>> ==================================================================== 
>>> ==========
>>> --- incubator/tuscany/java/sca/model/src/main/java/org/apache/ 
>>> tuscany/model/assembly/impl/EntryPointImpl.java (original)
>>> +++ incubator/tuscany/java/sca/model/src/main/java/org/apache/ 
>>> tuscany/model/assembly/impl/EntryPointImpl.java Wed Apr 12  
>>> 18:03:55 2006
>>> @@ -17,11 +17,10 @@
>>>  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.AssemblyContext;
>>> +import org.apache.tuscany.model.assembly.AssemblyVisitor;
>>>  import org.apache.tuscany.model.assembly.Binding;
>>>  import org.apache.tuscany.model.assembly.ConfiguredReference;
>>>  import org.apache.tuscany.model.assembly.ConfiguredService;
>>> @@ -30,70 +29,49 @@
>>>  /**
>>>   * An implementation of EntryPoint.
>>>   */
>>> -public class EntryPointImpl extends AggregatePartImpl implements  
>>> EntryPoint {
>>> +public class EntryPointImpl extends PartImpl 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();
>>> +        configuredReference.setPart(this);
>>>          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();
>>> +        configuredService.setPart(this);
>>>          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) {
>>> +
>>> +    public void initialize(AssemblyContext modelContext) {
>>>          if (isInitialized())
>>>              return;
>>>          super.initialize(modelContext);
>>>
>>>          // Initialize the service contract and reference to the  
>>> published service
>>>          if (configuredReference != null) {
>>> -            ((ConfiguredPortImpl) 
>>> configuredReference).setAggregatePart(this);
>>>              configuredReference.initialize(modelContext);
>>>          }
>>>          if (configuredService != null) {
>>> -            ((ConfiguredPortImpl) 
>>> configuredService).setAggregatePart(this);
>>>              configuredService.initialize(modelContext);
>>>          }
>>>
>>> @@ -101,9 +79,6 @@
>>>          initialize(bindings, modelContext);
>>>      }
>>>
>>> -    /**
>>> -     * @see  
>>> org.apache.tuscany.model.assembly.AssemblyModelObject#freeze()
>>> -     */
>>>      public void freeze() {
>>>          if (isFrozen())
>>>              return;
>>> @@ -116,14 +91,10 @@
>>>              configuredService.freeze();
>>>
>>>          // Freeze the bindings
>>> -        bindings=Collections.unmodifiableList(bindings);
>>> -        freeze(bindings);
>>> +        bindings=freeze(bindings);
>>>      }
>>>
>>> -    /**
>>> -     * @see  
>>> org.apache.tuscany.model.assembly.impl.AssemblyModelObjectImpl#accep 
>>> t(org.apache.tuscany.model.assembly.AssemblyModelVisitor)
>>> -     */
>>> -    public boolean accept(AssemblyModelVisitor visitor) {
>>> +    public boolean accept(AssemblyVisitor visitor) {
>>>          if (!super.accept(visitor))
>>>              return false;
>>>
>>>
>>> Modified: incubator/tuscany/java/sca/model/src/main/java/org/ 
>>> apache/tuscany/model/assembly/impl/ExtensibleImpl.java
>>> URL: http://svn.apache.org/viewcvs/incubator/tuscany/java/sca/ 
>>> model/src/main/java/org/apache/tuscany/model/assembly/impl/ 
>>> ExtensibleImpl.java?rev=393677&r1=393676&r2=393677&view=diff
>>> ==================================================================== 
>>> ==========
>>> --- incubator/tuscany/java/sca/model/src/main/java/org/apache/ 
>>> tuscany/model/assembly/impl/ExtensibleImpl.java (original)
>>> +++ incubator/tuscany/java/sca/model/src/main/java/org/apache/ 
>>> tuscany/model/assembly/impl/ExtensibleImpl.java Wed Apr 12  
>>> 18:03:55 2006
>>> @@ -19,42 +19,30 @@
>>>  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.AssemblyContext;
>>> +import org.apache.tuscany.model.assembly.AssemblyVisitor;
>>>  import org.apache.tuscany.model.assembly.Extensible;
>>>
>>>  /**
>>>   * An implementation of Extensible.
>>>   */
>>> -public abstract class ExtensibleImpl extends  
>>> AssemblyModelObjectImpl implements Extensible {
>>> +public abstract class ExtensibleImpl extends AssemblyObjectImpl  
>>> 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#getExtensibilityElement 
>>> s()
>>> -     */
>>>      public List getExtensibilityElements() {
>>>          return extensibilityElements;
>>>      }
>>>
>>> -    /**
>>> -     * @see  
>>> org.apache.tuscany.model.assembly.Extensible#getExtensibilityAttribu 
>>> tes()
>>> -     */
>>>      public List getExtensibilityAttributes() {
>>>          return extensibilityAttributes;
>>>      }
>>>
>>> -    /**
>>> -     * @see  
>>> org.apache.tuscany.model.assembly.AssemblyModelObject#initialize 
>>> (org.apache.tuscany.model.assembly.AssemblyModelContext)
>>> -     */
>>> -    public void initialize(AssemblyModelContext modelContext) {
>>> +    public void initialize(AssemblyContext modelContext) {
>>>          if (isInitialized())
>>>              return;
>>>          super.initialize(modelContext);
>>> @@ -74,10 +62,7 @@
>>>          freeze(extensibilityAttributes);
>>>      }
>>>
>>> -    /**
>>> -     * @see  
>>> org.apache.tuscany.model.assembly.impl.AssemblyModelObjectImpl#accep 
>>> t(org.apache.tuscany.model.assembly.AssemblyModelVisitor)
>>> -     */
>>> -    public boolean accept(AssemblyModelVisitor visitor) {
>>> +    public boolean accept(AssemblyVisitor visitor) {
>>>          if (!super.accept(visitor))
>>>              return false;
>>>
>>>
>>> Modified: incubator/tuscany/java/sca/model/src/main/java/org/ 
>>> apache/tuscany/model/assembly/impl/ExternalServiceImpl.java
>>> URL: http://svn.apache.org/viewcvs/incubator/tuscany/java/sca/ 
>>> model/src/main/java/org/apache/tuscany/model/assembly/impl/ 
>>> ExternalServiceImpl.java?rev=393677&r1=393676&r2=393677&view=diff
>>> ==================================================================== 
>>> ==========
>>> --- incubator/tuscany/java/sca/model/src/main/java/org/apache/ 
>>> tuscany/model/assembly/impl/ExternalServiceImpl.java (original)
>>> +++ incubator/tuscany/java/sca/model/src/main/java/org/apache/ 
>>> tuscany/model/assembly/impl/ExternalServiceImpl.java Wed Apr 12  
>>> 18:03:55 2006
>>> @@ -17,11 +17,10 @@
>>>  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.AssemblyContext;
>>> +import org.apache.tuscany.model.assembly.AssemblyVisitor;
>>>  import org.apache.tuscany.model.assembly.Binding;
>>>  import org.apache.tuscany.model.assembly.ConfiguredService;
>>>  import org.apache.tuscany.model.assembly.ExternalService;
>>> @@ -30,66 +29,55 @@
>>>  /**
>>>   * An implementation ExternalService.
>>>   */
>>> -public class ExternalServiceImpl extends AggregatePartImpl  
>>> implements ExternalService {
>>> +public class ExternalServiceImpl extends PartImpl implements  
>>> ExternalService {
>>>
>>>      private ConfiguredService configuredService;
>>>      private OverrideOption overrideOption;
>>>      private List<Binding> bindings=new ArrayList<Binding>();
>>> +
>>> +    private Object contextFactory;
>>>
>>> -    /**
>>> -     * Constructor
>>> -     */
>>>      protected ExternalServiceImpl() {
>>>      }
>>>
>>> -    /**
>>> -     * @see  
>>> org.apache.tuscany.model.assembly.sdo.impl.ExternalServiceImpl#getOv 
>>> errideOption()
>>> -     */
>>>      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#getConfiguredServi 
>>> ce()
>>> -     */
>>>      public ConfiguredService getConfiguredService() {
>>>          return configuredService;
>>>      }
>>>
>>> -    /**
>>> -     * @see  
>>> org.apache.tuscany.model.assembly.ExternalService#setConfiguredServi 
>>> ce(org.apache.tuscany.model.assembly.ConfiguredService)
>>> -     */
>>>      public void setConfiguredService(ConfiguredService  
>>> configuredService) {
>>>          checkNotFrozen();
>>> +        configuredService.setPart(this);
>>>          this.configuredService=configuredService;
>>>      }
>>> +
>>> +    public Object getContextFactory() {
>>> +        return contextFactory;
>>> +    }
>>> +
>>> +    public void setContextFactory(Object contextFactory) {
>>> +        this.contextFactory=contextFactory;
>>> +    }
>>>
>>> -    /**
>>> -     * @see  
>>> org.apache.tuscany.model.assembly.AssemblyModelObject#initialize 
>>> (org.apache.tuscany.model.assembly.AssemblyModelContext)
>>> -     */
>>> -    public void initialize(AssemblyModelContext modelContext) {
>>> +    public void initialize(AssemblyContext modelContext) {
>>>          if (isInitialized())
>>>              return;
>>>          super.initialize(modelContext);
>>>
>>>          // Initialize the configured service
>>>          if (configuredService != null) {
>>> -            ((ConfiguredPortImpl) 
>>> configuredService).setAggregatePart(this);
>>>              configuredService.initialize(modelContext);
>>>          }
>>>
>>> @@ -97,9 +85,6 @@
>>>          initialize(bindings, modelContext);
>>>      }
>>>
>>> -    /**
>>> -     * @see  
>>> org.apache.tuscany.model.assembly.AssemblyModelObject#freeze()
>>> -     */
>>>      public void freeze() {
>>>          if (isFrozen())
>>>              return;
>>> @@ -110,14 +95,10 @@
>>>              configuredService.freeze();
>>>
>>>          // Freeze the bindings
>>> -        bindings=Collections.unmodifiableList(bindings);
>>> -        freeze(bindings);
>>> +        bindings=freeze(bindings);
>>>      }
>>>
>>> -    /**
>>> -     * @see  
>>> org.apache.tuscany.model.assembly.impl.ExtensibleImpl#accept 
>>> (org.apache.tuscany.model.assembly.AssemblyModelVisitor)
>>> -     */
>>> -    public boolean accept(AssemblyModelVisitor visitor) {
>>> +    public boolean accept(AssemblyVisitor visitor) {
>>>          if (!super.accept(visitor))
>>>              return false;
>>>
>>>
>>>
>>>
>>>
>>
>>
>>
>
> -- 
> Jean-Sebastien
>
>


Re: Fwd: svn commit: r393677 [5/6] - in /incubator/tuscany/java/sca: bindings/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/assembly/impl/ bindings/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/builder/ bindings/binding.axis2/src/m...

Posted by Jean-Sebastien Delfino <js...@apache.org>.
Jim,

Yes, usually we should have smaller commits but this one was tricky 
since I needed to have the complete model in place in the sandbox first 
to allow people to review it. So in an attempt to start a new trend with 
smaller commits, I'm about to do probably one of the smallest commits, 
adding a OneWay annotation to the spec project to support the SCA async 
programming model :)


Jim Marino wrote:
> So I think Sebastien hold the record for largest commit - 6 parts ;-) 
> I tried but could only get up to 4!
>
> Jim
>
>
>
> Begin forwarded message:
>
>> From: jsdelfino@apache.org
>> Date: April 12, 2006 6:04:14 PM PDT
>> To: tuscany-commits@ws.apache.org
>> Subject: svn commit: r393677 [5/6] - in /incubator/tuscany/java/sca: 
>> bindings/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/assembly/impl/ 
>> bindings/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/builder/ 
>> bindings/binding.axis2/src/m...
>> Reply-To: tuscany-dev@ws.apache.org
>>
>>
>> Modified: 
>> incubator/tuscany/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/Port.java 
>>
>> URL: 
>> http://svn.apache.org/viewcvs/incubator/tuscany/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/Port.java?rev=393677&r1=393676&r2=393677&view=diff 
>>
>> ============================================================================== 
>>
>> --- 
>> incubator/tuscany/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/Port.java 
>> (original)
>> +++ 
>> incubator/tuscany/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/Port.java 
>> Wed Apr 12 18:03:55 2006
>> @@ -19,7 +19,7 @@
>>  /**
>>   * Abstraction for the association of a service contract with a 
>> requestor or provider.
>>   */
>> -public interface Port extends AssemblyModelObject {
>> +public interface Port extends AssemblyObject {
>>      /**
>>       * Returns the contract for invocations of a service using this 
>> port.
>>       * @return the oontract for invocations of a service using this 
>> port
>>
>> Added: 
>> incubator/tuscany/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/ProxyFactoryHolder.java 
>>
>> URL: 
>> http://svn.apache.org/viewcvs/incubator/tuscany/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/ProxyFactoryHolder.java?rev=393677&view=auto 
>>
>> ============================================================================== 
>>
>> --- 
>> incubator/tuscany/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/ProxyFactoryHolder.java 
>> (added)
>> +++ 
>> incubator/tuscany/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/ProxyFactoryHolder.java 
>> Wed Apr 12 18:03:55 2006
>> @@ -0,0 +1,34 @@
>> +/**
>> + *
>> + *  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;
>> +
>> +/**
>> + * A model object that can hold a runtime proxy factory object.
>> + */
>> +public interface ProxyFactoryHolder {
>> +
>> +    /**
>> +     * Sets the proxy factory
>> +     */
>> +    void setProxyFactory(Object proxyFactory);
>> +
>> +    /**
>> +     * Returns the proxy factory
>> +     */
>> +    Object getProxyFactory();
>> +
>> +}
>>
>> Propchange: 
>> incubator/tuscany/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/ProxyFactoryHolder.java 
>>
>> ------------------------------------------------------------------------------ 
>>
>>     svn:eol-style = native
>>
>> Propchange: 
>> incubator/tuscany/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/ProxyFactoryHolder.java 
>>
>> ------------------------------------------------------------------------------ 
>>
>>     svn:keywords = Rev,Date
>>
>> Modified: 
>> incubator/tuscany/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/ServiceContract.java 
>>
>> URL: 
>> http://svn.apache.org/viewcvs/incubator/tuscany/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/ServiceContract.java?rev=393677&r1=393676&r2=393677&view=diff 
>>
>> ============================================================================== 
>>
>> --- 
>> incubator/tuscany/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/ServiceContract.java 
>> (original)
>> +++ 
>> incubator/tuscany/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/ServiceContract.java 
>> Wed Apr 12 18:03:55 2006
>> @@ -48,14 +48,12 @@
>>      /**
>>       * Returns the scope of this service contract.
>>       * @return
>> -     * todo missing javadoc
>>       */
>>      Scope getScope();
>>
>>      /**
>>       * Sets the scope.
>>       * @param scope of this service contract.
>> -     * todo missing javadoc
>>       */
>>      void setScope(Scope scope);
>>
>>
>> Modified: 
>> incubator/tuscany/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/Subsystem.java 
>>
>> URL: 
>> http://svn.apache.org/viewcvs/incubator/tuscany/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/Subsystem.java?rev=393677&r1=393676&r2=393677&view=diff 
>>
>> ============================================================================== 
>>
>> --- 
>> incubator/tuscany/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/Subsystem.java 
>> (original)
>> +++ 
>> incubator/tuscany/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/Subsystem.java 
>> Wed Apr 12 18:03:55 2006
>> @@ -21,7 +21,7 @@
>>  /**
>>   * Represents a subsystem.
>>   */
>> -public interface Subsystem extends Aggregate {
>> +public interface Subsystem extends Composite {
>>
>>      /**
>>       * Returns the subsystem uri.
>>
>> Added: 
>> incubator/tuscany/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/AssemblyContextImpl.java 
>>
>> URL: 
>> http://svn.apache.org/viewcvs/incubator/tuscany/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/AssemblyContextImpl.java?rev=393677&view=auto 
>>
>> ============================================================================== 
>>
>> --- 
>> incubator/tuscany/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/AssemblyContextImpl.java 
>> (added)
>> +++ 
>> incubator/tuscany/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/AssemblyContextImpl.java 
>> Wed Apr 12 18:03:55 2006
>> @@ -0,0 +1,75 @@
>> +/**
>> + *
>> + *  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.common.resource.ResourceLoader;
>> +import org.apache.tuscany.model.assembly.AssemblyFactory;
>> +import org.apache.tuscany.model.assembly.AssemblyContext;
>> +import org.apache.tuscany.model.assembly.loader.AssemblyModelLoader;
>> +import org.apache.tuscany.sdo.util.SDOUtil;
>> +
>> +import commonj.sdo.helper.TypeHelper;
>> +
>> +/**
>> + */
>> +public class AssemblyContextImpl implements AssemblyContext {
>> +
>> +    private final AssemblyFactory assemblyFactory;
>> +    private final AssemblyModelLoader assemblyLoader;
>> +    private final ResourceLoader applicationResourceLoader;
>> +    private final TypeHelper typeHelper;
>> +
>> +    public AssemblyContextImpl(AssemblyModelLoader assemblyLoader, 
>> ResourceLoader resourceLoader) {
>> +        this(new AssemblyFactoryImpl(), assemblyLoader, 
>> resourceLoader);
>> +    }
>> +
>> +    public AssemblyContextImpl(AssemblyFactory assemblyFactory, 
>> AssemblyModelLoader assemblyLoader, ResourceLoader artifactLoader) {
>> +        this(assemblyFactory, assemblyLoader, artifactLoader, 
>> SDOUtil.createTypeHelper());
>> +    }
>> +
>> +    public AssemblyContextImpl(AssemblyFactory assemblyFactory, 
>> AssemblyModelLoader assemblyLoader, ResourceLoader artifactLoader, 
>> TypeHelper typeHelper) {
>> +        this.assemblyFactory = assemblyFactory;
>> +        this.assemblyLoader = assemblyLoader;
>> +        this.applicationResourceLoader = artifactLoader;
>> +        this.typeHelper=typeHelper;
>> +    }
>> +
>> +    /**
>> +     * @see 
>> org.apache.tuscany.model.assembly.AssemblyContext#getAssemblyFactory()
>> +     */
>> +    public AssemblyFactory getAssemblyFactory() {
>> +        return assemblyFactory;
>> +    }
>> +
>> +    public ResourceLoader getApplicationResourceLoader() {
>> +        return applicationResourceLoader;
>> +    }
>> +
>> +    /**
>> +     * @see 
>> org.apache.tuscany.model.assembly.AssemblyContext#getAssemblyLoader()
>> +     */
>> +    public AssemblyModelLoader getAssemblyLoader() {
>> +        return assemblyLoader;
>> +    }
>> +
>> +    /**
>> +     * @see 
>> org.apache.tuscany.model.assembly.AssemblyContext#getTypeHelper()
>> +     */
>> +    public TypeHelper getTypeHelper() {
>> +        return typeHelper;
>> +    }
>> +}
>>
>> Propchange: 
>> incubator/tuscany/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/AssemblyContextImpl.java 
>>
>> ------------------------------------------------------------------------------ 
>>
>>     svn:eol-style = native
>>
>> Propchange: 
>> incubator/tuscany/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/AssemblyContextImpl.java 
>>
>> ------------------------------------------------------------------------------ 
>>
>>     svn:keywords = Rev,Date
>>
>> Modified: 
>> incubator/tuscany/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/AssemblyFactoryImpl.java 
>>
>> URL: 
>> http://svn.apache.org/viewcvs/incubator/tuscany/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/AssemblyFactoryImpl.java?rev=393677&r1=393676&r2=393677&view=diff 
>>
>> ============================================================================== 
>>
>> --- 
>> incubator/tuscany/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/AssemblyFactoryImpl.java 
>> (original)
>> +++ 
>> incubator/tuscany/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/AssemblyFactoryImpl.java 
>> Wed Apr 12 18:03:55 2006
>> @@ -18,9 +18,9 @@
>>
>>  import javax.xml.namespace.QName;
>>
>> -import org.apache.tuscany.model.assembly.AggregatePart;
>> +import org.apache.tuscany.model.assembly.Part;
>>  import org.apache.tuscany.model.assembly.AssemblyFactory;
>> -import org.apache.tuscany.model.assembly.ComponentType;
>> +import org.apache.tuscany.model.assembly.ComponentInfo;
>>  import org.apache.tuscany.model.assembly.ConfiguredPort;
>>  import org.apache.tuscany.model.assembly.ConfiguredProperty;
>>  import org.apache.tuscany.model.assembly.ConfiguredReference;
>> @@ -35,7 +35,7 @@
>>  import org.apache.tuscany.model.assembly.Reference;
>>  import org.apache.tuscany.model.assembly.Service;
>>  import org.apache.tuscany.model.assembly.ServiceURI;
>> -import org.apache.tuscany.model.assembly.SimpleComponent;
>> +import org.apache.tuscany.model.assembly.AtomicComponent;
>>  import org.apache.tuscany.model.assembly.Subsystem;
>>  import org.apache.tuscany.model.assembly.Wire;
>>  import org.apache.tuscany.model.assembly.Binding;
>> @@ -58,150 +58,87 @@
>>          super();
>>      }
>>
>> -    /**
>> -     * @see 
>> org.apache.tuscany.model.assembly.AssemblyFactory#createSimpleComponent() 
>>
>> -     */
>> -    public SimpleComponent createSimpleComponent() {
>> -        return new SimpleComponentImpl();
>> +    public AtomicComponent createSimpleComponent() {
>> +        return new AtomicComponentImpl();
>>      }
>>
>> -    /**
>> -     * @see 
>> org.apache.tuscany.model.assembly.AssemblyFactory#createComponentType()
>> -     */
>> -    public ComponentType createComponentType() {
>> -        return new ComponentTypeImpl();
>> +    public ComponentInfo createComponentInfo() {
>> +        return new ComponentInfoImpl();
>>      }
>>
>> -    /**
>> -     * @see 
>> org.apache.tuscany.model.assembly.AssemblyFactory#createEntryPoint()
>> -     */
>>      public EntryPoint createEntryPoint() {
>>          return new EntryPointImpl();
>>      }
>>
>> -    /**
>> -     * @see 
>> org.apache.tuscany.model.assembly.AssemblyFactory#createExternalService() 
>>
>> -     */
>>      public ExternalService createExternalService() {
>>          return new ExternalServiceImpl();
>>      }
>>
>> -    /**
>> -     * @see 
>> org.apache.tuscany.model.assembly.AssemblyFactory#createJavaServiceContract() 
>>
>> -     */
>>      public JavaServiceContract createJavaServiceContract() {
>>          return new JavaServiceContractImpl();
>>      }
>>
>> -    /**
>> -     * @see 
>> org.apache.tuscany.model.assembly.AssemblyFactory#createModule()
>> -     */
>>      public Module createModule() {
>>          return new ModuleImpl();
>>      }
>>
>> -    /**
>> -     * @see 
>> org.apache.tuscany.model.assembly.AssemblyFactory#createModuleFragment()
>> -     */
>>      public ModuleFragment createModuleFragment() {
>>          return new ModuleFragmentImpl();
>>      }
>>
>> -    /**
>> -     * @see 
>> org.apache.tuscany.model.assembly.AssemblyFactory#createModuleComponent() 
>>
>> -     */
>>      public ModuleComponent createModuleComponent() {
>>          return new ModuleComponentImpl();
>>      }
>>
>> -    /**
>> -     * @see 
>> org.apache.tuscany.model.assembly.AssemblyFactory#createProperty()
>> -     */
>>      public Property createProperty() {
>>          return new PropertyImpl();
>>      }
>>
>> -    /**
>> -     * @see 
>> org.apache.tuscany.model.assembly.AssemblyFactory#createConfiguredProperty() 
>>
>> -     */
>>      public ConfiguredProperty createConfiguredProperty() {
>>          return new ConfiguredPropertyImpl();
>>      }
>>
>> -    /**
>> -     * @see 
>> org.apache.tuscany.model.assembly.AssemblyFactory#createReference()
>> -     */
>>      public Reference createReference() {
>>          return new ReferenceImpl();
>>      }
>>
>> -    /**
>> -     * @see 
>> org.apache.tuscany.model.assembly.AssemblyFactory#createConfiguredReference() 
>>
>> -     */
>>      public ConfiguredReference createConfiguredReference() {
>>          return new ConfiguredReferenceImpl();
>>      }
>>
>> -    /**
>> -     * @see 
>> org.apache.tuscany.model.assembly.AssemblyFactory#createService()
>> -     */
>>      public Service createService() {
>>          return new ServiceImpl();
>>      }
>>
>> -    /**
>> -     * @see 
>> org.apache.tuscany.model.assembly.AssemblyFactory#createConfiguredService() 
>>
>> -     */
>>      public ConfiguredService createConfiguredService() {
>>          return new ConfiguredServiceImpl();
>>      }
>>
>> -    /**
>> -     * @see 
>> org.apache.tuscany.model.assembly.AssemblyFactory#createSubsystem()
>> -     */
>>      public Subsystem createSubsystem() {
>>          return new SubsystemImpl();
>>      }
>>
>> -    /**
>> -     * @see 
>> org.apache.tuscany.model.assembly.AssemblyFactory#createWSDLServiceContract() 
>>
>> -     */
>>      public WSDLServiceContract createWSDLServiceContract() {
>>          return new WSDLServiceContractImpl();
>>      }
>>
>> -    /**
>> -     * @see 
>> org.apache.tuscany.model.assembly.AssemblyFactory#createServiceURI(java.lang.String) 
>>
>> -     */
>>      public ServiceURI createServiceURI(String uri) {
>>          return new ServiceURIImpl(uri);
>>      }
>>
>> -    /**
>> -     * @see 
>> org.apache.tuscany.model.assembly.AssemblyFactory#createServiceURI(org.apache.tuscany.model.assembly.ModuleComponent, 
>> java.lang.String)
>> -     */
>>      public ServiceURI createServiceURI(ModuleComponent 
>> moduleComponent, String serviceName) {
>>          return new ServiceURIImpl(moduleComponent, serviceName);
>>      }
>>
>> -    /*
>> -     * @see 
>> org.apache.tuscany.model.assembly.AssemblyFactory#createServiceURI(org.apache.tuscany.model.assembly.ModuleComponent, 
>> org.apache.tuscany.model.assembly.AggregatePart, 
>> org.apache.tuscany.model.assembly.ConfiguredPort)
>> -     */
>> -    public ServiceURI createServiceURI(ModuleComponent 
>> moduleComponent, AggregatePart aggregatePart, ConfiguredPort 
>> configuredPort) {
>> +    public ServiceURI createServiceURI(ModuleComponent 
>> moduleComponent, Part aggregatePart, ConfiguredPort configuredPort) {
>>          return new ServiceURIImpl(moduleComponent, aggregatePart, 
>> configuredPort);
>>      }
>>
>> -    /**
>> -     * @see 
>> org.apache.tuscany.model.assembly.AssemblyFactory#createQName(java.lang.String) 
>>
>> -     */
>>      public QName createQName(String uri) {
>>          int h = uri.indexOf('#');
>>          return new QName(uri.substring(0, h), uri.substring(h + 1));
>>      }
>>
>> -    /**
>> -     * @see 
>> org.apache.tuscany.model.assembly.AssemblyFactory#createWire()
>> -     */
>>      public Wire createWire() {
>>          return new WireImpl();
>>      }
>> @@ -235,13 +172,13 @@
>>          service.setName(entryPointName);
>>          service.setServiceContract(serviceContract);
>>          ConfiguredService configuredService = 
>> createConfiguredService();
>> -        configuredService.setService(service);
>> +        configuredService.setPort(service);
>>
>>          // create and configure a reference to target
>>          Reference reference = createReference();
>>          reference.setMultiplicity(Multiplicity.ONE_ONE);
>>          ConfiguredReference configuredReference = 
>> createConfiguredReference(null, targetName);
>> -        configuredReference.setReference(reference);
>> +        configuredReference.setPort(reference);
>>
>>          return createEntryPoint(entryPointName, configuredService, 
>> binding, configuredReference);
>>      }
>>
>> Added: 
>> incubator/tuscany/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/AssemblyObjectImpl.java 
>>
>> URL: 
>> http://svn.apache.org/viewcvs/incubator/tuscany/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/AssemblyObjectImpl.java?rev=393677&view=auto 
>>
>> ============================================================================== 
>>
>> --- 
>> incubator/tuscany/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/AssemblyObjectImpl.java 
>> (added)
>> +++ 
>> incubator/tuscany/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/AssemblyObjectImpl.java 
>> Wed Apr 12 18:03:55 2006
>> @@ -0,0 +1,124 @@
>> +/**
>> + *
>> + *  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.Collection;
>> +import java.util.Collections;
>> +import java.util.List;
>> +
>> +import org.apache.tuscany.model.assembly.AssemblyContext;
>> +import org.apache.tuscany.model.assembly.AssemblyObject;
>> +import org.apache.tuscany.model.assembly.AssemblyVisitor;
>> +
>> +/**
>> + * A base class for assembly model objects.
>> + */
>> +public abstract class AssemblyObjectImpl implements AssemblyObject {
>> +
>> +    private boolean frozen;
>> +    private boolean initialized;
>> +
>> +    protected AssemblyObjectImpl() {
>> +    }
>> +
>> +    public boolean accept(AssemblyVisitor visitor) {
>> +        return visitor.visit(this);
>> +    }
>> +
>> +    /**
>> +     * Walk a visitor through a collection of model objects.
>> +     * @param collection
>> +     * @param visitor
>> +     * @return
>> +     */
>> +    protected boolean accept(Collection collection, AssemblyVisitor 
>> visitor) {
>> +        for (Object member : collection) {
>> +            if (member instanceof AssemblyObject) {
>> +                if (!((AssemblyObject)member).accept(visitor))
>> +                    return false;
>> +            }
>> +        }
>> +        return true;
>> +    }
>> +
>> +    public void freeze() {
>> +        if (!frozen)
>> +            frozen=true;
>> +    }
>> +
>> +    /**
>> +     * Returns true if the object is frozen
>> +     */
>> +    protected boolean isFrozen() {
>> +        return frozen;
>> +    }
>> +
>> +    /**
>> +     * Freeze a list and its members
>> +     */
>> +    protected <T> List<T> freeze(List<T> list) {
>> +        list=Collections.unmodifiableList(list);
>> +        for (Object member : list) {
>> +            if (member instanceof AssemblyObject) {
>> +                ((AssemblyObject)member).freeze();
>> +            }
>> +        }
>> +        return list;
>> +    }
>> +
>> +    /**
>> +     * Check that the current model object can be modified.
>> +     * @throws IllegalStateException
>> +     */
>> +    protected void checkNotFrozen() {
>> +        if (frozen)
>> +            throw new IllegalStateException("Attempt to modify a 
>> frozen assembly model");
>> +    }
>> +
>> +    public void initialize(AssemblyContext modelContext) {
>> +        if (!initialized)
>> +            initialized=true;
>> +    }
>> +
>> +    /**
>> +     * Returns true if the object is initialized
>> +     */
>> +    protected boolean isInitialized() {
>> +        return initialized;
>> +    }
>> +
>> +    /**
>> +     * Initialize members of a collection
>> +     */
>> +    protected void initialize(Collection collection, AssemblyContext 
>> modelContext) {
>> +        for (Object member : collection) {
>> +            if (member instanceof AssemblyObject) {
>> +                ((AssemblyObject)member).initialize(modelContext);
>> +            }
>> +        }
>> +    }
>> +
>> +    /**
>> +     * Check that the current model object is initialized.
>> +     * @throws IllegalStateException
>> +     */
>> +    protected void checkInitialized() {
>> +        if (!initialized)
>> +            throw new IllegalStateException("Attempt to use an 
>> uninitialized assembly model");
>> +    }
>> +
>> +}
>>
>> Propchange: 
>> incubator/tuscany/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/AssemblyObjectImpl.java 
>>
>> ------------------------------------------------------------------------------ 
>>
>>     svn:eol-style = native
>>
>> Propchange: 
>> incubator/tuscany/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/AssemblyObjectImpl.java 
>>
>> ------------------------------------------------------------------------------ 
>>
>>     svn:keywords = Rev,Date
>>
>> Added: 
>> incubator/tuscany/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/AtomicComponentImpl.java 
>>
>> URL: 
>> http://svn.apache.org/viewcvs/incubator/tuscany/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/AtomicComponentImpl.java?rev=393677&view=auto 
>>
>> ============================================================================== 
>>
>> --- 
>> incubator/tuscany/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/AtomicComponentImpl.java 
>> (added)
>> +++ 
>> incubator/tuscany/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/AtomicComponentImpl.java 
>> Wed Apr 12 18:03:55 2006
>> @@ -0,0 +1,30 @@
>> +/**
>> + *
>> + *  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.AtomicComponent;
>> +import org.apache.tuscany.model.assembly.AtomicImplementation;
>> +
>> +/**
>> + * An implementation of AtomicComponent.
>> + */
>> +public class AtomicComponentImpl extends 
>> ComponentImpl<AtomicImplementation> implements AtomicComponent {
>> +
>> +    protected AtomicComponentImpl() {
>> +    }
>> +
>> +}
>>
>> Propchange: 
>> incubator/tuscany/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/AtomicComponentImpl.java 
>>
>> ------------------------------------------------------------------------------ 
>>
>>     svn:eol-style = native
>>
>> Propchange: 
>> incubator/tuscany/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/AtomicComponentImpl.java 
>>
>> ------------------------------------------------------------------------------ 
>>
>>     svn:keywords = Rev,Date
>>
>> Added: 
>> incubator/tuscany/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/AtomicImplementationImpl.java 
>>
>> URL: 
>> http://svn.apache.org/viewcvs/incubator/tuscany/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/AtomicImplementationImpl.java?rev=393677&view=auto 
>>
>> ============================================================================== 
>>
>> --- 
>> incubator/tuscany/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/AtomicImplementationImpl.java 
>> (added)
>> +++ 
>> incubator/tuscany/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/AtomicImplementationImpl.java 
>> Wed Apr 12 18:03:55 2006
>> @@ -0,0 +1,29 @@
>> +/**
>> + *
>> + *  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.AtomicImplementation;
>> +
>> +/**
>> + * An implementation of AtomicImplementation.
>> + */
>> +public abstract class AtomicImplementationImpl extends 
>> ImplementationImpl implements AtomicImplementation {
>> +
>> +    protected AtomicImplementationImpl() {
>> +    }
>> +
>> +}
>>
>> Propchange: 
>> incubator/tuscany/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/AtomicImplementationImpl.java 
>>
>> ------------------------------------------------------------------------------ 
>>
>>     svn:eol-style = native
>>
>> Propchange: 
>> incubator/tuscany/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/AtomicImplementationImpl.java 
>>
>> ------------------------------------------------------------------------------ 
>>
>>     svn:keywords = Rev,Date
>>
>> Modified: 
>> incubator/tuscany/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/BindingImpl.java 
>>
>> URL: 
>> http://svn.apache.org/viewcvs/incubator/tuscany/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/BindingImpl.java?rev=393677&r1=393676&r2=393677&view=diff 
>>
>> ============================================================================== 
>>
>> --- 
>> incubator/tuscany/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/BindingImpl.java 
>> (original)
>> +++ 
>> incubator/tuscany/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/BindingImpl.java 
>> Wed Apr 12 18:03:55 2006
>> @@ -16,8 +16,8 @@
>>   */
>>  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.AssemblyContext;
>> +import org.apache.tuscany.model.assembly.AssemblyVisitor;
>>  import org.apache.tuscany.model.assembly.Binding;
>>
>>  /**
>> @@ -26,41 +26,25 @@
>>  public class BindingImpl extends ExtensibleImpl implements Binding {
>>
>>      private String uri;
>> -    private Object contextFactory;
>>
>> -    /**
>> -     * Constructor
>> -     */
>>      protected BindingImpl() {
>>      }
>>
>> -    /**
>> -     * @see org.apache.tuscany.model.assembly.Binding#getURI()
>> -     */
>>      public String getURI() {
>>          return uri;
>>      }
>>
>> -    /**
>> -     * @see 
>> org.apache.tuscany.model.assembly.Binding#setURI(java.lang.String)
>> -     */
>>      public void setURI(String value) {
>>          checkNotFrozen();
>>          uri=value;
>>      }
>>
>> -    /**
>> -     * @see 
>> org.apache.tuscany.model.assembly.AssemblyModelObject#initialize(org.apache.tuscany.model.assembly.AssemblyModelContext) 
>>
>> -     */
>> -    public void initialize(AssemblyModelContext modelContext) {
>> +    public void initialize(AssemblyContext modelContext) {
>>          if (isInitialized())
>>              return;
>>          super.initialize(modelContext);
>>      }
>>
>> -    /**
>> -     * @see 
>> org.apache.tuscany.model.assembly.AssemblyModelObject#freeze()
>> -     */
>>      public void freeze() {
>>          if (isFrozen())
>>              return;
>> @@ -68,25 +52,7 @@
>>
>>      }
>>
>> -    /**
>> -     * @see 
>> org.apache.tuscany.model.assembly.ContextFactoryHolder#getContextFactory() 
>>
>> -     */
>> -    public Object getContextFactory() {
>> -        return contextFactory;
>> -    }
>> -
>> -    /**
>> -     * @see 
>> org.apache.tuscany.model.assembly.ContextFactoryHolder#setContextFactory(java.lang.Object) 
>>
>> -     */
>> -    public void setContextFactory(Object configuration) {
>> -        checkNotFrozen();
>> -        this.contextFactory = configuration;
>> -    }
>> -
>> -    /**
>> -     * @see 
>> org.apache.tuscany.model.assembly.impl.AggregateImpl#accept(org.apache.tuscany.model.assembly.AssemblyModelVisitor) 
>>
>> -     */
>> -    public boolean accept(AssemblyModelVisitor visitor) {
>> +    public boolean accept(AssemblyVisitor visitor) {
>>          if (!super.accept(visitor))
>>              return false;
>>
>>
>> Modified: 
>> incubator/tuscany/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ComponentImpl.java 
>>
>> URL: 
>> http://svn.apache.org/viewcvs/incubator/tuscany/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ComponentImpl.java?rev=393677&r1=393676&r2=393677&view=diff 
>>
>> ============================================================================== 
>>
>> --- 
>> incubator/tuscany/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ComponentImpl.java 
>> (original)
>> +++ 
>> incubator/tuscany/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ComponentImpl.java 
>> Wed Apr 12 18:03:55 2006
>> @@ -16,180 +16,194 @@
>>   */
>>  package org.apache.tuscany.model.assembly.impl;
>>
>> -import java.util.ArrayList;
>> -import java.util.Collections;
>>  import java.util.HashMap;
>>  import java.util.List;
>>  import java.util.Map;
>>
>> +import org.apache.tuscany.model.assembly.AssemblyContext;
>>  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.AssemblyInitializationException;
>> +import org.apache.tuscany.model.assembly.AssemblyVisitor;
>>  import org.apache.tuscany.model.assembly.Component;
>> -import org.apache.tuscany.model.assembly.ComponentImplementation;
>> -import org.apache.tuscany.model.assembly.ComponentType;
>> +import org.apache.tuscany.model.assembly.ComponentInfo;
>> +import org.apache.tuscany.model.assembly.ConfiguredPort;
>>  import org.apache.tuscany.model.assembly.ConfiguredProperty;
>>  import org.apache.tuscany.model.assembly.ConfiguredReference;
>>  import org.apache.tuscany.model.assembly.ConfiguredService;
>> +import org.apache.tuscany.model.assembly.Implementation;
>> +import org.apache.tuscany.model.assembly.Property;
>>  import org.apache.tuscany.model.assembly.Reference;
>>  import org.apache.tuscany.model.assembly.Service;
>> +import org.apache.tuscany.model.util.NotifyingList;
>>
>>  /**
>>   * An implementation of Component.
>>   */
>> -public abstract class ComponentImpl extends AggregatePartImpl 
>> implements Component {
>> -
>> -    private Map<String, ConfiguredReference> configuredReferencesMap 
>> = new HashMap<String, ConfiguredReference>();
>> -    private List<ConfiguredService> configuredServices = new 
>> ArrayList<ConfiguredService>();
>> -    private Map<String, ConfiguredService> configuredServicesMap;
>> -    private List<ConfiguredProperty> configuredProperties = new 
>> ArrayList<ConfiguredProperty>();
>> -    private Map<String, ConfiguredProperty> configuredPropertiesMap;
>> -    private ComponentImplementation implementation;
>> +public abstract class ComponentImpl<I extends Implementation> 
>> extends PartImpl implements Component<I> {
>>
>>      /**
>> -     * @see 
>> org.apache.tuscany.model.assembly.Component#getComponentImplementation()
>> +     * A list of configured ports synchronized with a map
>>       */
>> -    public ComponentImplementation getComponentImplementation() {
>> +    private class ConfiguredPortList<E extends ConfiguredPort> 
>> extends NotifyingList<E>{
>> +
>> +        Map<String, E> map;
>> +
>> +        private ConfiguredPortList(Map<String, E> map) {
>> +            this.map=map;
>> +        }
>> +
>> +        protected void added(E element) {
>> +            String name=element.getPort()!=null? 
>> element.getPort().getName():element.getName();
>> +            map.put(name, element);
>> +            element.setPart(ComponentImpl.this);
>> +        }
>> +        protected void removed(E element) {
>> +            String name=element.getPort()!=null? 
>> element.getPort().getName():element.getName();
>> +            map.remove(name);
>> +            element.setPart(null);
>> +        }
>> +    }
>> +
>> +    private Map<String, ConfiguredReference> configuredReferencesMap 
>> = new HashMap<String, ConfiguredReference>();
>> +    private List<ConfiguredReference> configuredReferences = new 
>> ConfiguredPortList<ConfiguredReference>(configuredReferencesMap);
>> +
>> +    private Map<String, ConfiguredService> configuredServicesMap = 
>> new HashMap<String, ConfiguredService>();
>> +    private List<ConfiguredService> configuredServices = new 
>> ConfiguredPortList<ConfiguredService>(configuredServicesMap);
>> +
>> +    /**
>> +     * A list of properties synchronized with a map
>> +     */
>> +    private class ConfiguredPropertyList<E extends 
>> ConfiguredProperty> extends NotifyingList<E>{
>> +
>> +        protected void added(E element) {
>> +            String name=element.getProperty()!=null? 
>> element.getProperty().getName():element.getName();
>> +            configuredPropertiesMap.put(name, element);
>> +        }
>> +        protected void removed(E element) {
>> +            String name=element.getProperty()!=null? 
>> element.getProperty().getName():element.getName();
>> +            configuredPropertiesMap.remove(name);
>> +        }
>> +    }
>> +
>> +    private List<ConfiguredProperty> configuredProperties = new 
>> ConfiguredPropertyList<ConfiguredProperty>();
>> +    private Map<String, ConfiguredProperty> 
>> configuredPropertiesMap=new HashMap<String, ConfiguredProperty>();
>> +
>> +    private I implementation;
>> +
>> +    public I getImplementation() {
>>          return implementation;
>>      }
>>
>> -    /**
>> -     * @see 
>> org.apache.tuscany.model.assembly.Component#setComponentImplementation(org.apache.tuscany.model.assembly.ComponentImplementation) 
>>
>> -     */
>> -    public void setComponentImplementation(ComponentImplementation 
>> value) {
>> +    public void setImplementation(I value) {
>>          checkNotFrozen();
>>          implementation = value;
>>      }
>>
>> -    /**
>> -     * @see 
>> org.apache.tuscany.model.assembly.Component#getConfiguredServices()
>> -     */
>>      public List<ConfiguredService> getConfiguredServices() {
>>          return configuredServices;
>>      }
>>
>>      public ConfiguredService getConfiguredService(String name) {
>> -        checkInitialized();
>>          return configuredServicesMap.get(name);
>>      }
>>
>> -    public Map<String, ConfiguredReference> getConfiguredReferences() {
>> -        return configuredReferencesMap;
>> +    public List<ConfiguredReference> getConfiguredReferences() {
>> +        return configuredReferences;
>>      }
>>
>> -    /**
>> -     * @see 
>> org.apache.tuscany.model.assembly.Component#getConfiguredReference(java.lang.String) 
>>
>> -     */
>>      public ConfiguredReference getConfiguredReference(String name) {
>>          return configuredReferencesMap.get(name);
>>      }
>>
>> -    /**
>> -     * @see 
>> org.apache.tuscany.model.assembly.Component#getConfiguredProperties()
>> -     */
>>      public List<ConfiguredProperty> getConfiguredProperties() {
>>          return configuredProperties;
>>      }
>>
>> -    /**
>> -     * @see 
>> org.apache.tuscany.model.assembly.Component#getConfiguredProperty(java.lang.String) 
>>
>> -     */
>>      public ConfiguredProperty getConfiguredProperty(String name) {
>> -        checkInitialized();
>>          return configuredPropertiesMap.get(name);
>>      }
>>
>> -    /**
>> -     * @see 
>> org.apache.tuscany.model.assembly.AssemblyModelObject#initialize(org.apache.tuscany.model.assembly.AssemblyModelContext) 
>>
>> -     */
>> -    public void initialize(AssemblyModelContext modelContext) {
>> +    public void initialize(AssemblyContext modelContext) {
>>          if (isInitialized())
>>              return;
>>          super.initialize(modelContext);
>>
>>          // Initialize the implementation
>> -        ComponentImplementation implementation = 
>> getComponentImplementation();
>>          if (implementation == null) {
>> -            throw new IllegalStateException("No implementation for 
>> component [" + getName() + ']');
>> +            throw new AssemblyInitializationException("No 
>> implementation for component [" + getName() + ']');
>>          }
>>          implementation.initialize(modelContext);
>> -        ComponentType componentType = 
>> implementation.getComponentType();
>>
>> -        // Derive the configured services, references and properties 
>> from the component implementation
>> -        //FIXME we have two options here: either just index the 
>> configured services, references and properties
>> -        // that we find in the corresponding lists, or derive them 
>> from the services, references and properties on
>> -        // the component type, for now just check if the lists are 
>> empty or not to determine which option to go with
>> -        configuredServicesMap = new HashMap<String, 
>> ConfiguredService>();
>> -        if (configuredServices.isEmpty()) {
>> -            AssemblyFactory factory = 
>> modelContext.getAssemblyFactory();
>> -            for (Service service : componentType.getServices()) {
>> -                ConfiguredService configuredService = 
>> factory.createConfiguredService();
>> -                configuredService.setPort(service);
>> -                configuredServices.add(configuredService);
>> -                configuredServicesMap.put(service.getName(), 
>> configuredService);
>> -                ((ConfiguredPortImpl) 
>> configuredService).setAggregatePart(this);
>> -                configuredService.initialize(modelContext);
>> -            }
>> -        } else {
>> +        // Derive the configured services from the component 
>> implementation
>> +        ComponentInfo componentInfo=implementation.getComponentInfo();
>> +        AssemblyFactory factory = modelContext.getAssemblyFactory();
>> +        for (Service service : componentInfo.getServices()) {
>> +            ConfiguredService configuredService = 
>> factory.createConfiguredService();
>> +            configuredService.setPort(service);
>> +            configuredServices.add(configuredService);
>> +            configuredService.initialize(modelContext);
>> +        }
>>
>> -            // Just populate the maps of services, references and 
>> properties from the contents of
>> -            // the corresponding lists
>> -            for (ConfiguredService configuredService : 
>> configuredServices) {
>> -                
>> configuredServicesMap.put(configuredService.getService().getName(), 
>> configuredService);
>> -                ((ConfiguredPortImpl) 
>> configuredService).setAggregatePart(this);
>> -                configuredService.initialize(modelContext);
>> +        // Derive the configured references from the references on 
>> the component info
>> +        for (Reference reference : componentInfo.getReferences()) {
>> +            ConfiguredReference configuredReference = 
>> configuredReferencesMap.get(reference.getName());
>> +            if (configuredReference==null) {
>> +                
>> configuredReference=factory.createConfiguredReference();
>> +                configuredReference.setPort(reference);
>> +                configuredReferences.add(configuredReference);
>> +                configuredReference.initialize(modelContext);
>> +            } else {
>> +                configuredReference.setPort(reference);
>> +                configuredReference.initialize(modelContext);
>> +            }
>> +        }
>> +        for (ConfiguredReference configuredReference : 
>> configuredReferences) {
>> +            if (configuredReference.getPort()==null) {
>> +                throw new AssemblyInitializationException("Undefined 
>> reference ["+configuredReference.getName()+"]");
>>              }
>> -
>>          }
>>
>> -        // Match configured properties to the properties on the 
>> component type
>> -        configuredPropertiesMap = new HashMap<String, 
>> ConfiguredProperty>(configuredProperties.size());
>> +        // Derive the configured properties from the properties on 
>> the component info
>> +        for (Property property : componentInfo.getProperties()) {
>> +            ConfiguredProperty configuredProperty = 
>> configuredPropertiesMap.get(property.getName());
>> +            if (configuredProperty==null) {
>> +                configuredProperty=factory.createConfiguredProperty();
>> +                configuredProperty.setProperty(property);
>> +                configuredProperties.add(configuredProperty);
>> +                configuredProperty.initialize(modelContext);
>> +            } else {
>> +                configuredProperty.setProperty(property);
>> +                configuredProperty.initialize(modelContext);
>> +            }
>> +        }
>>          for (ConfiguredProperty configuredProperty : 
>> configuredProperties) {
>> -            String name = configuredProperty.getName();
>> -            
>> configuredProperty.setProperty(componentType.getProperty(name));
>> -            configuredProperty.initialize(modelContext);
>> -            configuredPropertiesMap.put(name, configuredProperty);
>> +            if (configuredProperty.getProperty()==null) {
>> +                throw new AssemblyInitializationException("Undefined 
>> property ["+configuredProperty.getName()+"]");
>> +            }
>>          }
>>
>> -        // Match configured references to the references on the 
>> component type
>> -        for (ConfiguredReference configuredReference : 
>> configuredReferencesMap.values()) {
>> -            String name = configuredReference.getName();
>> -            ((ConfiguredPortImpl) 
>> configuredReference).setAggregatePart(this);
>> -            Reference reference = componentType.getReference(name);
>> -            configuredReference.setReference(reference);
>> -            configuredReference.initialize(modelContext);
>> -        }
>>      }
>>
>> -    /**
>> -     * @see 
>> org.apache.tuscany.model.assembly.AssemblyModelObject#freeze()
>> -     */
>>      public void freeze() {
>>          if (isFrozen())
>>              return;
>>          super.freeze();
>>
>>          // Freeze configured services, references and properties
>> -        configuredServices = 
>> Collections.unmodifiableList(configuredServices);
>> -        freeze(configuredServices);
>> -        configuredReferencesMap = 
>> Collections.unmodifiableMap(configuredReferencesMap);
>> -        freeze(configuredReferencesMap.values());
>> -        configuredProperties = 
>> Collections.unmodifiableList(configuredProperties);
>> -        freeze(configuredProperties);
>> +        configuredServices = freeze(configuredServices);
>> +        configuredReferences = freeze(configuredReferences);
>> +        configuredProperties = freeze(configuredProperties);
>>          if (implementation != null)
>>              implementation.freeze();
>>      }
>>
>> -    /**
>> -     * @see 
>> org.apache.tuscany.model.assembly.impl.AssemblyModelObjectImpl#accept(org.apache.tuscany.model.assembly.AssemblyModelVisitor) 
>>
>> -     */
>> -    public boolean accept(AssemblyModelVisitor visitor) {
>> +    public boolean accept(AssemblyVisitor visitor) {
>>          if (!super.accept(visitor))
>>              return false;
>>
>>          if (!accept(configuredServices, visitor))
>>              return false;
>> -        if (!accept(configuredReferencesMap.values(), visitor))
>> +        if (!accept(configuredReferences, visitor))
>>              return false;
>>          if (!accept(configuredProperties, visitor))
>>              return false;
>>
>> Added: 
>> incubator/tuscany/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ComponentInfoImpl.java 
>>
>> URL: 
>> http://svn.apache.org/viewcvs/incubator/tuscany/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ComponentInfoImpl.java?rev=393677&view=auto 
>>
>> ============================================================================== 
>>
>> --- 
>> incubator/tuscany/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ComponentInfoImpl.java 
>> (added)
>> +++ 
>> incubator/tuscany/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ComponentInfoImpl.java 
>> Wed Apr 12 18:03:55 2006
>> @@ -0,0 +1,147 @@
>> +/**
>> + *
>> + *  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.HashMap;
>> +import java.util.List;
>> +import java.util.Map;
>> +
>> +import org.apache.tuscany.model.assembly.AssemblyContext;
>> +import org.apache.tuscany.model.assembly.AssemblyVisitor;
>> +import org.apache.tuscany.model.assembly.ComponentInfo;
>> +import org.apache.tuscany.model.assembly.Port;
>> +import org.apache.tuscany.model.assembly.Property;
>> +import org.apache.tuscany.model.assembly.Reference;
>> +import org.apache.tuscany.model.assembly.Service;
>> +import org.apache.tuscany.model.util.NotifyingList;
>> +
>> +/**
>> + * An implementation of ComponentInfo.
>> + */
>> +public class ComponentInfoImpl extends ExtensibleImpl implements 
>> ComponentInfo {
>> +
>> +    /**
>> +     * A list of ports synchronized with a map
>> +     */
>> +    private class PortList<E extends Port> extends NotifyingList<E>{
>> +
>> +        Map<String, E> map;
>> +
>> +        private PortList(Map<String, E> map) {
>> +            this.map=map;
>> +        }
>> +
>> +        protected void added(E element) {
>> +            map.put(element.getName(), element);
>> +        }
>> +        protected void removed(E element) {
>> +            map.remove(element.getName());
>> +        }
>> +    }
>> +
>> +    private Map<String, Reference> referencesMap=new HashMap<String, 
>> Reference>();
>> +    private List<Reference> references=new 
>> PortList<Reference>(referencesMap);
>> +
>> +    private Map<String, Service> servicesMap=new HashMap<String, 
>> Service>();
>> +    private List<Service> services=new PortList<Service>(servicesMap);
>> +
>> +    /**
>> +     * A list of properties synchronized with a map
>> +     */
>> +    private class PropertyList<E extends Property> extends 
>> NotifyingList<E>{
>> +
>> +        protected void added(E element) {
>> +            propertiesMap.put(element.getName(), element);
>> +        }
>> +        protected void removed(E element) {
>> +            propertiesMap.remove(element.getName());
>> +        }
>> +    }
>> +
>> +    private Map<String, Property> propertiesMap=new HashMap<String, 
>> Property>();
>> +    private List<Property> properties=new PropertyList<Property>();
>> +
>> +    protected ComponentInfoImpl() {
>> +    }
>> +
>> +    public List<Reference> getReferences() {
>> +        return references;
>> +    }
>> +
>> +    public Reference getReference(String name) {
>> +        return referencesMap.get(name);
>> +    }
>> +
>> +    public List<Service> getServices() {
>> +        return services;
>> +    }
>> +
>> +    public Service getService(String name) {
>> +        return servicesMap.get(name);
>> +    }
>> +
>> +    public List<Property> getProperties() {
>> +        return properties;
>> +    }
>> +
>> +    public Property getProperty(String name) {
>> +        return propertiesMap.get(name);
>> +    }
>> +
>> +    public void initialize(AssemblyContext modelContext) {
>> +        if (isInitialized())
>> +            return;
>> +        super.initialize(modelContext);
>> +
>> +        // Initialize references, properties and services
>> +        for (Reference reference : references) {
>> +            reference.initialize(modelContext);
>> +        }
>> +        for (Property property : properties) {
>> +            property.initialize(modelContext);
>> +        }
>> +        for (Service service : services) {
>> +            service.initialize(modelContext);
>> +        }
>> +    }
>> +
>> +    public void freeze() {
>> +        if (isFrozen())
>> +            return;
>> +        super.freeze();
>> +
>> +        // Freeze lists of services, references and properties
>> +        services=freeze(services);
>> +        references=freeze(references);
>> +        properties=freeze(properties);
>> +    }
>> +
>> +    public boolean accept(AssemblyVisitor visitor) {
>> +        if (!super.accept(visitor))
>> +            return false;
>> +
>> +        if (!accept(services, visitor))
>> +            return false;
>> +        if (!accept(references, visitor))
>> +            return false;
>> +        if (!accept(properties, visitor))
>> +            return false;
>> +
>> +        return true;
>> +    }
>> +
>> +}
>>
>> Propchange: 
>> incubator/tuscany/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ComponentInfoImpl.java 
>>
>> ------------------------------------------------------------------------------ 
>>
>>     svn:eol-style = native
>>
>> Propchange: 
>> incubator/tuscany/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ComponentInfoImpl.java 
>>
>> ------------------------------------------------------------------------------ 
>>
>>     svn:keywords = Rev,Date
>>
>> Added: 
>> incubator/tuscany/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/CompositeImpl.java 
>>
>> URL: 
>> http://svn.apache.org/viewcvs/incubator/tuscany/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/CompositeImpl.java?rev=393677&view=auto 
>>
>> ============================================================================== 
>>
>> --- 
>> incubator/tuscany/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/CompositeImpl.java 
>> (added)
>> +++ 
>> incubator/tuscany/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/CompositeImpl.java 
>> Wed Apr 12 18:03:55 2006
>> @@ -0,0 +1,343 @@
>> +/**
>> + *
>> + *  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.HashMap;
>> +import java.util.List;
>> +import java.util.Map;
>> +
>> +import org.apache.tuscany.model.assembly.AssemblyContext;
>> +import org.apache.tuscany.model.assembly.AssemblyFactory;
>> +import org.apache.tuscany.model.assembly.AssemblyVisitor;
>> +import org.apache.tuscany.model.assembly.Component;
>> +import org.apache.tuscany.model.assembly.ComponentInfo;
>> +import org.apache.tuscany.model.assembly.Composite;
>> +import org.apache.tuscany.model.assembly.ConfiguredProperty;
>> +import org.apache.tuscany.model.assembly.ConfiguredReference;
>> +import org.apache.tuscany.model.assembly.ConfiguredService;
>> +import org.apache.tuscany.model.assembly.EntryPoint;
>> +import org.apache.tuscany.model.assembly.ExternalService;
>> +import org.apache.tuscany.model.assembly.Implementation;
>> +import org.apache.tuscany.model.assembly.ImportWSDL;
>> +import org.apache.tuscany.model.assembly.Multiplicity;
>> +import org.apache.tuscany.model.assembly.OverrideOption;
>> +import org.apache.tuscany.model.assembly.Part;
>> +import org.apache.tuscany.model.assembly.Reference;
>> +import org.apache.tuscany.model.assembly.Service;
>> +import org.apache.tuscany.model.assembly.ServiceContract;
>> +import org.apache.tuscany.model.assembly.ServiceURI;
>> +import org.apache.tuscany.model.assembly.Wire;
>> +import org.apache.tuscany.model.util.NotifyingList;
>> +
>> +/**
>> + * An implementation of Composite.
>> + */
>> +public abstract class CompositeImpl extends ExtensibleImpl 
>> implements Composite {
>> +
>> +    private String name;
>> +    private ComponentInfo componentInfo;
>> +
>> +    /**
>> +     * A list of parts synchronized with a map
>> +     */
>> +    private class PartList<E extends Part> extends NotifyingList<E>{
>> +        protected void added(E element) {
>> +            partsMap.put(element.getName(), element);
>> +            element.setComposite(CompositeImpl.this);
>> +        }
>> +        protected void removed(E element) {
>> +            partsMap.remove(element.getName());
>> +            element.setComposite(null);
>> +        }
>> +    }
>> +
>> +    private Map<String, Part> partsMap = new HashMap<String, Part>();
>> +
>> +    private List<Component> components = new PartList<Component>();
>> +    private List<EntryPoint> entryPoints = new PartList<EntryPoint>();
>> +    private List<ExternalService> externalServices = new 
>> PartList<ExternalService>();
>> +
>> +    private List<Wire> wires = new ArrayList<Wire>();
>> +
>> +    /**
>> +     * A list of WSDL imports synchronized with a map
>> +     */
>> +    private class ImportWSDLList extends NotifyingList<ImportWSDL>{
>> +        protected void added(ImportWSDL element) {
>> +            List<ImportWSDL> 
>> importList=wsdlImportsMap.get(element.getNamespace());
>> +            if (importList==null) {
>> +                importList=new ArrayList<ImportWSDL>();
>> +                wsdlImportsMap.put(element.getNamespace(), importList);
>> +            }
>> +            importList.add(element);
>> +        }
>> +        protected void removed(ImportWSDL element) {
>> +            List<ImportWSDL> 
>> importList=wsdlImportsMap.get(element.getNamespace());
>> +            if (importList!=null) {
>> +                importList.remove(element);
>> +                if (importList.isEmpty())
>> +                    wsdlImportsMap.remove(element.getNamespace());
>> +            }
>> +        }
>> +    }
>> +
>> +    private Map<String, List<ImportWSDL>> wsdlImportsMap = new 
>> HashMap<String, List<ImportWSDL>>();
>> +
>> +    private List<ImportWSDL> wsdlImports = new ImportWSDLList();
>> +
>> +    private AssemblyContext modelContext;
>> +
>> +    protected CompositeImpl() {
>> +    }
>> +
>> +    public String getName() {
>> +        return name;
>> +    }
>> +
>> +    public void setName(String newName) {
>> +        checkNotFrozen();
>> +        name = newName;
>> +    }
>> +
>> +    public List<Component> getComponents() {
>> +        return components;
>> +    }
>> +
>> +    public List<EntryPoint> getEntryPoints() {
>> +        return entryPoints;
>> +    }
>> +
>> +    public List<ExternalService> getExternalServices() {
>> +        return externalServices;
>> +    }
>> +
>> +    public Part getPart(String name) {
>> +        return partsMap.get(name);
>> +    }
>> +
>> +    public List<Wire> getWires() {
>> +        return wires;
>> +    }
>> +
>> +    public List<ImportWSDL> getWSDLImports() {
>> +        return wsdlImports;
>> +    }
>> +
>> +    public List<ImportWSDL> getWSDLImports(String namespace) {
>> +        return wsdlImportsMap.get(namespace);
>> +    }
>> +
>> +    public ComponentInfo getComponentInfo() {
>> +        return componentInfo;
>> +    }
>> +
>> +    public void setComponentInfo(ComponentInfo componentType) {
>> +        checkNotFrozen();
>> +        this.componentInfo=componentType;
>> +    }
>> +
>> +    public AssemblyContext getAssemblyContext() {
>> +        checkInitialized();
>> +        return modelContext;
>> +    }
>> +
>> +    public ConfiguredService getConfiguredService(ServiceURI address) {
>> +        String partName = address.getPartName();
>> +        String serviceName = address.getServiceName();
>> +        Part part = getPart(partName);
>> +        if (part instanceof Component) {
>> +            Component<Implementation> component=(Component)part;
>> +            if (serviceName != null) {
>> +                return component.getConfiguredService(serviceName);
>> +            } else {
>> +                if (!component.getConfiguredServices().isEmpty()) {
>> +                    return component.getConfiguredServices().get(0);
>> +                } else {
>> +                    return null;
>> +                }
>> +            }
>> +
>> +        } if (part instanceof ExternalService) {
>> +            ExternalService externalService = (ExternalService)part;
>> +            return externalService.getConfiguredService();
>> +        } else
>> +            return null;
>> +    }
>> +
>> +    public void initialize(AssemblyContext modelContext) {
>> +        if (isInitialized())
>> +            return;
>> +        super.initialize(modelContext);
>> +
>> +        // Save the model context
>> +        this.modelContext = modelContext;
>> +
>> +        // Initialize WSDL imports
>> +        for (ImportWSDL importWSDL : wsdlImports) {
>> +            importWSDL.initialize(modelContext);
>> +        }
>> +
>> +        // Initialize parts
>> +        for (Part part : externalServices) {
>> +            part.initialize(modelContext);
>> +        }
>> +        for (Part part : components) {
>> +            part.initialize(modelContext);
>> +        }
>> +        for (Part part : entryPoints) {
>> +            part.initialize(modelContext);
>> +        }
>> +
>> +        // Derive the component info from the entry points and 
>> external services in the composite
>> +        // Also derive properties from the overridable properties of 
>> the components in the composite
>> +        if (componentInfo==null) {
>> +            AssemblyFactory factory = 
>> modelContext.getAssemblyFactory();
>> +            componentInfo = factory.createComponentInfo();
>> +            for (EntryPoint entryPoint : getEntryPoints()) {
>> +                Service service = factory.createService();
>> +                service.setName(entryPoint.getName());
>> +                ServiceContract serviceContract = 
>> entryPoint.getConfiguredService().getPort().getServiceContract();
>> +                if (serviceContract != null)
>> +                    service.setServiceContract(serviceContract);
>> +                componentInfo.getServices().add(service);
>> +
>> +                ConfiguredReference configuredReference = 
>> entryPoint.getConfiguredReference();
>> +                ServiceURI sourceURI = 
>> factory.createServiceURI(null, entryPoint, configuredReference);
>> +                for (String target : 
>> configuredReference.getTargets()) {
>> +                    ServiceURI targetURI 
>> =factory.createServiceURI(null, target);
>> +                    Wire wire=factory.createWire();
>> +                    wire.setSource(sourceURI);
>> +                    wire.setTarget(targetURI);
>> +                    getWires().add(wire);
>> +                }
>> +            }
>> +            for (ExternalService externalService : 
>> getExternalServices()) {
>> +                if (externalService.getOverrideOption()==null || 
>> externalService.getOverrideOption()==OverrideOption.NO)
>> +                    continue;
>> +                Reference reference = factory.createReference();
>> +                reference.setName(externalService.getName());
>> +                ServiceContract serviceContract = 
>> externalService.getConfiguredService().getPort().getServiceContract();
>> +                if (serviceContract != null)
>> +                    reference.setServiceContract(serviceContract);
>> +                componentInfo.getReferences().add(reference);
>> +            }
>> +            for (Component<Implementation> component : 
>> getComponents()) {
>> +                for (ConfiguredProperty configuredProperty : 
>> component.getConfiguredProperties()) {
>> +                    if (configuredProperty.getOverrideOption()==null 
>> || configuredProperty.getOverrideOption()==OverrideOption.NO)
>> +                        continue;
>> +                    
>> componentInfo.getProperties().add(configuredProperty.getProperty());
>> +                }
>> +
>> +                for (ConfiguredReference configuredReference : 
>> component.getConfiguredReferences()) {
>> +                    // Create a wire
>> +                    ServiceURI sourceURI 
>> =factory.createServiceURI(null, component, configuredReference);
>> +                    for (String target : 
>> configuredReference.getTargets()) {
>> +                        ServiceURI targetURI 
>> =factory.createServiceURI(null, target);
>> +                        Wire wire=factory.createWire();
>> +                        wire.setSource(sourceURI);
>> +                        wire.setTarget(targetURI);
>> +                        getWires().add(wire);
>> +                    }
>> +                }
>> +            }
>> +        }
>> +        componentInfo.initialize(modelContext);
>> +
>> +        // Wire the module parts
>> +        for (Wire wire : getWires()) {
>> +
>> +            // Get the source reference
>> +            ServiceURI sourceURI=wire.getSource();
>> +            ConfiguredReference configuredReference = null;
>> +            String partName = sourceURI.getPartName();
>> +            String referenceName = sourceURI.getServiceName();
>> +            if (referenceName != null) {
>> +                Component component = (Component)getPart(partName);
>> +                if (component != null) {
>> +                    configuredReference = 
>> component.getConfiguredReference(referenceName);
>> +                }
>> +            } else {
>> +                EntryPoint entryPoint = (EntryPoint)getPart(partName);
>> +                if (entryPoint != null) {
>> +                    configuredReference = 
>> entryPoint.getConfiguredReference();
>> +                }
>> +            }
>> +            if (configuredReference == null) {
>> +                throw new IllegalArgumentException("Cannot find wire 
>> source " + sourceURI.getAddress());
>> +            } else {
>> +
>> +                // Resolve the target service endpoint
>> +                ServiceURI targetURI = wire.getTarget();
>> +                ConfiguredService configuredService = 
>> getConfiguredService(targetURI);
>> +                if (configuredService != null) {
>> +
>> +                    // Wire the reference to the target
>> +                    Multiplicity 
>> multiplicity=configuredReference.getPort().getMultiplicity();
>> +                    if (multiplicity==Multiplicity.ZERO_N || 
>> multiplicity==Multiplicity.ONE_N) {
>> +                        
>> configuredReference.getTargetConfiguredServices().add(configuredService); 
>>
>> +                    } else {
>> +                        
>> configuredReference.getTargetConfiguredServices().clear();
>> +                        
>> configuredReference.getTargetConfiguredServices().add(configuredService); 
>>
>> +                    }
>> +                } else {
>> +                    throw new IllegalArgumentException("Cannot find 
>> service for " + targetURI.getAddress());
>> +                }
>> +            }
>> +        }
>> +
>> +    }
>> +
>> +    public void freeze() {
>> +        if (isFrozen())
>> +            return;
>> +        super.freeze();
>> +
>> +        // Freeze component info
>> +        if (componentInfo!=null)
>> +            componentInfo.freeze();
>> +
>> +        // Freeze lists
>> +        wsdlImports=freeze(wsdlImports);
>> +        components = freeze(components);
>> +        entryPoints = freeze(entryPoints);
>> +        externalServices = freeze(externalServices);
>> +        wires = freeze(wires);
>> +    }
>> +
>> +    public boolean accept(AssemblyVisitor visitor) {
>> +        if (!super.accept(visitor))
>> +            return false;
>> +
>> +        if (!accept(wsdlImports, visitor))
>> +            return false;
>> +
>> +        if (!accept(partsMap.values(), visitor))
>> +            return false;
>> +
>> +        if (!accept(wires, visitor))
>> +            return false;
>> +
>> +        if (componentInfo!=null) {
>> +            if (!componentInfo.accept(visitor))
>> +                return false;
>> +        }
>> +
>> +        return true;
>> +    }
>> +
>> +}
>>
>> Propchange: 
>> incubator/tuscany/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/CompositeImpl.java 
>>
>> ------------------------------------------------------------------------------ 
>>
>>     svn:eol-style = native
>>
>> Propchange: 
>> incubator/tuscany/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/CompositeImpl.java 
>>
>> ------------------------------------------------------------------------------ 
>>
>>     svn:keywords = Rev,Date
>>
>> Modified: 
>> incubator/tuscany/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ConfiguredPortImpl.java 
>>
>> URL: 
>> http://svn.apache.org/viewcvs/incubator/tuscany/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ConfiguredPortImpl.java?rev=393677&r1=393676&r2=393677&view=diff 
>>
>> ============================================================================== 
>>
>> --- 
>> incubator/tuscany/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ConfiguredPortImpl.java 
>> (original)
>> +++ 
>> incubator/tuscany/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ConfiguredPortImpl.java 
>> Wed Apr 12 18:03:55 2006
>> @@ -16,105 +16,72 @@
>>   */
>>  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.Part;
>> +import org.apache.tuscany.model.assembly.AssemblyContext;
>> +import org.apache.tuscany.model.assembly.AssemblyVisitor;
>>  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;
>> +public abstract class ConfiguredPortImpl<P extends Port> extends 
>> AssemblyObjectImpl implements ConfiguredPort<P> {
>> +    private String name;
>> +    private Part part;
>> +    private P port;
>>
>> -    private Object contextFactory;
>>      private Object proxyFactory;
>>
>> -    /**
>> -     * Constructor
>> -     */
>>      protected ConfiguredPortImpl() {
>>      }
>> +
>> +    public String getName() {
>> +        return name;
>> +    }
>> +
>> +    public void setName(String name) {
>> +        checkNotFrozen();
>> +        this.name=name;
>> +    }
>>
>> -    /**
>> -     * @see org.apache.tuscany.model.assembly.ConfiguredPort#getPort()
>> -     */
>> -    public Port getPort() {
>> +    public P getPort() {
>>          return port;
>>      }
>>
>> -    /**
>> -     * @see 
>> org.apache.tuscany.model.assembly.ConfiguredPort#setPort(org.apache.tuscany.model.assembly.Port) 
>>
>> -     */
>> -    public void setPort(Port port) {
>> +    public void setPort(P port) {
>>          checkNotFrozen();
>>          this.port = port;
>>      }
>>
>> -    /**
>> -     * @see 
>> org.apache.tuscany.model.assembly.ConfiguredPort#getAggregatePart()
>> -     */
>> -    public AggregatePart getAggregatePart() {
>> -        checkInitialized();
>> -        return aggregatePart;
>> +    public Part getPart() {
>> +        return part;
>>      }
>> -
>> -    /**
>> -     * Sets the aggregate part containing this configured port.
>> -     * @param aggregatePart
>> -     */
>> -    protected void setAggregatePart(AggregatePart aggregatePart) {
>> +
>> +    public void setPart(Part part) {
>>          checkNotFrozen();
>> -        this.aggregatePart=aggregatePart;
>> +        this.part=part;
>>      }
>>
>> -    /**
>> -     * @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.ContextFactoryHolder#getContextFactory() 
>>
>> -     */
>> -    public Object getContextFactory() {
>> -        return contextFactory;
>> -    }
>> -
>> -    /**
>> -     * @see 
>> org.apache.tuscany.model.assembly.ContextFactoryHolder#setContextFactory(java.lang.Object) 
>>
>> -     */
>> -    public void setContextFactory(Object configuration) {
>> -        checkNotFrozen();
>> -        contextFactory = configuration;
>> -    }
>> -
>> -    /**
>> -     * @see 
>> org.apache.tuscany.model.assembly.impl.AssemblyModelObjectImpl#initialize(org.apache.tuscany.model.assembly.AssemblyModelContext) 
>>
>> -     */
>> -    public void initialize(AssemblyModelContext modelContext) {
>> +    public void initialize(AssemblyContext modelContext) {
>>          if (isInitialized())
>>              return;
>>          super.initialize(modelContext);
>>
>> -        if (port!=null)
>> +        if (port!=null) {
>> +            name=port.getName();
>>              port.initialize(modelContext);
>> +        }
>>      }
>>
>> -    /**
>> -     * @see 
>> org.apache.tuscany.model.assembly.impl.AssemblyModelObjectImpl#freeze()
>> -     */
>>      public void freeze() {
>>          if (isFrozen())
>>              return;
>> @@ -124,10 +91,7 @@
>>              port.freeze();
>>      }
>>
>> -    /**
>> -     * @see 
>> org.apache.tuscany.model.assembly.impl.AssemblyModelObjectImpl#accept(org.apache.tuscany.model.assembly.AssemblyModelVisitor) 
>>
>> -     */
>> -    public boolean accept(AssemblyModelVisitor visitor) {
>> +    public boolean accept(AssemblyVisitor visitor) {
>>          if (!super.accept(visitor))
>>              return false;
>>
>>
>> Modified: 
>> incubator/tuscany/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ConfiguredPropertyImpl.java 
>>
>> URL: 
>> http://svn.apache.org/viewcvs/incubator/tuscany/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ConfiguredPropertyImpl.java?rev=393677&r1=393676&r2=393677&view=diff 
>>
>> ============================================================================== 
>>
>> --- 
>> incubator/tuscany/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ConfiguredPropertyImpl.java 
>> (original)
>> +++ 
>> incubator/tuscany/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ConfiguredPropertyImpl.java 
>> Wed Apr 12 18:03:55 2006
>> @@ -16,8 +16,8 @@
>>   */
>>  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.AssemblyContext;
>> +import org.apache.tuscany.model.assembly.AssemblyVisitor;
>>  import org.apache.tuscany.model.assembly.ConfiguredProperty;
>>  import org.apache.tuscany.model.assembly.OverrideOption;
>>  import org.apache.tuscany.model.assembly.Property;
>> @@ -25,15 +25,12 @@
>>  /**
>>   * Implementation of ConfiguredProperty
>>   */
>> -public class ConfiguredPropertyImpl extends AssemblyModelObjectImpl 
>> implements ConfiguredProperty {
>> +public class ConfiguredPropertyImpl extends AssemblyObjectImpl 
>> implements ConfiguredProperty {
>>      private String name;
>>      private OverrideOption overrideOption;
>>      private Object value;
>>      private Property property;
>>
>> -    /**
>> -     * Constructor
>> -     */
>>      protected ConfiguredPropertyImpl() {
>>      }
>>
>> @@ -45,55 +42,34 @@
>>          this.name = name;
>>      }
>>
>> -    /**
>> -     * @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.ConfiguredProperty#getOverrideOption()
>> -     */
>>      public OverrideOption getOverrideOption() {
>>          return overrideOption;
>>      }
>>
>> -    /*
>> -     * @see 
>> org.apache.tuscany.model.assembly.ConfiguredProperty#setOverrideOption(org.apache.tuscany.model.assembly.OverrideOption) 
>>
>> -     */
>>      public void setOverrideOption(OverrideOption value) {
>>          checkNotFrozen();
>>          this.overrideOption=value;
>>      }
>>
>> -    /**
>> -     * @see 
>> org.apache.tuscany.model.assembly.impl.AssemblyModelObjectImpl#initialize(org.apache.tuscany.model.assembly.AssemblyModelContext) 
>>
>> -     */
>> -    public void initialize(AssemblyModelContext modelContext) {
>> +    public void initialize(AssemblyContext modelContext) {
>>          if (isInitialized())
>>              return;
>>          super.initialize(modelContext);
>> @@ -102,9 +78,6 @@
>>              property.initialize(modelContext);
>>      }
>>
>> -    /**
>> -     * @see 
>> org.apache.tuscany.model.assembly.impl.AssemblyModelObjectImpl#freeze()
>> -     */
>>      public void freeze() {
>>          if (isFrozen())
>>              return;
>> @@ -114,10 +87,7 @@
>>              property.freeze();
>>      }
>>
>> -    /**
>> -     * @see 
>> org.apache.tuscany.model.assembly.impl.AssemblyModelObjectImpl#accept(org.apache.tuscany.model.assembly.AssemblyModelVisitor) 
>>
>> -     */
>> -    public boolean accept(AssemblyModelVisitor visitor) {
>> +    public boolean accept(AssemblyVisitor visitor) {
>>          if (!super.accept(visitor))
>>              return false;
>>
>>
>> Modified: 
>> incubator/tuscany/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ConfiguredReferenceImpl.java 
>>
>> URL: 
>> http://svn.apache.org/viewcvs/incubator/tuscany/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ConfiguredReferenceImpl.java?rev=393677&r1=393676&r2=393677&view=diff 
>>
>> ============================================================================== 
>>
>> --- 
>> incubator/tuscany/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ConfiguredReferenceImpl.java 
>> (original)
>> +++ 
>> incubator/tuscany/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ConfiguredReferenceImpl.java 
>> Wed Apr 12 18:03:55 2006
>> @@ -17,7 +17,6 @@
>>  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;
>> @@ -27,59 +26,28 @@
>>  /**
>>   * An implementation of ConfiguredReference.
>>   */
>> -public class ConfiguredReferenceImpl extends ConfiguredPortImpl 
>> implements ConfiguredReference {
>> +public class ConfiguredReferenceImpl extends 
>> ConfiguredPortImpl<Reference> implements ConfiguredReference {
>>
>> -    private String name;
>>      private List<String> targets = new ArrayList<String>();
>>
>>      private List<ConfiguredService> targetConfiguredServices = new 
>> ArrayList<ConfiguredService>();
>>
>>      protected ConfiguredReferenceImpl() {
>>      }
>> -
>> -    public String getName() {
>> -        return name;
>> -    }
>> -
>> -    public void setName(String name) {
>> -        this.name = name;
>> -    }
>> -
>> +
>>      public List<String> getTargets() {
>>          return targets;
>>      }
>>
>> -    /**
>> -     * @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);
>> -        targets = Collections.unmodifiableList(targets);
>> +        targetConfiguredServices = freeze(targetConfiguredServices);
>> +        targets = freeze(targets);
>>      }
>>
>>  }
>>
>> Modified: 
>> incubator/tuscany/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ConfiguredServiceImpl.java 
>>
>> URL: 
>> http://svn.apache.org/viewcvs/incubator/tuscany/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ConfiguredServiceImpl.java?rev=393677&r1=393676&r2=393677&view=diff 
>>
>> ============================================================================== 
>>
>> --- 
>> incubator/tuscany/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ConfiguredServiceImpl.java 
>> (original)
>> +++ 
>> incubator/tuscany/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ConfiguredServiceImpl.java 
>> Wed Apr 12 18:03:55 2006
>> @@ -22,27 +22,9 @@
>>  /**
>>   * An implementation of ConfiguredService.
>>   */
>> -public class ConfiguredServiceImpl extends ConfiguredPortImpl 
>> implements ConfiguredService {
>> +public class ConfiguredServiceImpl extends 
>> ConfiguredPortImpl<Service> 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);
>>      }
>>
>>  }
>>
>> Modified: 
>> incubator/tuscany/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/EntryPointImpl.java 
>>
>> URL: 
>> http://svn.apache.org/viewcvs/incubator/tuscany/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/EntryPointImpl.java?rev=393677&r1=393676&r2=393677&view=diff 
>>
>> ============================================================================== 
>>
>> --- 
>> incubator/tuscany/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/EntryPointImpl.java 
>> (original)
>> +++ 
>> incubator/tuscany/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/EntryPointImpl.java 
>> Wed Apr 12 18:03:55 2006
>> @@ -17,11 +17,10 @@
>>  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.AssemblyContext;
>> +import org.apache.tuscany.model.assembly.AssemblyVisitor;
>>  import org.apache.tuscany.model.assembly.Binding;
>>  import org.apache.tuscany.model.assembly.ConfiguredReference;
>>  import org.apache.tuscany.model.assembly.ConfiguredService;
>> @@ -30,70 +29,49 @@
>>  /**
>>   * An implementation of EntryPoint.
>>   */
>> -public class EntryPointImpl extends AggregatePartImpl implements 
>> EntryPoint {
>> +public class EntryPointImpl extends PartImpl 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();
>> +        configuredReference.setPart(this);
>>          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();
>> +        configuredService.setPart(this);
>>          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) {
>> +
>> +    public void initialize(AssemblyContext modelContext) {
>>          if (isInitialized())
>>              return;
>>          super.initialize(modelContext);
>>
>>          // Initialize the service contract and reference to the 
>> published service
>>          if (configuredReference != null) {
>> -            
>> ((ConfiguredPortImpl)configuredReference).setAggregatePart(this);
>>              configuredReference.initialize(modelContext);
>>          }
>>          if (configuredService != null) {
>> -            
>> ((ConfiguredPortImpl)configuredService).setAggregatePart(this);
>>              configuredService.initialize(modelContext);
>>          }
>>
>> @@ -101,9 +79,6 @@
>>          initialize(bindings, modelContext);
>>      }
>>
>> -    /**
>> -     * @see 
>> org.apache.tuscany.model.assembly.AssemblyModelObject#freeze()
>> -     */
>>      public void freeze() {
>>          if (isFrozen())
>>              return;
>> @@ -116,14 +91,10 @@
>>              configuredService.freeze();
>>
>>          // Freeze the bindings
>> -        bindings=Collections.unmodifiableList(bindings);
>> -        freeze(bindings);
>> +        bindings=freeze(bindings);
>>      }
>>
>> -    /**
>> -     * @see 
>> org.apache.tuscany.model.assembly.impl.AssemblyModelObjectImpl#accept(org.apache.tuscany.model.assembly.AssemblyModelVisitor) 
>>
>> -     */
>> -    public boolean accept(AssemblyModelVisitor visitor) {
>> +    public boolean accept(AssemblyVisitor visitor) {
>>          if (!super.accept(visitor))
>>              return false;
>>
>>
>> Modified: 
>> incubator/tuscany/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ExtensibleImpl.java 
>>
>> URL: 
>> http://svn.apache.org/viewcvs/incubator/tuscany/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ExtensibleImpl.java?rev=393677&r1=393676&r2=393677&view=diff 
>>
>> ============================================================================== 
>>
>> --- 
>> incubator/tuscany/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ExtensibleImpl.java 
>> (original)
>> +++ 
>> incubator/tuscany/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ExtensibleImpl.java 
>> Wed Apr 12 18:03:55 2006
>> @@ -19,42 +19,30 @@
>>  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.AssemblyContext;
>> +import org.apache.tuscany.model.assembly.AssemblyVisitor;
>>  import org.apache.tuscany.model.assembly.Extensible;
>>
>>  /**
>>   * An implementation of Extensible.
>>   */
>> -public abstract class ExtensibleImpl extends AssemblyModelObjectImpl 
>> implements Extensible {
>> +public abstract class ExtensibleImpl extends AssemblyObjectImpl 
>> 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) {
>> +    public void initialize(AssemblyContext modelContext) {
>>          if (isInitialized())
>>              return;
>>          super.initialize(modelContext);
>> @@ -74,10 +62,7 @@
>>          freeze(extensibilityAttributes);
>>      }
>>
>> -    /**
>> -     * @see 
>> org.apache.tuscany.model.assembly.impl.AssemblyModelObjectImpl#accept(org.apache.tuscany.model.assembly.AssemblyModelVisitor) 
>>
>> -     */
>> -    public boolean accept(AssemblyModelVisitor visitor) {
>> +    public boolean accept(AssemblyVisitor visitor) {
>>          if (!super.accept(visitor))
>>              return false;
>>
>>
>> Modified: 
>> incubator/tuscany/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ExternalServiceImpl.java 
>>
>> URL: 
>> http://svn.apache.org/viewcvs/incubator/tuscany/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ExternalServiceImpl.java?rev=393677&r1=393676&r2=393677&view=diff 
>>
>> ============================================================================== 
>>
>> --- 
>> incubator/tuscany/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ExternalServiceImpl.java 
>> (original)
>> +++ 
>> incubator/tuscany/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ExternalServiceImpl.java 
>> Wed Apr 12 18:03:55 2006
>> @@ -17,11 +17,10 @@
>>  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.AssemblyContext;
>> +import org.apache.tuscany.model.assembly.AssemblyVisitor;
>>  import org.apache.tuscany.model.assembly.Binding;
>>  import org.apache.tuscany.model.assembly.ConfiguredService;
>>  import org.apache.tuscany.model.assembly.ExternalService;
>> @@ -30,66 +29,55 @@
>>  /**
>>   * An implementation ExternalService.
>>   */
>> -public class ExternalServiceImpl extends AggregatePartImpl 
>> implements ExternalService {
>> +public class ExternalServiceImpl extends PartImpl implements 
>> ExternalService {
>>
>>      private ConfiguredService configuredService;
>>      private OverrideOption overrideOption;
>>      private List<Binding> bindings=new ArrayList<Binding>();
>> +
>> +    private Object contextFactory;
>>
>> -    /**
>> -     * 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();
>> +        configuredService.setPart(this);
>>          this.configuredService=configuredService;
>>      }
>> +
>> +    public Object getContextFactory() {
>> +        return contextFactory;
>> +    }
>> +
>> +    public void setContextFactory(Object contextFactory) {
>> +        this.contextFactory=contextFactory;
>> +    }
>>
>> -    /**
>> -     * @see 
>> org.apache.tuscany.model.assembly.AssemblyModelObject#initialize(org.apache.tuscany.model.assembly.AssemblyModelContext) 
>>
>> -     */
>> -    public void initialize(AssemblyModelContext modelContext) {
>> +    public void initialize(AssemblyContext modelContext) {
>>          if (isInitialized())
>>              return;
>>          super.initialize(modelContext);
>>
>>          // Initialize the configured service
>>          if (configuredService != null) {
>> -            
>> ((ConfiguredPortImpl)configuredService).setAggregatePart(this);
>>              configuredService.initialize(modelContext);
>>          }
>>
>> @@ -97,9 +85,6 @@
>>          initialize(bindings, modelContext);
>>      }
>>
>> -    /**
>> -     * @see 
>> org.apache.tuscany.model.assembly.AssemblyModelObject#freeze()
>> -     */
>>      public void freeze() {
>>          if (isFrozen())
>>              return;
>> @@ -110,14 +95,10 @@
>>              configuredService.freeze();
>>
>>          // Freeze the bindings
>> -        bindings=Collections.unmodifiableList(bindings);
>> -        freeze(bindings);
>> +        bindings=freeze(bindings);
>>      }
>>
>> -    /**
>> -     * @see 
>> org.apache.tuscany.model.assembly.impl.ExtensibleImpl#accept(org.apache.tuscany.model.assembly.AssemblyModelVisitor) 
>>
>> -     */
>> -    public boolean accept(AssemblyModelVisitor visitor) {
>> +    public boolean accept(AssemblyVisitor visitor) {
>>          if (!super.accept(visitor))
>>              return false;
>>
>>
>>
>>
>
>

-- 
Jean-Sebastien