tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jsdelf...@apache.org
Subject svn commit: r526268 - in /incubator/tuscany/java/sca/modules: assembly-xml/src/main/java/org/apache/tuscany/assembly/xml/impl/ assembly-xml/src/test/java/org/apache/tuscany/assembly/xml/ contribution/src/main/java/org/apache/tuscany/services/spi/contri...
Date Fri, 06 Apr 2007 20:13:28 GMT
Author: jsdelfino
Date: Fri Apr  6 13:13:26 2007
New Revision: 526268

URL: http://svn.apache.org/viewvc?view=rev&rev=526268
Log:
Adjusted the Contribution ArtifactProcessor framework to support SCA XML assembly writers. Renamed the optimize method to wire.

Added:
    incubator/tuscany/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/assembly/xml/impl/Attr.java   (with props)
    incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/services/spi/contribution/ContributionResolveException.java   (with props)
    incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/services/spi/contribution/ContributionWireException.java   (with props)
    incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/services/spi/contribution/ContributionWriteException.java   (with props)
Modified:
    incubator/tuscany/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/assembly/xml/impl/BaseArtifactProcessor.java
    incubator/tuscany/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/assembly/xml/impl/ComponentTypeDocumentProcessor.java
    incubator/tuscany/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/assembly/xml/impl/ComponentTypeProcessor.java
    incubator/tuscany/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/assembly/xml/impl/CompositeDocumentProcessor.java
    incubator/tuscany/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/assembly/xml/impl/CompositeProcessor.java
    incubator/tuscany/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/assembly/xml/impl/ConstrainingTypeDocumentProcessor.java
    incubator/tuscany/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/assembly/xml/impl/ConstrainingTypeProcessor.java
    incubator/tuscany/java/sca/modules/assembly-xml/src/test/java/org/apache/tuscany/assembly/xml/OptimizeTestCase.java
    incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/services/spi/contribution/ArtifactProcessor.java
    incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/services/spi/contribution/ArtifactProcessorRegistry.java
    incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/services/spi/contribution/ContributionReadException.java
    incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/services/spi/contribution/DOMArtifactProcessor.java
    incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/services/spi/contribution/DefaultArtifactProcessorRegistry.java
    incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/services/spi/contribution/DefaultStAXArtifactProcessorRegistry.java
    incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/services/spi/contribution/DefaultURLArtifactProcessorRegistry.java
    incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/services/spi/contribution/StAXArtifactProcessor.java
    incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/services/spi/contribution/StAXArtifactProcessorRegistry.java
    incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/services/spi/contribution/URLArtifactProcessor.java
    incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/services/spi/contribution/URLArtifactProcessorRegistry.java
    incubator/tuscany/java/sca/modules/core-spring/src/test/java/test/application/context/TestRuntimeContext.java
    incubator/tuscany/java/sca/modules/core-spring/src/test/java/test/model/variant/VariantRuntimeContext.java
    incubator/tuscany/java/sca/modules/idl-java-xml/src/main/java/org/apache/tuscany/idl/java/xml/JavaInterfaceProcessor.java
    incubator/tuscany/java/sca/modules/idl-wsdl-xml/src/main/java/org/apache/tuscany/idl/wsdl/xml/WSDLInterfaceProcessor.java
    incubator/tuscany/java/sca/modules/impl-java-xml/src/main/java/org/apache/tuscany/implementation/java/xml/JavaImplementationProcessor.java

Added: incubator/tuscany/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/assembly/xml/impl/Attr.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/assembly/xml/impl/Attr.java?view=auto&rev=526268
==============================================================================
--- incubator/tuscany/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/assembly/xml/impl/Attr.java (added)
+++ incubator/tuscany/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/assembly/xml/impl/Attr.java Fri Apr  6 13:13:26 2007
@@ -0,0 +1,76 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.    
+ */
+
+package org.apache.tuscany.assembly.xml.impl;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamWriter;
+
+/**
+ * Represents an XML attribute that needs to be written to a document.
+ *
+ * @version $Rev$ $Date$
+ */
+public class Attr {
+
+    String uri;
+    String name;
+    Object value;
+
+    public Attr(String uri, String name, String value) {
+        this.uri = uri;
+        this.name = name;
+        this.value = value;
+    }
+
+    public Attr(String name, String value) {
+        this.name = name;
+        this.value = value;
+    }
+
+    public Attr(String uri, String name, boolean value) {
+        this.uri = uri;
+        this.name = name;
+        this.value = value;
+    }
+
+    public Attr(String name, boolean value) {
+        this.name = name;
+        this.value = value;
+    }
+
+    public Attr(String uri, String name, QName value) {
+        this.uri = uri;
+        this.name = name;
+        this.value = value;
+    }
+
+    public Attr(String name, QName value) {
+        this.name = name;
+        this.value = value;
+    }
+
+    void write(XMLStreamWriter writer) throws XMLStreamException {
+        if (value != null) {
+            writer.writeAttribute(uri, name, String.valueOf(value));
+        }
+    }
+
+}

Propchange: incubator/tuscany/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/assembly/xml/impl/Attr.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/assembly/xml/impl/Attr.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: incubator/tuscany/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/assembly/xml/impl/BaseArtifactProcessor.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/assembly/xml/impl/BaseArtifactProcessor.java?view=diff&rev=526268&r1=526267&r2=526268
==============================================================================
--- incubator/tuscany/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/assembly/xml/impl/BaseArtifactProcessor.java (original)
+++ incubator/tuscany/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/assembly/xml/impl/BaseArtifactProcessor.java Fri Apr  6 13:13:26 2007
@@ -34,6 +34,7 @@
 import javax.xml.stream.XMLStreamConstants;
 import javax.xml.stream.XMLStreamException;
 import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.XMLStreamWriter;
 
 import org.apache.tuscany.assembly.AbstractContract;
 import org.apache.tuscany.assembly.AbstractProperty;
@@ -54,7 +55,6 @@
 import org.apache.tuscany.policy.PolicySetAttachPoint;
 import org.apache.tuscany.services.spi.contribution.ArtifactResolver;
 import org.apache.tuscany.services.spi.contribution.ContributionReadException;
