tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jsdelf...@apache.org
Subject svn commit: r534704 - in /incubator/tuscany/java/sca/modules: assembly-xml/src/main/java/org/apache/tuscany/assembly/xml/ assembly-xml/src/test/java/org/apache/tuscany/assembly/xml/ contribution-impl/src/main/java/org/apache/tuscany/contribution/servic...
Date Thu, 03 May 2007 04:36:45 GMT
Author: jsdelfino
Date: Wed May  2 21:36:42 2007
New Revision: 534704

URL: http://svn.apache.org/viewvc?view=rev&rev=534704
Log:
Removed the wiring of a composite from CompositeProcessor since it's done in the CompositeActivator
now. Removed the wire method from artifact processors since it's not used at all anymore.

Modified:
    incubator/tuscany/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/assembly/xml/ComponentTypeDocumentProcessor.java
    incubator/tuscany/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/assembly/xml/CompositeDocumentProcessor.java
    incubator/tuscany/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/assembly/xml/CompositeProcessor.java
    incubator/tuscany/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/assembly/xml/ConstrainingTypeDocumentProcessor.java
    incubator/tuscany/java/sca/modules/assembly-xml/src/test/java/org/apache/tuscany/assembly/xml/ReadAllTestCase.java
    incubator/tuscany/java/sca/modules/assembly-xml/src/test/java/org/apache/tuscany/assembly/xml/WireTestCase.java
    incubator/tuscany/java/sca/modules/assembly-xml/src/test/java/org/apache/tuscany/assembly/xml/WriteAllTestCase.java
    incubator/tuscany/java/sca/modules/contribution-impl/src/main/java/org/apache/tuscany/contribution/service/impl/ContributionServiceImpl.java
    incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/contribution/processor/ArtifactProcessorExtension.java
    incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/contribution/processor/DefaultStAXArtifactProcessorExtensionPoint.java
    incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/contribution/processor/DefaultURLArtifactProcessorExtensionPoint.java
    incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/core/runtime/DefaultCompositeActivator.java
    incubator/tuscany/java/sca/modules/host-embedded/src/main/java/org/apache/tuscany/host/embedded/impl/SimpleRuntimeImpl.java

Modified: incubator/tuscany/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/assembly/xml/ComponentTypeDocumentProcessor.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/assembly/xml/ComponentTypeDocumentProcessor.java?view=diff&rev=534704&r1=534703&r2=534704
==============================================================================
--- incubator/tuscany/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/assembly/xml/ComponentTypeDocumentProcessor.java
(original)
+++ incubator/tuscany/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/assembly/xml/ComponentTypeDocumentProcessor.java
Wed May  2 21:36:42 2007
@@ -34,7 +34,6 @@
 import org.apache.tuscany.contribution.resolver.ArtifactResolver;
 import org.apache.tuscany.contribution.service.ContributionReadException;
 import org.apache.tuscany.contribution.service.ContributionResolveException;