-import org.w3c.dom.Attr;
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 import org.w3c.dom.Node;
@@ -397,7 +397,7 @@
         // root element has no namespace and local name "value"
         Element root = doc.createElementNS(null, "value");
         if (type != null) {
-            Attr xsi = doc.createAttributeNS(XMLNS_ATTRIBUTE_NS_URI, "xmlns:xsi");
+            org.w3c.dom.Attr xsi = doc.createAttributeNS(XMLNS_ATTRIBUTE_NS_URI, "xmlns:xsi");
             xsi.setValue(W3C_XML_SCHEMA_INSTANCE_NS_URI);
             root.setAttributeNodeNS(xsi);
 
@@ -408,7 +408,7 @@
 
             DOMUtil.declareNamespace(root, prefix, type.getNamespaceURI());
 
-            Attr xsiType = doc.createAttributeNS(W3C_XML_SCHEMA_INSTANCE_NS_URI, "xsi:type");
+            org.w3c.dom.Attr xsiType = doc.createAttributeNS(W3C_XML_SCHEMA_INSTANCE_NS_URI, "xsi:type");
             xsiType.setValue(prefix + ":" + type.getLocalPart());
             root.setAttributeNodeNS(xsiType);
         }
@@ -418,5 +418,66 @@
         return doc;
     }
 
+    /**
+     * Start an element.
+     * @param uri
+     * @param name
+     * @param attrs
+     * @throws XMLStreamException
+     */
+    protected void start(XMLStreamWriter writer, String uri, String name, Attr... attrs) throws XMLStreamException {
+        writer.writeStartElement(uri, name);
+        writeAttributes(writer, attrs);
+    }
+
+    /**
+     * Start an element.
+     * @param writer
+     * @param name
+     * @param attrs
+     * @throws XMLStreamException
+     */
+    protected void start(XMLStreamWriter writer, String name, Attr... attrs) throws XMLStreamException {
+        writer.writeStartElement(SCA10_NS, name);
+        writeAttributes(writer, attrs);
+    }
+
+    /**
+     * End an element. 
+     * @param writer
+     * @throws XMLStreamException
+     */
+    protected void end(XMLStreamWriter writer) throws XMLStreamException {
+        writer.writeEndElement();
+    }
 
+    /**
+     * Write attributes to the current element.
+     * @param writer
+     * @param attrs
+     * @throws XMLStreamException
+     */
+    protected void writeAttributes(XMLStreamWriter writer, Attr... attrs) throws XMLStreamException {
+        for (Attr attr : attrs) {
+            if (attr != null)
+                attr.write(writer);
+        }
+    }
+
+    /**
+     * Write an SCA abstract property declaration.
+     * @param writer
+     * @param prop
+     */
+    protected void writeAbstractProperty(XMLStreamWriter writer, AbstractProperty prop) throws XMLStreamException {
+    }
+
+    /**
+     * Write an SCA property declaration.
+     * @param writer
+     * @param prop
+     */
+    protected void writeProperty(XMLStreamWriter writer, Property prop) throws XMLStreamException {
+        writeAbstractProperty(writer, prop);
+    }
 }

Modified: incubator/tuscany/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/assembly/xml/impl/ComponentTypeDocumentProcessor.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/assembly/xml/impl/ComponentTypeDocumentProcessor.java?view=diff&rev=526268&r1=526267&r2=526268
==============================================================================
--- incubator/tuscany/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/assembly/xml/impl/ComponentTypeDocumentProcessor.java (original)
+++ incubator/tuscany/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/assembly/xml/impl/ComponentTypeDocumentProcessor.java Fri Apr  6 13:13:26 2007
@@ -33,8 +33,10 @@
 import org.apache.tuscany.policy.PolicyFactory;
 import org.apache.tuscany.policy.impl.DefaultPolicyFactory;
 import org.apache.tuscany.services.spi.contribution.ArtifactResolver;
-import org.apache.tuscany.services.spi.contribution.ContributionException;
 import org.apache.tuscany.services.spi.contribution.ContributionReadException;
+import org.apache.tuscany.services.spi.contribution.ContributionResolveException;
+import org.apache.tuscany.services.spi.contribution.ContributionWireException;
+import org.apache.tuscany.services.spi.contribution.ContributionWriteException;
 import org.apache.tuscany.services.spi.contribution.StAXArtifactProcessorRegistry;
 import org.apache.tuscany.services.spi.contribution.URLArtifactProcessor;
 
@@ -91,12 +93,15 @@
         }
     }
     
-    public void resolve(ComponentType componentType, ArtifactResolver resolver) throws ContributionException {
+    public void write(ComponentType model, URL outputSource) throws ContributionWriteException {
+    }
+    
+    public void resolve(ComponentType componentType, ArtifactResolver resolver) throws ContributionResolveException {
         registry.resolve(componentType, resolver);
     }
     
-    public void optimize(ComponentType componentType) throws ContributionException {
-        registry.optimize(componentType);
+    public void wire(ComponentType componentType) throws ContributionWireException {
+        registry.wire(componentType);
     }
     
     public String getArtifactType() {

Modified: incubator/tuscany/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/assembly/xml/impl/ComponentTypeProcessor.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/assembly/xml/impl/ComponentTypeProcessor.java?view=diff&rev=526268&r1=526267&r2=526268
==============================================================================
--- incubator/tuscany/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/assembly/xml/impl/ComponentTypeProcessor.java (original)
+++ incubator/tuscany/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/assembly/xml/impl/ComponentTypeProcessor.java Fri Apr  6 13:13:26 2007
@@ -25,6 +25,7 @@
 import javax.xml.namespace.QName;
 import javax.xml.stream.XMLStreamException;
 import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.XMLStreamWriter;
 
 import org.apache.tuscany.assembly.AssemblyFactory;
 import org.apache.tuscany.assembly.Binding;
@@ -42,8 +43,10 @@
 import org.apache.tuscany.policy.PolicyFactory;
 import org.apache.tuscany.policy.impl.DefaultPolicyFactory;
 import org.apache.tuscany.services.spi.contribution.ArtifactResolver;
-import org.apache.tuscany.services.spi.contribution.ContributionException;
 import org.apache.tuscany.services.spi.contribution.ContributionReadException;
+import org.apache.tuscany.services.spi.contribution.ContributionResolveException;
+import org.apache.tuscany.services.spi.contribution.ContributionWireException;
+import org.apache.tuscany.services.spi.contribution.ContributionWriteException;
 import org.apache.tuscany.services.spi.contribution.StAXArtifactProcessor;
 import org.apache.tuscany.services.spi.contribution.StAXArtifactProcessorRegistry;
 
@@ -201,15 +204,20 @@
         }
         return componentType;
     }
+
+    public void write(ComponentType model, XMLStreamWriter outputSource) throws ContributionWriteException {
+        // TODO Auto-generated method stub
+        
+    }
     
-    public void resolve(ComponentType componentType, ArtifactResolver resolver) throws ContributionException {
+    public void resolve(ComponentType componentType, ArtifactResolver resolver) throws ContributionResolveException {
 
         // Resolve componen type services and references
         resolveContract(componentType.getServices(), resolver);
         resolveContract(componentType.getReferences(), resolver);
     }
     
-    public void optimize(ComponentType model) throws ContributionException {
+    public void wire(ComponentType model) throws ContributionWireException {
         //TODO optimize the model 
     }
     

Modified: incubator/tuscany/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/assembly/xml/impl/CompositeDocumentProcessor.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/assembly/xml/impl/CompositeDocumentProcessor.java?view=diff&rev=526268&r1=526267&r2=526268
==============================================================================
--- incubator/tuscany/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/assembly/xml/impl/CompositeDocumentProcessor.java (original)
+++ incubator/tuscany/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/assembly/xml/impl/CompositeDocumentProcessor.java Fri Apr  6 13:13:26 2007
@@ -33,8 +33,10 @@
 import org.apache.tuscany.policy.PolicyFactory;
 import org.apache.tuscany.policy.impl.DefaultPolicyFactory;
 import org.apache.tuscany.services.spi.contribution.ArtifactResolver;
-import org.apache.tuscany.services.spi.contribution.ContributionException;
 import org.apache.tuscany.services.spi.contribution.ContributionReadException;
+import org.apache.tuscany.services.spi.contribution.ContributionResolveException;
+import org.apache.tuscany.services.spi.contribution.ContributionWireException;
+import org.apache.tuscany.services.spi.contribution.ContributionWriteException;
 import org.apache.tuscany.services.spi.contribution.StAXArtifactProcessorRegistry;
 import org.apache.tuscany.services.spi.contribution.URLArtifactProcessor;
 
@@ -91,12 +93,17 @@
         }
     }
     
-    public void resolve(Composite composite, ArtifactResolver resolver) throws ContributionException {
+    public void write(Composite model, URL outputSource) throws ContributionWriteException {
+        // TODO Auto-generated method stub
+        
+    }
+    
+    public void resolve(Composite composite, ArtifactResolver resolver) throws ContributionResolveException {
         registry.resolve(composite, resolver);
     }
 
-    public void optimize(Composite composite) throws ContributionException {
-        registry.optimize(composite);
+    public void wire(Composite composite) throws ContributionWireException {
+        registry.wire(composite);
     }
 
     public String getArtifactType() {

Modified: incubator/tuscany/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/assembly/xml/impl/CompositeProcessor.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/assembly/xml/impl/CompositeProcessor.java?view=diff&rev=526268&r1=526267&r2=526268
==============================================================================
--- incubator/tuscany/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/assembly/xml/impl/CompositeProcessor.java (original)
+++ incubator/tuscany/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/assembly/xml/impl/CompositeProcessor.java Fri Apr  6 13:13:26 2007
@@ -22,11 +22,11 @@
 import static javax.xml.stream.XMLStreamConstants.END_ELEMENT;
 import static javax.xml.stream.XMLStreamConstants.START_ELEMENT;
 
-
 import javax.xml.namespace.QName;
 import javax.xml.stream.XMLStreamConstants;
 import javax.xml.stream.XMLStreamException;
 import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.XMLStreamWriter;
 
 import org.apache.tuscany.assembly.AssemblyFactory;
 import org.apache.tuscany.assembly.Binding;
@@ -50,8 +50,10 @@
 import org.apache.tuscany.policy.PolicyFactory;
 import org.apache.tuscany.policy.impl.DefaultPolicyFactory;
 import org.apache.tuscany.services.spi.contribution.ArtifactResolver;
-import org.apache.tuscany.services.spi.contribution.ContributionException;
 import org.apache.tuscany.services.spi.contribution.ContributionReadException;
+import org.apache.tuscany.services.spi.contribution.ContributionResolveException;
+import org.apache.tuscany.services.spi.contribution.ContributionWireException;
+import org.apache.tuscany.services.spi.contribution.ContributionWriteException;
 import org.apache.tuscany.services.spi.contribution.StAXArtifactProcessor;
 import org.apache.tuscany.services.spi.contribution.StAXArtifactProcessorRegistry;
 
@@ -327,7 +329,12 @@
         }
     }
     
-    public void resolve(Composite composite, ArtifactResolver resolver) throws ContributionException {
+    public void write(Composite model, XMLStreamWriter outputSource) throws ContributionWriteException {
+        // TODO Auto-generated method stub
+        
+    }
+    
+    public void resolve(Composite composite, ArtifactResolver resolver) throws ContributionResolveException {
         
         // Resolve constraining type
         ConstrainingType constrainingType = composite.getConstrainingType(); 
@@ -360,7 +367,7 @@
         resolveContract(composite.getReferences(), resolver);
     }
 
-    public void optimize(Composite composite) throws ContributionException {
+    public void wire(Composite composite) throws ContributionWireException {
         
         // Process the composite configuration
         CompositeUtil compositeUtil = new CompositeUtil(factory, composite);

Modified: incubator/tuscany/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/assembly/xml/impl/ConstrainingTypeDocumentProcessor.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/assembly/xml/impl/ConstrainingTypeDocumentProcessor.java?view=diff&rev=526268&r1=526267&r2=526268
==============================================================================
--- incubator/tuscany/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/assembly/xml/impl/ConstrainingTypeDocumentProcessor.java (original)
+++ incubator/tuscany/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/assembly/xml/impl/ConstrainingTypeDocumentProcessor.java Fri Apr  6 13:13:26 2007
@@ -33,8 +33,10 @@
 import org.apache.tuscany.policy.PolicyFactory;
 import org.apache.tuscany.policy.impl.DefaultPolicyFactory;
 import org.apache.tuscany.services.spi.contribution.ArtifactResolver;
-import org.apache.tuscany.services.spi.contribution.ContributionException;
 import org.apache.tuscany.services.spi.contribution.ContributionReadException;
+import org.apache.tuscany.services.spi.contribution.ContributionResolveException;
+import org.apache.tuscany.services.spi.contribution.ContributionWireException;
+import org.apache.tuscany.services.spi.contribution.ContributionWriteException;
 import org.apache.tuscany.services.spi.contribution.StAXArtifactProcessorRegistry;
 import org.apache.tuscany.services.spi.contribution.URLArtifactProcessor;
 
@@ -90,15 +92,19 @@
                 //ignore
             }
         }
-
     }
     
-    public void resolve(ConstrainingType constrainingType, ArtifactResolver resolver) throws ContributionException {
+    public void write(ConstrainingType model, URL outputSource) throws ContributionWriteException {
+        // TODO Auto-generated method stub
+        
+    }
+    
+    public void resolve(ConstrainingType constrainingType, ArtifactResolver resolver) throws ContributionResolveException {
         registry.resolve(constrainingType, resolver);
     }
     
-    public void optimize(ConstrainingType constrainingType) throws ContributionException {
-        registry.optimize(constrainingType);
+    public void wire(ConstrainingType constrainingType) throws ContributionWireException {
+        registry.wire(constrainingType);
     }
 
     public String getArtifactType() {

Modified: incubator/tuscany/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/assembly/xml/impl/ConstrainingTypeProcessor.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/assembly/xml/impl/ConstrainingTypeProcessor.java?view=diff&rev=526268&r1=526267&r2=526268
==============================================================================
--- incubator/tuscany/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/assembly/xml/impl/ConstrainingTypeProcessor.java (original)
+++ incubator/tuscany/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/assembly/xml/impl/ConstrainingTypeProcessor.java Fri Apr  6 13:13:26 2007
@@ -25,6 +25,7 @@
 import javax.xml.namespace.QName;
 import javax.xml.stream.XMLStreamException;
 import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.XMLStreamWriter;
 
 import org.apache.tuscany.assembly.AbstractContract;
 import org.apache.tuscany.assembly.AbstractProperty;
@@ -39,8 +40,10 @@
 import org.apache.tuscany.policy.PolicyFactory;
 import org.apache.tuscany.policy.impl.DefaultPolicyFactory;
 import org.apache.tuscany.services.spi.contribution.ArtifactResolver;
-import org.apache.tuscany.services.spi.contribution.ContributionException;
 import org.apache.tuscany.services.spi.contribution.ContributionReadException;
+import org.apache.tuscany.services.spi.contribution.ContributionResolveException;
+import org.apache.tuscany.services.spi.contribution.ContributionWireException;
+import org.apache.tuscany.services.spi.contribution.ContributionWriteException;
 import org.apache.tuscany.services.spi.contribution.StAXArtifactProcessor;
 import org.apache.tuscany.services.spi.contribution.StAXArtifactProcessorRegistry;
 
@@ -170,14 +173,19 @@
         }
     }
     
-    public void resolve(ConstrainingType constrainingType, ArtifactResolver resolver) throws ContributionException {
+    public void write(ConstrainingType model, XMLStreamWriter outputSource) throws ContributionWriteException {
+        // TODO Auto-generated method stub
+        
+    }
+    
+    public void resolve(ConstrainingType constrainingType, ArtifactResolver resolver) throws ContributionResolveException {
 
         // Resolve component type services and references
         resolveAbstractContract(constrainingType.getServices(), resolver);
         resolveAbstractContract(constrainingType.getReferences(), resolver);
     }
     
-    public void optimize(ConstrainingType model) throws ContributionException {
+    public void wire(ConstrainingType model) throws ContributionWireException {
         // TODO Auto-generated method stub
     }
 

Modified: incubator/tuscany/java/sca/modules/assembly-xml/src/test/java/org/apache/tuscany/assembly/xml/OptimizeTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/assembly-xml/src/test/java/org/apache/tuscany/assembly/xml/OptimizeTestCase.java?view=diff&rev=526268&r1=526267&r2=526268
==============================================================================
--- incubator/tuscany/java/sca/modules/assembly-xml/src/test/java/org/apache/tuscany/assembly/xml/OptimizeTestCase.java (original)
+++ incubator/tuscany/java/sca/modules/assembly-xml/src/test/java/org/apache/tuscany/assembly/xml/OptimizeTestCase.java Fri Apr  6 13:13:26 2007
@@ -73,7 +73,7 @@
         assertNotNull(composite);
         
         compositeReader.resolve(composite, resolver);
-        compositeReader.optimize(composite);
+        compositeReader.wire(composite);
         
         assertEquals(composite.getConstrainingType(), constrainingType);
         assertEquals(composite.getComponents().get(0).getConstrainingType(), constrainingType);
@@ -97,7 +97,7 @@
         is.close();
         
         compositeReader.resolve(composite, resolver);
-        compositeReader.optimize(composite);
+        compositeReader.wire(composite);
         
         assertEquals(composite.getComponents().get(2).getImplementation(), nestedComposite);
     }

Modified: incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/services/spi/contribution/ArtifactProcessor.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/services/spi/contribution/ArtifactProcessor.java?view=diff&rev=526268&r1=526267&r2=526268
==============================================================================
--- incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/services/spi/contribution/ArtifactProcessor.java (original)
+++ incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/services/spi/contribution/ArtifactProcessor.java Fri Apr  6 13:13:26 2007
@@ -25,15 +25,23 @@
  * 
  * @version $Rev: 522653 $ $Date: 2007-03-26 15:30:21 -0700 (Mon, 26 Mar 2007) $
  */
-public interface ArtifactProcessor <S, M, T> {
+public interface ArtifactProcessor <I, O, M, T> {
     
     /**
-     * Read a model from a source. Examples of sources are: an inputstream, an
-     * XML reader, or an object representation of the source.
+     * Reads a model from an input source. Examples of input sources are: a URI, a
+     * DOM node, an XML reader.
+     * @param source
+     * @return a model representation of the input.
+     */
+    M read(I inputSource) throws ContributionReadException;
+    
+    /**
+     * Writes a model to an ouput source. Examples of output sources are: a URI, a
+     * DOM node, an XML writer.
      * @param source
      * @return a model representation of the source.
      */
-    M read(S source) throws ContributionReadException;
+    void write(M model, O outputSource) throws ContributionWriteException;
     
     /**
      * Resolve references from this model to other models. For example references
@@ -42,15 +50,15 @@
      * @param model the model to resolve
      * @param the resolver to use to resolve referenced models
      */
-    void resolve(M model, ArtifactResolver resolver) throws ContributionException;
+    void resolve(M model, ArtifactResolver resolver) throws ContributionResolveException;
     
     /**
-     * Optimize a model for consumption by the runtime. This can include applying policies at different
-     * levels, or determining the configuration of services, references and properties in nested compositions
-     * for example.
+     * 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 optimize(M model) throws ContributionException;
+    void wire(M model) throws ContributionWireException;
     
     /**
      * Returns the type of artifact handled by this artifact processor. 

Modified: incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/services/spi/contribution/ArtifactProcessorRegistry.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/services/spi/contribution/ArtifactProcessorRegistry.java?view=diff&rev=526268&r1=526267&r2=526268
==============================================================================
--- incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/services/spi/contribution/ArtifactProcessorRegistry.java (original)
+++ incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/services/spi/contribution/ArtifactProcessorRegistry.java Fri Apr  6 13:13:26 2007
@@ -25,12 +25,12 @@
  * 
  * @version $Rev$ $Date$
  */
-public interface ArtifactProcessorRegistry<S, M, T> extends ArtifactProcessor<S, M, T> {
+public interface ArtifactProcessorRegistry<I, O, M, T> extends ArtifactProcessor<I, O, M, T> {
     
     /**
      * Add an artifact processor.
      * @param artifactProcessor the artifact processor to add
      */
-    void addArtifactProcessor(ArtifactProcessor<S, ?, T> artifactProcessor);
+    void addArtifactProcessor(ArtifactProcessor<I, O, ?, T> artifactProcessor);
 
 }

Modified: incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/services/spi/contribution/ContributionReadException.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/services/spi/contribution/ContributionReadException.java?view=diff&rev=526268&r1=526267&r2=526268
==============================================================================
--- incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/services/spi/contribution/ContributionReadException.java (original)
+++ incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/services/spi/contribution/ContributionReadException.java Fri Apr  6 13:13:26 2007
@@ -20,8 +20,7 @@
 
 
 /**
- * Base class for Exceptions raised during the loading process. Loader implementations should throw a subclass of this
- * to indicate the actual problem.
+ * Denotes an exception while reading artifacts inside an SCA contribution.
  *
  * @version $Rev$ $Date$
  */
@@ -45,35 +44,51 @@
     }
     
     /**
-     * Returns the location of the resource that was being loaded.
+     * Returns the location of the resource that was being read.
      *
-     * @return the location of the resource that was being loaded
+     * @return the location of the resource that was being read
      */
     public String getResourceURI() {
         return resourceURI;
     }
 
     /**
-     * Sets the location of the resource that was being loaded.
+     * Sets the location of the resource that was being read.
      *
-     * @param resourceURI the location of the resource that was being loaded
+     * @param resourceURI the location of the resource that was being read
      */
     public void setResourceURI(String resourceURI) {
         this.resourceURI = resourceURI;
     }
 
+    /**
+     * Returns the line inside the resource that was being read.
+     * @return the line inside the resource that was being read
+     */
     public int getLine() {
         return line;
     }
 
+    /**
+     * Sets the line inside the resource that was being read.
+     * @param line the line inside the resource that was being read
+     */
     public void setLine(int line) {
         this.line = line;
     }
 
+    /**
+     * Returns the column inside the resource that was being read.
+     * @return the column inside the resource that was being read
+     */
     public int getColumn() {
         return column;
     }
 
+    /**
+     * Sets the column inside the resource that was being read.
+     * @param column the column inside the resource that was being read
+     */
     public void setColumn(int column) {
         this.column = column;
     }

Added: incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/services/spi/contribution/ContributionResolveException.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/services/spi/contribution/ContributionResolveException.java?view=auto&rev=526268
==============================================================================
--- incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/services/spi/contribution/ContributionResolveException.java (added)
+++ incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/services/spi/contribution/ContributionResolveException.java Fri Apr  6 13:13:26 2007
@@ -0,0 +1,42 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.    
+ */
+package org.apache.tuscany.services.spi.contribution;
+
+
+/**
+ * Denotes a problem while resolving models inside an SCA contribution.
+ *
+ * @version $Rev$ $Date$
+ */
+public class ContributionResolveException extends ContributionException {
+    private static final long serialVersionUID = -7459051598906813461L;
+
+    public ContributionResolveException(String message) {
+        super(message);
+    }
+
+    public ContributionResolveException(String message, Throwable cause) {
+        super(message, cause);
+    }
+
+    public ContributionResolveException(Throwable cause) {
+        super(cause);
+    }
+    
+}

Propchange: incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/services/spi/contribution/ContributionResolveException.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/services/spi/contribution/ContributionResolveException.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/services/spi/contribution/ContributionWireException.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/services/spi/contribution/ContributionWireException.java?view=auto&rev=526268
==============================================================================
--- incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/services/spi/contribution/ContributionWireException.java (added)
+++ incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/services/spi/contribution/ContributionWireException.java Fri Apr  6 13:13:26 2007
@@ -0,0 +1,42 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.    
+ */
+package org.apache.tuscany.services.spi.contribution;
+
+
+/**
+ * Denotes a problem while wiring models inside an SCA contribution.
+ *
+ * @version $Rev$ $Date$
+ */
+public class ContributionWireException extends ContributionException {
+    private static final long serialVersionUID = -7459051598906813461L;
+
+    public ContributionWireException(String message) {
+        super(message);
+    }
+
+    public ContributionWireException(String message, Throwable cause) {
+        super(message, cause);
+    }
+
+    public ContributionWireException(Throwable cause) {
+        super(cause);
+    }
+    
+}

Propchange: incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/services/spi/contribution/ContributionWireException.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/services/spi/contribution/ContributionWireException.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/services/spi/contribution/ContributionWriteException.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/services/spi/contribution/ContributionWriteException.java?view=auto&rev=526268
==============================================================================
--- incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/services/spi/contribution/ContributionWriteException.java (added)
+++ incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/services/spi/contribution/ContributionWriteException.java Fri Apr  6 13:13:26 2007
@@ -0,0 +1,61 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.    
+ */
+package org.apache.tuscany.services.spi.contribution;
+
+
+/**
+ * Denotes an exception while writing artifacts inside an SCA contribution.
+ *
+ * @version $Rev$ $Date$
+ */
+public class ContributionWriteException extends ContributionException {
+    private static final long serialVersionUID = -7459051598906813461L;
+    private String resourceURI;
+
+    public ContributionWriteException(String message) {
+        super(message);
+    }
+
+    public ContributionWriteException(String message, Throwable cause) {
+        super(message, cause);
+    }
+
+    public ContributionWriteException(Throwable cause) {
+        super(cause);
+    }
+    
+    /**
+     * Returns the location of the resource that was being written.
+     *
+     * @return the location of the resource that was being written
+     */
+    public String getResourceURI() {
+        return resourceURI;
+    }
+
+    /**
+     * Sets the location of the resource that was being written.
+     *
+     * @param resourceURI the location of the resource that was being written
+     */
+    public void setResourceURI(String resourceURI) {
+        this.resourceURI = resourceURI;
+    }
+
+}

Propchange: incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/services/spi/contribution/ContributionWriteException.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/services/spi/contribution/ContributionWriteException.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/services/spi/contribution/DOMArtifactProcessor.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/services/spi/contribution/DOMArtifactProcessor.java?view=diff&rev=526268&r1=526267&r2=526268
==============================================================================
--- incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/services/spi/contribution/DOMArtifactProcessor.java (original)
+++ incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/services/spi/contribution/DOMArtifactProcessor.java Fri Apr  6 13:13:26 2007
@@ -28,5 +28,5 @@
  * 
  * @version $Rev: 522653 $ $Date: 2007-03-26 15:30:21 -0700 (Mon, 26 Mar 2007) $
  */
-public interface DOMArtifactProcessor<M> extends ArtifactProcessor<Node, M, QName> {
+public interface DOMArtifactProcessor<M> extends ArtifactProcessor<Node, Node, M, QName> {
 }

Modified: incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/services/spi/contribution/DefaultArtifactProcessorRegistry.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/services/spi/contribution/DefaultArtifactProcessorRegistry.java?view=diff&rev=526268&r1=526267&r2=526268
==============================================================================
--- incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/services/spi/contribution/DefaultArtifactProcessorRegistry.java (original)
+++ incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/services/spi/contribution/DefaultArtifactProcessorRegistry.java Fri Apr  6 13:13:26 2007
@@ -26,9 +26,9 @@
  * 
  * @version $Rev$ $Date$
  */
-abstract class DefaultArtifactProcessorRegistry<S, M, K> implements ArtifactProcessorRegistry<S, M, K> {
-    private final Map<K, ArtifactProcessor<S, ?, K>> processorsByArtifactType = new HashMap<K, ArtifactProcessor<S, ?, K>>();
-    private final Map<Class<?>, ArtifactProcessor<S, ?, K>> processorsByModelType = new HashMap<Class<?>, ArtifactProcessor<S, ?, K>>();
+abstract class DefaultArtifactProcessorRegistry<I, O, M, K> implements ArtifactProcessorRegistry<I, O, M, K> {
+    private final Map<K, ArtifactProcessor<I, O, ?, K>> processorsByArtifactType = new HashMap<K, ArtifactProcessor<I, O, ?, K>>();
+    private final Map<Class<?>, ArtifactProcessor<I, O, ?, K>> processorsByModelType = new HashMap<Class<?>, ArtifactProcessor<I, O, ?, K>>();
 
     /**
      * Constructs a new loader registry.
@@ -41,7 +41,7 @@
      * @param artifactType an artifact type
      * @return the processor associated with the given artifact type
      */
-    protected ArtifactProcessor<S, ?, K> getProcessor(K artifactType) {
+    protected ArtifactProcessor<I, O, ?, K> getProcessor(K artifactType) {
         return processorsByArtifactType.get(artifactType);
     }
 
@@ -50,17 +50,17 @@
      * @param modelType a model type
      * @return the processor associated with the given model type
      */
-    protected ArtifactProcessor<S, ?, K> getProcessor(Class<M> modelType) {
+    protected ArtifactProcessor<I, O, ?, K> getProcessor(Class<M> modelType) {
         Class<?>[] classes = modelType.getClasses();
         for (Class<?> c: classes) {
-            ArtifactProcessor<S, ?, K> processor = processorsByModelType.get(c);
+            ArtifactProcessor<I, O, ?, K> processor = processorsByModelType.get(c);
             if (processor != null)
                 return processor;
         }
         return null;
     }
 
-    public void addArtifactProcessor(ArtifactProcessor<S, ?, K> artifactProcessor) {
+    public void addArtifactProcessor(ArtifactProcessor<I, O, ?, K> artifactProcessor) {
         processorsByArtifactType.put(artifactProcessor.getArtifactType(), artifactProcessor);
         processorsByModelType.put(artifactProcessor.getModelType(), artifactProcessor);
     }

Modified: incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/services/spi/contribution/DefaultStAXArtifactProcessorRegistry.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/services/spi/contribution/DefaultStAXArtifactProcessorRegistry.java?view=diff&rev=526268&r1=526267&r2=526268
==============================================================================
--- incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/services/spi/contribution/DefaultStAXArtifactProcessorRegistry.java (original)
+++ incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/services/spi/contribution/DefaultStAXArtifactProcessorRegistry.java Fri Apr  6 13:13:26 2007
@@ -27,6 +27,7 @@
 import javax.xml.stream.XMLInputFactory;
 import javax.xml.stream.XMLStreamException;
 import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.XMLStreamWriter;
 
 /**
  * The default implementation of a StAX artifact processor registry.
@@ -34,7 +35,7 @@
  * @version $Rev$ $Date$
  */
 public class DefaultStAXArtifactProcessorRegistry
-    extends DefaultArtifactProcessorRegistry<XMLStreamReader, Object, QName>
+    extends DefaultArtifactProcessorRegistry<XMLStreamReader, XMLStreamWriter, Object, QName>
     implements StAXArtifactProcessorRegistry {
 
     private XMLInputFactory factory;
@@ -65,7 +66,16 @@
         return processor.read(source);
     }
     
-    public void resolve(Object model, ArtifactResolver resolver) throws ContributionException {
+    public void write(Object model, XMLStreamWriter outputSource) throws ContributionWriteException {
+        
+        // Delegate to the processor associated with the model type
+        StAXArtifactProcessor<Object> processor = (StAXArtifactProcessor<Object>)this.getProcessor((Class<Object>)model.getClass());
+        if (processor != null) {
+            processor.write(model, outputSource);
+        }
+    }
+    
+    public void resolve(Object model, ArtifactResolver resolver) throws ContributionResolveException {
 
         // Delegate to the processor associated with the model type
         StAXArtifactProcessor<Object> processor = (StAXArtifactProcessor<Object>)this.getProcessor((Class<Object>)model.getClass());
@@ -74,12 +84,12 @@
         }
     }
     
-    public void optimize(Object model) throws ContributionException {
+    public void wire(Object model) throws ContributionWireException {
 
         // Delegate to the processor associated with the model type
         StAXArtifactProcessor<Object> processor = (StAXArtifactProcessor<Object>)this.getProcessor((Class<Object>)model.getClass());
         if (processor != null) {
-            processor.optimize(model);
+            processor.wire(model);
         }
     }
     

Modified: incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/services/spi/contribution/DefaultURLArtifactProcessorRegistry.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/services/spi/contribution/DefaultURLArtifactProcessorRegistry.java?view=diff&rev=526268&r1=526267&r2=526268
==============================================================================
--- incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/services/spi/contribution/DefaultURLArtifactProcessorRegistry.java (original)
+++ incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/services/spi/contribution/DefaultURLArtifactProcessorRegistry.java Fri Apr  6 13:13:26 2007
@@ -26,7 +26,7 @@
  * @version $Rev$ $Date$
  */
 public class DefaultURLArtifactProcessorRegistry
-    extends DefaultArtifactProcessorRegistry<URL, Object, String>
+    extends DefaultArtifactProcessorRegistry<URL, URL, Object, String>
     implements URLArtifactProcessorRegistry {
 
     /**
@@ -49,8 +49,19 @@
         }
         return processor.read(source);
     }
+
+    public void write(Object model, URL outputSource) throws ContributionWriteException {
+        
+        // Delegate to the processor associated with the particular model type
+        URLArtifactProcessor<Object> processor = (URLArtifactProcessor<Object>)this.getProcessor((Class<Object>)model.getClass());
+        if (processor != null) {
+            processor.write(model, outputSource);
+        }
+    }
+    
+    
     
-    public void resolve(Object model, ArtifactResolver resolver) throws ContributionException {
+    public void resolve(Object model, ArtifactResolver resolver) throws ContributionResolveException {
 
         // Delegate to the processor associated with the model type
         URLArtifactProcessor<Object> processor = (URLArtifactProcessor<Object>)this.getProcessor((Class<Object>)model.getClass());
@@ -59,12 +70,12 @@
         }
     }
     
-    public void optimize(Object model) throws ContributionException {
+    public void wire(Object model) throws ContributionWireException {
 
         // Delegate to the processor associated with the model type
         URLArtifactProcessor<Object> processor = (URLArtifactProcessor<Object>)this.getProcessor((Class<Object>)model.getClass());
         if (processor != null) {
-            processor.optimize(model);
+            processor.wire(model);
         }
     }
     

Modified: incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/services/spi/contribution/StAXArtifactProcessor.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/services/spi/contribution/StAXArtifactProcessor.java?view=diff&rev=526268&r1=526267&r2=526268
==============================================================================
--- incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/services/spi/contribution/StAXArtifactProcessor.java (original)
+++ incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/services/spi/contribution/StAXArtifactProcessor.java Fri Apr  6 13:13:26 2007
@@ -21,11 +21,12 @@
 
 import javax.xml.namespace.QName;
 import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.XMLStreamWriter;
 
 /**
  * An artifact processor that can read models from a StAX XMLStreamReader.
  * 
  * @version $Rev: 522653 $ $Date: 2007-03-26 15:30:21 -0700 (Mon, 26 Mar 2007) $
  */
-public interface StAXArtifactProcessor<M> extends ArtifactProcessor <XMLStreamReader, M, QName> {
+public interface StAXArtifactProcessor<M> extends ArtifactProcessor <XMLStreamReader, XMLStreamWriter, M, QName> {
 }

Modified: incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/services/spi/contribution/StAXArtifactProcessorRegistry.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/services/spi/contribution/StAXArtifactProcessorRegistry.java?view=diff&rev=526268&r1=526267&r2=526268
==============================================================================
--- incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/services/spi/contribution/StAXArtifactProcessorRegistry.java (original)
+++ incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/services/spi/contribution/StAXArtifactProcessorRegistry.java Fri Apr  6 13:13:26 2007
@@ -20,6 +20,7 @@
 
 import javax.xml.namespace.QName;
 import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.XMLStreamWriter;
 
 
 /**
@@ -28,6 +29,6 @@
  * @version $Rev$ $Date$
  */
 public interface StAXArtifactProcessorRegistry extends
-    ArtifactProcessorRegistry<XMLStreamReader, Object, QName> {
+    ArtifactProcessorRegistry<XMLStreamReader, XMLStreamWriter, Object, QName> {
     
 }

Modified: incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/services/spi/contribution/URLArtifactProcessor.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/services/spi/contribution/URLArtifactProcessor.java?view=diff&rev=526268&r1=526267&r2=526268
==============================================================================
--- incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/services/spi/contribution/URLArtifactProcessor.java (original)
+++ incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/services/spi/contribution/URLArtifactProcessor.java Fri Apr  6 13:13:26 2007
@@ -26,5 +26,5 @@
  * 
  * @version $Rev: 522653 $ $Date: 2007-03-26 15:30:21 -0700 (Mon, 26 Mar 2007) $
  */
-public interface URLArtifactProcessor<M> extends ArtifactProcessor<URL, M, String> {
+public interface URLArtifactProcessor<M> extends ArtifactProcessor<URL, URL, M, String> {
 }

Modified: incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/services/spi/contribution/URLArtifactProcessorRegistry.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/services/spi/contribution/URLArtifactProcessorRegistry.java?view=diff&rev=526268&r1=526267&r2=526268
==============================================================================
--- incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/services/spi/contribution/URLArtifactProcessorRegistry.java (original)
+++ incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/services/spi/contribution/URLArtifactProcessorRegistry.java Fri Apr  6 13:13:26 2007
@@ -27,6 +27,6 @@
  * @version $Rev: 525638 $ $Date: 2007-04-04 16:36:03 -0700 (Wed, 04 Apr 2007) $
  */
 public interface URLArtifactProcessorRegistry extends
-    ArtifactProcessorRegistry<URL, Object, String> {
+    ArtifactProcessorRegistry<URL, URL, Object, String> {
     
 }

Modified: incubator/tuscany/java/sca/modules/core-spring/src/test/java/test/application/context/TestRuntimeContext.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/core-spring/src/test/java/test/application/context/TestRuntimeContext.java?view=diff&rev=526268&r1=526267&r2=526268
==============================================================================
--- incubator/tuscany/java/sca/modules/core-spring/src/test/java/test/application/context/TestRuntimeContext.java (original)
+++ incubator/tuscany/java/sca/modules/core-spring/src/test/java/test/application/context/TestRuntimeContext.java Fri Apr  6 13:13:26 2007
@@ -63,7 +63,7 @@
             
             // Resolve and configure the composite
             compositeProcessor.resolve(composite, resolver);
-            compositeProcessor.optimize(composite);
+            compositeProcessor.wire(composite);
     
             // Create a Spring application composite context for the composite
             applicationContext = new CompositeApplicationContext(composite);

Modified: incubator/tuscany/java/sca/modules/core-spring/src/test/java/test/model/variant/VariantRuntimeContext.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/core-spring/src/test/java/test/model/variant/VariantRuntimeContext.java?view=diff&rev=526268&r1=526267&r2=526268
==============================================================================
--- incubator/tuscany/java/sca/modules/core-spring/src/test/java/test/model/variant/VariantRuntimeContext.java (original)
+++ incubator/tuscany/java/sca/modules/core-spring/src/test/java/test/model/variant/VariantRuntimeContext.java Fri Apr  6 13:13:26 2007
@@ -78,7 +78,7 @@
             
             // Resolve and configure the composite
             compositeProcessor.resolve(composite, resolver);
-            compositeProcessor.optimize(composite);
+            compositeProcessor.wire(composite);
             
         } catch (ContributionException e) {
             throw new RuntimeException(e);

Modified: incubator/tuscany/java/sca/modules/idl-java-xml/src/main/java/org/apache/tuscany/idl/java/xml/JavaInterfaceProcessor.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/idl-java-xml/src/main/java/org/apache/tuscany/idl/java/xml/JavaInterfaceProcessor.java?view=diff&rev=526268&r1=526267&r2=526268
==============================================================================
--- incubator/tuscany/java/sca/modules/idl-java-xml/src/main/java/org/apache/tuscany/idl/java/xml/JavaInterfaceProcessor.java (original)
+++ incubator/tuscany/java/sca/modules/idl-java-xml/src/main/java/org/apache/tuscany/idl/java/xml/JavaInterfaceProcessor.java Fri Apr  6 13:13:26 2007
@@ -24,13 +24,16 @@
 import javax.xml.namespace.QName;
 import javax.xml.stream.XMLStreamException;
 import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.XMLStreamWriter;
 
 import org.apache.tuscany.idl.java.JavaFactory;
 import org.apache.tuscany.idl.java.JavaInterface;
 import org.apache.tuscany.idl.java.impl.DefaultJavaFactory;
 import org.apache.tuscany.services.spi.contribution.ArtifactResolver;
-import org.apache.tuscany.services.spi.contribution.ContributionException;
 import org.apache.tuscany.services.spi.contribution.ContributionReadException;
+import org.apache.tuscany.services.spi.contribution.ContributionResolveException;
+import org.apache.tuscany.services.spi.contribution.ContributionWireException;
+import org.apache.tuscany.services.spi.contribution.ContributionWriteException;
 import org.apache.tuscany.services.spi.contribution.StAXArtifactProcessor;
 
 public class JavaInterfaceProcessor implements StAXArtifactProcessor<JavaInterface>, JavaConstants {
@@ -67,11 +70,16 @@
         }
     }
     
-    public void resolve(JavaInterface model, ArtifactResolver resolver) throws ContributionException {
+    public void write(JavaInterface model, XMLStreamWriter outputSource) throws ContributionWriteException {
+        // TODO Auto-generated method stub
+        
+    }
+    
+    public void resolve(JavaInterface model, ArtifactResolver resolver) throws ContributionResolveException {
         // TODO Auto-generated method stub
     }
     
-    public void optimize(JavaInterface model) throws ContributionException {
+    public void wire(JavaInterface model) throws ContributionWireException {
         // TODO Auto-generated method stub
     }
     

Modified: incubator/tuscany/java/sca/modules/idl-wsdl-xml/src/main/java/org/apache/tuscany/idl/wsdl/xml/WSDLInterfaceProcessor.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/idl-wsdl-xml/src/main/java/org/apache/tuscany/idl/wsdl/xml/WSDLInterfaceProcessor.java?view=diff&rev=526268&r1=526267&r2=526268
==============================================================================
--- incubator/tuscany/java/sca/modules/idl-wsdl-xml/src/main/java/org/apache/tuscany/idl/wsdl/xml/WSDLInterfaceProcessor.java (original)
+++ incubator/tuscany/java/sca/modules/idl-wsdl-xml/src/main/java/org/apache/tuscany/idl/wsdl/xml/WSDLInterfaceProcessor.java Fri Apr  6 13:13:26 2007
@@ -24,13 +24,16 @@
 import javax.xml.namespace.QName;
 import javax.xml.stream.XMLStreamException;
 import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.XMLStreamWriter;
 
 import org.apache.tuscany.idl.wsdl.WSDLFactory;
 import org.apache.tuscany.idl.wsdl.WSDLInterface;
 import org.apache.tuscany.idl.wsdl.impl.DefaultWSDLFactory;
 import org.apache.tuscany.services.spi.contribution.ArtifactResolver;
-import org.apache.tuscany.services.spi.contribution.ContributionException;
 import org.apache.tuscany.services.spi.contribution.ContributionReadException;
+import org.apache.tuscany.services.spi.contribution.ContributionResolveException;
+import org.apache.tuscany.services.spi.contribution.ContributionWireException;
+import org.apache.tuscany.services.spi.contribution.ContributionWriteException;
 import org.apache.tuscany.services.spi.contribution.StAXArtifactProcessor;
 
 public class WSDLInterfaceProcessor implements StAXArtifactProcessor<WSDLInterface>, WSDLConstants {
@@ -68,11 +71,15 @@
         }
     }
     
-    public void resolve(WSDLInterface model, ArtifactResolver resolver) throws ContributionException {
+    public void write(WSDLInterface model, XMLStreamWriter outputSource) throws ContributionWriteException {
         // TODO Auto-generated method stub
     }
     
-    public void optimize(WSDLInterface model) throws ContributionException {
+    public void resolve(WSDLInterface model, ArtifactResolver resolver) throws ContributionResolveException {
+        // TODO Auto-generated method stub
+    }
+    
+    public void wire(WSDLInterface model) throws ContributionWireException {
         // TODO Auto-generated method stub
     }
     

Modified: incubator/tuscany/java/sca/modules/impl-java-xml/src/main/java/org/apache/tuscany/implementation/java/xml/JavaImplementationProcessor.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/impl-java-xml/src/main/java/org/apache/tuscany/implementation/java/xml/JavaImplementationProcessor.java?view=diff&rev=526268&r1=526267&r2=526268
==============================================================================
--- incubator/tuscany/java/sca/modules/impl-java-xml/src/main/java/org/apache/tuscany/implementation/java/xml/JavaImplementationProcessor.java (original)
+++ incubator/tuscany/java/sca/modules/impl-java-xml/src/main/java/org/apache/tuscany/implementation/java/xml/JavaImplementationProcessor.java Fri Apr  6 13:13:26 2007
@@ -24,14 +24,17 @@
 import javax.xml.namespace.QName;
 import javax.xml.stream.XMLStreamException;
 import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.XMLStreamWriter;
 
 import org.apache.tuscany.assembly.impl.DefaultAssemblyFactory;
 import org.apache.tuscany.implementation.java.JavaImplementation;
 import org.apache.tuscany.implementation.java.JavaImplementationFactory;
 import org.apache.tuscany.implementation.java.impl.DefaultJavaImplementationFactory;
 import org.apache.tuscany.services.spi.contribution.ArtifactResolver;
-import org.apache.tuscany.services.spi.contribution.ContributionException;
 import org.apache.tuscany.services.spi.contribution.ContributionReadException;
+import org.apache.tuscany.services.spi.contribution.ContributionResolveException;
+import org.apache.tuscany.services.spi.contribution.ContributionWireException;
+import org.apache.tuscany.services.spi.contribution.ContributionWriteException;
 import org.apache.tuscany.services.spi.contribution.StAXArtifactProcessor;
 
 public class JavaImplementationProcessor implements StAXArtifactProcessor<JavaImplementation>, JavaImplementationConstants {
@@ -68,11 +71,15 @@
         }
     }
     
-    public void resolve(JavaImplementation model, ArtifactResolver resolver) throws ContributionException {
+    public void write(JavaImplementation model, XMLStreamWriter outputSource) throws ContributionWriteException {
         // TODO Auto-generated method stub
     }
     
-    public void optimize(JavaImplementation model) throws ContributionException {
+    public void resolve(JavaImplementation model, ArtifactResolver resolver) throws ContributionResolveException {
+        // TODO Auto-generated method stub
+    }
+    
+    public void wire(JavaImplementation model) throws ContributionWireException {
         // TODO Auto-generated method stub
     }
     



---------------------------------------------------------------------
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