-import org.apache.tuscany.contribution.service.ContributionWireException;
 import org.apache.tuscany.contribution.service.ContributionWriteException;
 
 /**
@@ -89,10 +88,6 @@
     
     public void resolve(ComponentType componentType, ArtifactResolver resolver) throws ContributionResolveException
{
         extensionProcessor.resolve(componentType, resolver);
-    }
-    
-    public void wire(ComponentType componentType) throws ContributionWireException {
-        extensionProcessor.wire(componentType);
     }
     
     public String getArtifactType() {

Modified: incubator/tuscany/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/assembly/xml/CompositeDocumentProcessor.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/assembly/xml/CompositeDocumentProcessor.java?view=diff&rev=534704&r1=534703&r2=534704
==============================================================================
--- incubator/tuscany/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/assembly/xml/CompositeDocumentProcessor.java
(original)
+++ incubator/tuscany/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/assembly/xml/CompositeDocumentProcessor.java
Wed May  2 21:36:42 2007
@@ -34,7 +34,6 @@
 import org.apache.tuscany.contribution.resolver.ArtifactResolver;
 import org.apache.tuscany.contribution.service.ContributionReadException;
 import org.apache.tuscany.contribution.service.ContributionResolveException;
-import org.apache.tuscany.contribution.service.ContributionWireException;
 import org.apache.tuscany.contribution.service.ContributionWriteException;
 
 /**
@@ -88,10 +87,6 @@
     
     public void resolve(Composite composite, ArtifactResolver resolver) throws ContributionResolveException
{
         extensionProcessor.resolve(composite, resolver);
-    }
-
-    public void wire(Composite composite) throws ContributionWireException {
-        extensionProcessor.wire(composite);
     }
 
     public String getArtifactType() {

Modified: incubator/tuscany/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/assembly/xml/CompositeProcessor.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/assembly/xml/CompositeProcessor.java?view=diff&rev=534704&r1=534703&r2=534704
==============================================================================
--- incubator/tuscany/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/assembly/xml/CompositeProcessor.java
(original)
+++ incubator/tuscany/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/assembly/xml/CompositeProcessor.java
Wed May  2 21:36:42 2007
@@ -483,7 +483,12 @@
         resolveContracts(composite.getReferences(), resolver);
     }
 
-    public void wire(Composite composite) throws ContributionWireException {
+    /**
+     * FIXME temporarily here, needs to move to CompositeUtil.
+     * @param composite
+     * @throws ContributionWireException
+     */
+    public void configureAndWire(Composite composite) throws ContributionWireException {
         
         // Process the composite configuration
         CompositeUtil compositeUtil = new CompositeUtil(assemblyFactory, interfaceContractMapper);

Modified: incubator/tuscany/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/assembly/xml/ConstrainingTypeDocumentProcessor.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/assembly/xml/ConstrainingTypeDocumentProcessor.java?view=diff&rev=534704&r1=534703&r2=534704
==============================================================================
--- incubator/tuscany/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/assembly/xml/ConstrainingTypeDocumentProcessor.java
(original)
+++ incubator/tuscany/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/assembly/xml/ConstrainingTypeDocumentProcessor.java
Wed May  2 21:36:42 2007
@@ -34,7 +34,6 @@
 import org.apache.tuscany.contribution.resolver.ArtifactResolver;
 import org.apache.tuscany.contribution.service.ContributionReadException;
 import org.apache.tuscany.contribution.service.ContributionResolveException;
-import org.apache.tuscany.contribution.service.ContributionWireException;
 import org.apache.tuscany.contribution.service.ContributionWriteException;
 
 /**
@@ -90,10 +89,6 @@
         extensionProcessor.resolve(constrainingType, resolver);
     }
     
-    public void wire(ConstrainingType constrainingType) throws ContributionWireException
{
-        extensionProcessor.wire(constrainingType);
-    }
-
     public String getArtifactType() {
         return ".constrainingType";
     }

Modified: incubator/tuscany/java/sca/modules/assembly-xml/src/test/java/org/apache/tuscany/assembly/xml/ReadAllTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/assembly-xml/src/test/java/org/apache/tuscany/assembly/xml/ReadAllTestCase.java?view=diff&rev=534704&r1=534703&r2=534704
==============================================================================
--- incubator/tuscany/java/sca/modules/assembly-xml/src/test/java/org/apache/tuscany/assembly/xml/ReadAllTestCase.java
(original)
+++ incubator/tuscany/java/sca/modules/assembly-xml/src/test/java/org/apache/tuscany/assembly/xml/ReadAllTestCase.java
Wed May  2 21:36:42 2007
@@ -53,6 +53,7 @@
 public class ReadAllTestCase extends TestCase {
     private DefaultStAXArtifactProcessorExtensionPoint staxProcessors;
     private DefaultArtifactResolver resolver; 
+    private CompositeProcessor compositeProcessor;
 
     public void setUp() throws Exception {
         AssemblyFactory factory = new DefaultAssemblyFactory();
@@ -60,7 +61,8 @@
         InterfaceContractMapper mapper = new DefaultInterfaceContractMapper();
         
         staxProcessors = new DefaultStAXArtifactProcessorExtensionPoint();
-        staxProcessors.addExtension(new CompositeProcessor(factory, policyFactory, mapper,
staxProcessors));
+        compositeProcessor = new CompositeProcessor(factory, policyFactory, mapper, staxProcessors);
+        staxProcessors.addExtension(compositeProcessor);
         staxProcessors.addExtension(new ComponentTypeProcessor(factory, policyFactory, staxProcessors));
         staxProcessors.addExtension(new ConstrainingTypeProcessor(factory, policyFactory,
staxProcessors));
 
@@ -168,7 +170,7 @@
         Composite composite = staxProcessors.read(is, Composite.class);
         assertNotNull(composite);
         staxProcessors.resolve(composite, resolver);
-        staxProcessors.wire(composite);
+        compositeProcessor.configureAndWire(composite);
 
         Component calcComponent = composite.getComponents().get(0);
         CompositeService calcCompositeService = (CompositeService)composite.getServices().get(0);

Modified: incubator/tuscany/java/sca/modules/assembly-xml/src/test/java/org/apache/tuscany/assembly/xml/WireTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/assembly-xml/src/test/java/org/apache/tuscany/assembly/xml/WireTestCase.java?view=diff&rev=534704&r1=534703&r2=534704
==============================================================================
--- incubator/tuscany/java/sca/modules/assembly-xml/src/test/java/org/apache/tuscany/assembly/xml/WireTestCase.java
(original)
+++ incubator/tuscany/java/sca/modules/assembly-xml/src/test/java/org/apache/tuscany/assembly/xml/WireTestCase.java
Wed May  2 21:36:42 2007
@@ -86,7 +86,7 @@
         assertNotNull(composite);
         
         compositeReader.resolve(composite, resolver);
-        compositeReader.wire(composite);
+        compositeReader.configureAndWire(composite);
         
         assertEquals(composite.getConstrainingType(), constrainingType);
         assertEquals(composite.getComponents().get(0).getConstrainingType(), constrainingType);
@@ -108,7 +108,7 @@
         is.close();
         
         compositeReader.resolve(composite, resolver);
-        compositeReader.wire(composite);
+        compositeReader.configureAndWire(composite);
         
         assertEquals(composite.getComponents().get(2).getImplementation(), nestedComposite);
     }

Modified: incubator/tuscany/java/sca/modules/assembly-xml/src/test/java/org/apache/tuscany/assembly/xml/WriteAllTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/assembly-xml/src/test/java/org/apache/tuscany/assembly/xml/WriteAllTestCase.java?view=diff&rev=534704&r1=534703&r2=534704
==============================================================================
--- incubator/tuscany/java/sca/modules/assembly-xml/src/test/java/org/apache/tuscany/assembly/xml/WriteAllTestCase.java
(original)
+++ incubator/tuscany/java/sca/modules/assembly-xml/src/test/java/org/apache/tuscany/assembly/xml/WriteAllTestCase.java
Wed May  2 21:36:42 2007
@@ -47,13 +47,16 @@
     private AssemblyFactory factory;
     private PolicyFactory policyFactory;
     private InterfaceContractMapper mapper;
+    private CompositeProcessor compositeProcessor;
+
 
     public void setUp() throws Exception {
         factory = new DefaultAssemblyFactory();
         policyFactory = new DefaultPolicyFactory();
         mapper = new DefaultInterfaceContractMapper();
         staxProcessors = new DefaultStAXArtifactProcessorExtensionPoint();
-        staxProcessors.addExtension(new CompositeProcessor(factory, policyFactory, mapper,
staxProcessors));
+        compositeProcessor = new CompositeProcessor(factory, policyFactory, mapper, staxProcessors);
+        staxProcessors.addExtension(compositeProcessor);
         staxProcessors.addExtension(new ComponentTypeProcessor(factory, policyFactory, staxProcessors));
         staxProcessors.addExtension(new ConstrainingTypeProcessor(factory, policyFactory,
staxProcessors));
         resolver = new DefaultArtifactResolver(getClass().getClassLoader());
@@ -78,7 +81,7 @@
         InputStream is = getClass().getResourceAsStream("TestAllCalculator.composite");
         Composite composite = staxProcessors.read(is, Composite.class);
         staxProcessors.resolve(composite, resolver);
-        staxProcessors.wire(composite);
+        compositeProcessor.configureAndWire(composite);
         ByteArrayOutputStream bos = new ByteArrayOutputStream();
         staxProcessors.write(composite, bos);
     }
@@ -87,7 +90,6 @@
         InputStream is = getClass().getResourceAsStream("CalculatorImpl.componentType");
         ComponentType componentType = staxProcessors.read(is, ComponentType.class);
         staxProcessors.resolve(componentType, resolver);
-        staxProcessors.wire(componentType);
         ByteArrayOutputStream bos = new ByteArrayOutputStream();
         staxProcessors.write(componentType, bos);
     }
@@ -96,7 +98,6 @@
         InputStream is = getClass().getResourceAsStream("CalculatorComponent.constrainingType");
         ConstrainingType constrainingType = staxProcessors.read(is, ConstrainingType.class);
         staxProcessors.resolve(constrainingType, resolver);
-        staxProcessors.wire(constrainingType);
         ByteArrayOutputStream bos = new ByteArrayOutputStream();
         staxProcessors.write(constrainingType, bos);
     }

Modified: incubator/tuscany/java/sca/modules/contribution-impl/src/main/java/org/apache/tuscany/contribution/service/impl/ContributionServiceImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/contribution-impl/src/main/java/org/apache/tuscany/contribution/service/impl/ContributionServiceImpl.java?view=diff&rev=534704&r1=534703&r2=534704
==============================================================================
--- incubator/tuscany/java/sca/modules/contribution-impl/src/main/java/org/apache/tuscany/contribution/service/impl/ContributionServiceImpl.java
(original)
+++ incubator/tuscany/java/sca/modules/contribution-impl/src/main/java/org/apache/tuscany/contribution/service/impl/ContributionServiceImpl.java
Wed May  2 21:36:42 2007
@@ -266,8 +266,6 @@
 
         processReadPhase(contribution, contributionArtifacts);
         processResolvePhase(contribution);
-        processOptimizationPhase(contribution);
-        
         processDeployables(contribution);
         
         // store the contribution on the registry
@@ -327,19 +325,6 @@
         
         contribution.getDeployables().clear();
         contribution.getDeployables().addAll(resolvedDeployables);
-    }
-
-    /**
-     * @param contribution
-     * @throws ContributionException
-     */
-    private void processOptimizationPhase(Contribution contribution) throws ContributionException
{
-        // for each artifact that was processed on the contribution
-        for (DeployedArtifact artifact : contribution.getArtifacts().values()) {
-            // resolve the model object
-            this.artifactProcessor.wire(artifact.getModelObject());
-        }
-
     }
 
     /**

Modified: incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/contribution/processor/ArtifactProcessorExtension.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/contribution/processor/ArtifactProcessorExtension.java?view=diff&rev=534704&r1=534703&r2=534704
==============================================================================
--- incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/contribution/processor/ArtifactProcessorExtension.java
(original)
+++ incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/contribution/processor/ArtifactProcessorExtension.java
Wed May  2 21:36:42 2007
@@ -20,7 +20,6 @@
 
 import org.apache.tuscany.contribution.resolver.ArtifactResolver;
 import org.apache.tuscany.contribution.service.ContributionResolveException;
-import org.apache.tuscany.contribution.service.ContributionWireException;
 
 
 
@@ -39,14 +38,6 @@
      * @param the resolver to use to resolve referenced models
      */
     void resolve(M model, ArtifactResolver resolver) throws ContributionResolveException;
-    
-    /**
-     * Wire and optimize a model for consumption by an SCA runtime. In addition to wiring
references
-     * to services, this can include applying policies at different levels, or determining
the configuration
-     * of services, references and properties in nested compositions for example.
-     * @param model the model to optimize
-     */
-    void wire(M model) throws ContributionWireException;
     
     /**
      * Returns the type of model handled by this artifact processor.

Modified: incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/contribution/processor/DefaultStAXArtifactProcessorExtensionPoint.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/contribution/processor/DefaultStAXArtifactProcessorExtensionPoint.java?view=diff&rev=534704&r1=534703&r2=534704
==============================================================================
--- incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/contribution/processor/DefaultStAXArtifactProcessorExtensionPoint.java
(original)
+++ incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/contribution/processor/DefaultStAXArtifactProcessorExtensionPoint.java
Wed May  2 21:36:42 2007
@@ -33,7 +33,6 @@
 import org.apache.tuscany.contribution.resolver.ArtifactResolver;
 import org.apache.tuscany.contribution.service.ContributionReadException;
 import org.apache.tuscany.contribution.service.ContributionResolveException;
-import org.apache.tuscany.contribution.service.ContributionWireException;
 import org.apache.tuscany.contribution.service.ContributionWriteException;
 import org.apache.tuscany.contribution.service.UnrecognizedElementException;
 
@@ -101,18 +100,6 @@
         }
     }
     
-    public void wire(Object model) throws ContributionWireException {
-
-        // Delegate to the processor associated with the model type
-        if (model != null) {
-            StAXArtifactProcessorExtension<Object> processor = 
-                (StAXArtifactProcessorExtension<Object>)this.getProcessor((Class<Object>)model.getClass());
-            if (processor != null) {
-                processor.wire(model);
-            }
-        }
-    }
-
     /**
      * Read a model from an input stream.
      * @param is

Modified: incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/contribution/processor/DefaultURLArtifactProcessorExtensionPoint.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/contribution/processor/DefaultURLArtifactProcessorExtensionPoint.java?view=diff&rev=534704&r1=534703&r2=534704
==============================================================================
--- incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/contribution/processor/DefaultURLArtifactProcessorExtensionPoint.java
(original)
+++ incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/contribution/processor/DefaultURLArtifactProcessorExtensionPoint.java
Wed May  2 21:36:42 2007
@@ -24,7 +24,6 @@
 import org.apache.tuscany.contribution.resolver.ArtifactResolver;
 import org.apache.tuscany.contribution.service.ContributionReadException;
 import org.apache.tuscany.contribution.service.ContributionResolveException;
-import org.apache.tuscany.contribution.service.ContributionWireException;
 import org.apache.tuscany.contribution.service.ContributionWriteException;
 import org.apache.tuscany.contribution.service.UnrecognizedElementException;
 
@@ -85,18 +84,6 @@
                 (URLArtifactProcessorExtension<Object>)this.getProcessor((Class<Object>)model.getClass());
             if (processor != null) {
                 processor.resolve(model, resolver);
-            }
-        }
-    }
-    
-    public void wire(Object model) throws ContributionWireException {
-
-        // Delegate to the processor associated with the model type
-        if (model != null) {
-            URLArtifactProcessorExtension<Object> processor = 
-                (URLArtifactProcessorExtension<Object>)this.getProcessor((Class<Object>)model.getClass());
-            if (processor != null) {
-                processor.wire(model);
             }
         }
     }

Modified: incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/core/runtime/DefaultCompositeActivator.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/core/runtime/DefaultCompositeActivator.java?view=diff&rev=534704&r1=534703&r2=534704
==============================================================================
--- incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/core/runtime/DefaultCompositeActivator.java
(original)
+++ incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/core/runtime/DefaultCompositeActivator.java
Wed May  2 21:36:42 2007
@@ -30,10 +30,7 @@
 import org.apache.tuscany.assembly.ComponentReference;
 import org.apache.tuscany.assembly.ComponentService;
 import org.apache.tuscany.assembly.Composite;
-import org.apache.tuscany.assembly.CompositeReference;
 import org.apache.tuscany.assembly.Implementation;
-import org.apache.tuscany.assembly.Multiplicity;
-import org.apache.tuscany.assembly.Reference;
 import org.apache.tuscany.assembly.SCABinding;
 import org.apache.tuscany.assembly.util.CompositeUtil;
 import org.apache.tuscany.assembly.util.PrintUtil;
@@ -188,37 +185,11 @@
             } else {
                 // createSelfReferences(component);
                 for (ComponentReference reference : component.getReferences()) {
-                    // FIXME: ComponentReference.getBindings() should return the effective
bindings
-//                    for (Binding binding : reference.getBindings()) {
-                for (Binding binding : getBindings(reference)) {
+                    for (Binding binding : reference.getBindings()) {
                         createWires(component, reference, binding);
                     }
                 }
             }
-        }
-    }
-
-    public void createSelfReferences(Component component) {
-        for (ComponentService service : component.getServices()) {
-            ComponentReference ref = assemblyFactory.createComponentReference();
-            ref.setName("$self$_" + service.getName());
-            ref.getBindings().addAll(service.getBindings());
-            ref.getTargets().add(service);
-            ref.getPolicySets().addAll(service.getPolicySets());
-            ref.getRequiredIntents().addAll(service.getRequiredIntents());
-            ref.setInterfaceContract(service.getInterfaceContract());
-            ref.setMultiplicity(Multiplicity.ONE_ONE);
-            component.getReferences().add(ref);
-        }
-    }
-    
-    private List<Binding> getBindings(ComponentReference reference) {
-        List<CompositeReference> list = reference.promotedAs();
-        if(!list.isEmpty()) {
-            CompositeReference compositeReference = list.get(0);
-            return compositeReference.getBindings();
-        } else {
-            return reference.getBindings();
         }
     }
 

Modified: incubator/tuscany/java/sca/modules/host-embedded/src/main/java/org/apache/tuscany/host/embedded/impl/SimpleRuntimeImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/host-embedded/src/main/java/org/apache/tuscany/host/embedded/impl/SimpleRuntimeImpl.java?view=diff&rev=534704&r1=534703&r2=534704
==============================================================================
--- incubator/tuscany/java/sca/modules/host-embedded/src/main/java/org/apache/tuscany/host/embedded/impl/SimpleRuntimeImpl.java
(original)
+++ incubator/tuscany/java/sca/modules/host-embedded/src/main/java/org/apache/tuscany/host/embedded/impl/SimpleRuntimeImpl.java
Wed May  2 21:36:42 2007
@@ -23,13 +23,17 @@
 import java.net.MalformedURLException;
 import java.net.URI;
 import java.net.URL;
+import java.util.ArrayList;
 import java.util.Collection;
+import java.util.List;
 
 import javax.xml.stream.XMLInputFactory;
 
 import org.apache.tuscany.assembly.AssemblyFactory;
+import org.apache.tuscany.assembly.Base;
 import org.apache.tuscany.assembly.Composite;
 import org.apache.tuscany.assembly.impl.DefaultAssemblyFactory;
+import org.apache.tuscany.assembly.util.CompositeUtil;
 import org.apache.tuscany.assembly.xml.ComponentTypeDocumentProcessor;
 import org.apache.tuscany.assembly.xml.ComponentTypeProcessor;
 import org.apache.tuscany.assembly.xml.CompositeDocumentProcessor;
@@ -180,6 +184,9 @@
 
         // Start all components
         Composite composite = (Composite)artifact.getModelObject();
+        
+        wire(composite);
+        
         Collection<Component> components = getDeployer().deploy(composite);
         for (Component component : components) {
             component.start();
@@ -207,4 +214,53 @@
         super.destroy();
     }
 
+    /**
+     * FIXME This is temporary until we move over to use the new CompositeActivator.
+     * @param composite
+     */
+    private void wire(Composite composite) {
+        // Process the composite configuration
+        CompositeUtil compositeUtil = new CompositeUtil(new DefaultAssemblyFactory(), new
DefaultInterfaceContractMapper());
+
+        List<Base> problems = new ArrayList<Base>() {
+            private static final long serialVersionUID = 4819831446590718923L;
+
+            
+            @Override
+            public boolean add(Base o) {
+                //TODO Use a monitor to report configuration problems
+                
+                // Uncommenting the following two lines can be useful to detect
+                // and troubleshoot SCA assembly XML composite configuration
+                // problems.
+                
+//                System.err.println("Composite configuration problem:");
+//                new PrintUtil(System.err).print(o);
+                return super.add(o);
+            }
+        };
+        
+
+        // Collect and fuse includes
+        compositeUtil.fuseIncludes(composite, problems);
+
+        // Configure all components
+        compositeUtil.configureComponents(composite, problems);
+        
+        //FIXME this should only be done on top level deployable composites
+
+        // Expand nested composites
+        //compositeUtil.expandComposites(composite, problems);
+        
+        // Wire the composite
+        compositeUtil.wireComposite(composite, problems);
+       
+        // Uncommenting the following three lines can be useful to detect
+        // and troubleshoot SCA assembly XML composite configuration
+        // problems.
+//        if (!problems.isEmpty()) {
+//            throw new ContributionWireException("Problems in the composite...");
+//        }
+        
+    }
 }



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


Mime
View raw message