tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jsdelf...@apache.org
Subject svn commit: r534738 [1/2] - in /incubator/tuscany/java/sca: modules/assembly-xml/src/main/java/org/apache/tuscany/assembly/xml/ modules/assembly-xml/src/test/java/org/apache/tuscany/assembly/xml/ modules/assembly/src/main/java/org/apache/tuscany/assemb...
Date Thu, 03 May 2007 07:24:50 GMT
Author: jsdelfino
Date: Thu May  3 00:24:45 2007
New Revision: 534738

URL: http://svn.apache.org/viewvc?view=rev&rev=534738
Log:
Shortened contribution extension interface names. Moved logic to configure and wire a composite to CompositeUtil.

Added:
    incubator/tuscany/java/sca/modules/assembly/src/test/java/org/apache/tuscany/assembly/util/
    incubator/tuscany/java/sca/modules/assembly/src/test/java/org/apache/tuscany/assembly/util/CompositeUtilTestCase.java   (with props)
    incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/contribution/processor/ArtifactProcessor.java   (with props)
    incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/contribution/processor/ContributionPostProcessor.java   (with props)
    incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/contribution/processor/PackageProcessor.java   (with props)
    incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/contribution/processor/StAXArtifactProcessor.java   (with props)
    incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/contribution/processor/URLArtifactProcessor.java   (with props)
Removed:
    incubator/tuscany/java/sca/modules/assembly/src/test/java/org/apache/tuscany/assembly/CompositeUtilTestCase.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/ContributionPostProcessorExtension.java
    incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/contribution/processor/PackageProcessorExtension.java
    incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/contribution/processor/StAXArtifactProcessorExtension.java
    incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/contribution/processor/URLArtifactProcessorExtension.java
Modified:
    incubator/tuscany/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/assembly/xml/BaseArtifactProcessor.java
    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/ComponentTypeProcessor.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/main/java/org/apache/tuscany/assembly/xml/ConstrainingTypeProcessor.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/assembly/src/main/java/org/apache/tuscany/assembly/util/CompositeUtil.java
    incubator/tuscany/java/sca/modules/binding-rmi/src/main/java/org/apache/tuscany/binding/rmi/xml/RMIBindingProcessor.java
    incubator/tuscany/java/sca/modules/binding-ws-xml/src/main/java/org/apache/tuscany/binding/ws/xml/WebServiceBindingProcessor.java
    incubator/tuscany/java/sca/modules/binding-ws-xml/src/test/java/org/apache/tuscany/binding/ws/xml/ReadTestCase.java
    incubator/tuscany/java/sca/modules/contribution-impl/src/main/java/org/apache/tuscany/contribution/processor/impl/AbstractContributionPackageProcessor.java
    incubator/tuscany/java/sca/modules/contribution-impl/src/main/java/org/apache/tuscany/contribution/processor/impl/DefaultPackageProcessorExtensionPoint.java
    incubator/tuscany/java/sca/modules/contribution-impl/src/main/java/org/apache/tuscany/contribution/processor/impl/FolderContributionProcessor.java
    incubator/tuscany/java/sca/modules/contribution-impl/src/main/java/org/apache/tuscany/contribution/processor/impl/JarContributionProcessor.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/ContributionPostProcessorExtensionPoint.java
    incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/contribution/processor/DefaultArtifactProcessorExtensionPoint.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/contribution/src/main/java/org/apache/tuscany/contribution/processor/PackageProcessorExtensionPoint.java
    incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/contribution/processor/StAXArtifactProcessorExtensionPoint.java
    incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/contribution/processor/URLArtifactProcessorExtensionPoint.java
    incubator/tuscany/java/sca/modules/core-spring/src/main/java/org/apache/tuscany/core/spring/runtime/ComponentContext.java
    incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/core/runtime/DefaultCompositeActivator.java
    incubator/tuscany/java/sca/modules/databinding-sdo/src/main/java/org/apache/tuscany/databinding/sdo/ImportSDOProcessor.java
    incubator/tuscany/java/sca/modules/host-embedded/src/main/java/org/apache/tuscany/host/embedded/impl/SimpleRuntimeImpl.java
    incubator/tuscany/java/sca/modules/host-embedded/src/test/java/crud/CRUDImplementationProcessor.java
    incubator/tuscany/java/sca/modules/implementation-java-xml/src/main/java/org/apache/tuscany/implementation/java/xml/JavaImplementationProcessor.java
    incubator/tuscany/java/sca/modules/implementation-java-xml/src/test/java/org/apache/tuscany/implementation/java/xml/ReadTestCase.java
    incubator/tuscany/java/sca/modules/implementation-script/src/main/java/org/apache/tuscany/implementation/script/ScriptArtifactProcessor.java
    incubator/tuscany/java/sca/modules/interface-java-xml/src/main/java/org/apache/tuscany/interfacedef/java/xml/JavaInterfaceProcessor.java
    incubator/tuscany/java/sca/modules/interface-java-xml/src/test/java/org/apache/tuscany/interfacedef/java/xml/ReadTestCase.java
    incubator/tuscany/java/sca/modules/interface-wsdl-xml/src/main/java/org/apache/tuscany/interfacedef/wsdl/xml/WSDLDocumentProcessor.java
    incubator/tuscany/java/sca/modules/interface-wsdl-xml/src/main/java/org/apache/tuscany/interfacedef/wsdl/xml/WSDLInterfaceProcessor.java
    incubator/tuscany/java/sca/modules/interface-wsdl-xml/src/main/java/org/apache/tuscany/interfacedef/wsdl/xml/XSDDocumentProcessor.java
    incubator/tuscany/java/sca/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/interfacedef/wsdl/xml/ReadTestCase.java
    incubator/tuscany/java/sca/samples/binding-echo/src/main/java/echo/EchoBindingProcessor.java
    incubator/tuscany/java/sca/samples/databinding-echo/src/main/java/echo/EchoBindingProcessor.java
    incubator/tuscany/java/sca/samples/implementation-crud/src/main/java/crud/CRUDImplementationProcessor.java

Modified: incubator/tuscany/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/assembly/xml/BaseArtifactProcessor.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/assembly/xml/BaseArtifactProcessor.java?view=diff&rev=534738&r1=534737&r2=534738
==============================================================================
--- incubator/tuscany/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/assembly/xml/BaseArtifactProcessor.java (original)
+++ incubator/tuscany/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/assembly/xml/BaseArtifactProcessor.java Thu May  3 00:24:45 2007
@@ -51,7 +51,7 @@
 import org.apache.tuscany.assembly.Multiplicity;
 import org.apache.tuscany.assembly.Property;
 import org.apache.tuscany.assembly.Reference;
-import org.apache.tuscany.contribution.processor.StAXArtifactProcessorExtension;
+import org.apache.tuscany.contribution.processor.StAXArtifactProcessor;
 import org.apache.tuscany.contribution.resolver.ArtifactResolver;
 import org.apache.tuscany.contribution.service.ContributionReadException;
 import org.apache.tuscany.contribution.service.ContributionResolveException;
@@ -76,7 +76,7 @@
 
     protected AssemblyFactory assemblyFactory;
     protected PolicyFactory policyFactory;
-    protected StAXArtifactProcessorExtension<Object> extensionProcessor;
+    protected StAXArtifactProcessor<Object> extensionProcessor;
 
     private static final DocumentBuilderFactory domFactory = DocumentBuilderFactory.newInstance();
     static {
@@ -95,10 +95,10 @@
      * @param policyFactory
      */
     @SuppressWarnings("unchecked")
-    public BaseArtifactProcessor(AssemblyFactory factory, PolicyFactory policyFactory, StAXArtifactProcessorExtension extensionProcessor) {
+    public BaseArtifactProcessor(AssemblyFactory factory, PolicyFactory policyFactory, StAXArtifactProcessor extensionProcessor) {
         this.assemblyFactory = factory;
         this.policyFactory = policyFactory;
-        this.extensionProcessor = (StAXArtifactProcessorExtension<Object>)extensionProcessor;
+        this.extensionProcessor = (StAXArtifactProcessor<Object>)extensionProcessor;
     }
 
     /**

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=534738&r1=534737&r2=534738
==============================================================================
--- 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 Thu May  3 00:24:45 2007
@@ -29,8 +29,8 @@
 import javax.xml.stream.XMLStreamReader;
 
 import org.apache.tuscany.assembly.ComponentType;
-import org.apache.tuscany.contribution.processor.StAXArtifactProcessorExtension;
-import org.apache.tuscany.contribution.processor.URLArtifactProcessorExtension;
+import org.apache.tuscany.contribution.processor.StAXArtifactProcessor;
+import org.apache.tuscany.contribution.processor.URLArtifactProcessor;
 import org.apache.tuscany.contribution.resolver.ArtifactResolver;
 import org.apache.tuscany.contribution.service.ContributionReadException;
 import org.apache.tuscany.contribution.service.ContributionResolveException;
@@ -40,7 +40,7 @@
  * 
  * @version $Rev$ $Date$
  */
-public class ComponentTypeDocumentProcessor extends BaseArtifactProcessor implements URLArtifactProcessorExtension<ComponentType> {
+public class ComponentTypeDocumentProcessor extends BaseArtifactProcessor implements URLArtifactProcessor<ComponentType> {
     private XMLInputFactory inputFactory;
     
     /**
@@ -49,7 +49,7 @@
      * @param policyFactory
      * @param registry
      */
-    public ComponentTypeDocumentProcessor(StAXArtifactProcessorExtension staxProcessor, XMLInputFactory inputFactory) {
+    public ComponentTypeDocumentProcessor(StAXArtifactProcessor staxProcessor, XMLInputFactory inputFactory) {
         super(null, null, staxProcessor);
         this.inputFactory = inputFactory;
     }

Modified: incubator/tuscany/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/assembly/xml/ComponentTypeProcessor.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/assembly/xml/ComponentTypeProcessor.java?view=diff&rev=534738&r1=534737&r2=534738
==============================================================================
--- incubator/tuscany/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/assembly/xml/ComponentTypeProcessor.java (original)
+++ incubator/tuscany/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/assembly/xml/ComponentTypeProcessor.java Thu May  3 00:24:45 2007
@@ -39,7 +39,7 @@
 import org.apache.tuscany.assembly.Property;
 import org.apache.tuscany.assembly.Reference;
 import org.apache.tuscany.assembly.Service;
-import org.apache.tuscany.contribution.processor.StAXArtifactProcessorExtension;
+import org.apache.tuscany.contribution.processor.StAXArtifactProcessor;
 import org.apache.tuscany.contribution.resolver.ArtifactResolver;
 import org.apache.tuscany.contribution.service.ContributionReadException;
 import org.apache.tuscany.contribution.service.ContributionResolveException;
@@ -53,7 +53,7 @@
  * 
  * @version $Rev$ $Date$
  */
-public class ComponentTypeProcessor extends BaseArtifactProcessor implements StAXArtifactProcessorExtension<ComponentType> {
+public class ComponentTypeProcessor extends BaseArtifactProcessor implements StAXArtifactProcessor<ComponentType> {
     
     /**
      * Constructs a new componentType processor.
@@ -61,7 +61,7 @@
      * @param policyFactory
      * @param registry
      */
-    public ComponentTypeProcessor(AssemblyFactory factory, PolicyFactory policyFactory, StAXArtifactProcessorExtension extensionProcessor) {
+    public ComponentTypeProcessor(AssemblyFactory factory, PolicyFactory policyFactory, StAXArtifactProcessor extensionProcessor) {
         super(factory, policyFactory, extensionProcessor);
     }
     

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=534738&r1=534737&r2=534738
==============================================================================
--- 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 Thu May  3 00:24:45 2007
@@ -29,8 +29,8 @@
 import javax.xml.stream.XMLStreamReader;
 
 import org.apache.tuscany.assembly.Composite;
-import org.apache.tuscany.contribution.processor.StAXArtifactProcessorExtension;
-import org.apache.tuscany.contribution.processor.URLArtifactProcessorExtension;
+import org.apache.tuscany.contribution.processor.StAXArtifactProcessor;
+import org.apache.tuscany.contribution.processor.URLArtifactProcessor;
 import org.apache.tuscany.contribution.resolver.ArtifactResolver;
 import org.apache.tuscany.contribution.service.ContributionReadException;
 import org.apache.tuscany.contribution.service.ContributionResolveException;
@@ -40,7 +40,7 @@
  * 
  * @version $Rev$ $Date$
  */
-public class CompositeDocumentProcessor extends BaseArtifactProcessor implements URLArtifactProcessorExtension<Composite> {
+public class CompositeDocumentProcessor extends BaseArtifactProcessor implements URLArtifactProcessor<Composite> {
     private XMLInputFactory inputFactory;
 
     /**
@@ -49,7 +49,7 @@
      * @param policyFactory
      * @param staxProcessor
      */
-    public CompositeDocumentProcessor(StAXArtifactProcessorExtension staxProcessor, XMLInputFactory inputFactory) {
+    public CompositeDocumentProcessor(StAXArtifactProcessor staxProcessor, XMLInputFactory inputFactory) {
         super(null, null, staxProcessor);
         this.inputFactory = inputFactory;
     }

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=534738&r1=534737&r2=534738
==============================================================================
--- 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 Thu May  3 00:24:45 2007
@@ -51,7 +51,7 @@
 import org.apache.tuscany.assembly.Service;
 import org.apache.tuscany.assembly.Wire;
 import org.apache.tuscany.assembly.util.CompositeUtil;
-import org.apache.tuscany.contribution.processor.StAXArtifactProcessorExtension;
+import org.apache.tuscany.contribution.processor.StAXArtifactProcessor;
 import org.apache.tuscany.contribution.resolver.ArtifactResolver;
 import org.apache.tuscany.contribution.service.ContributionReadException;
 import org.apache.tuscany.contribution.service.ContributionResolveException;
@@ -67,7 +67,7 @@
  * 
  * @version $Rev$ $Date$
  */
-public class CompositeProcessor extends BaseArtifactProcessor implements StAXArtifactProcessorExtension<Composite> {
+public class CompositeProcessor extends BaseArtifactProcessor implements StAXArtifactProcessor<Composite> {
     
     private InterfaceContractMapper interfaceContractMapper;
 
@@ -79,7 +79,7 @@
      */
     public CompositeProcessor(AssemblyFactory factory, PolicyFactory policyFactory,
                               InterfaceContractMapper interfaceContractMapper,
-                              StAXArtifactProcessorExtension extensionProcessor) {
+                              StAXArtifactProcessor extensionProcessor) {
         super(factory, policyFactory, extensionProcessor);
         this.interfaceContractMapper = interfaceContractMapper;
     }
@@ -481,57 +481,6 @@
         // Resolve composite services and references
         resolveContracts(composite.getServices(), resolver);
         resolveContracts(composite.getReferences(), resolver);
-    }
-
-    /**
-     * 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);
-
-        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...");
-//        }
     }
 
     public QName getArtifactType() {

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=534738&r1=534737&r2=534738
==============================================================================
--- 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 Thu May  3 00:24:45 2007
@@ -29,8 +29,8 @@
 import javax.xml.stream.XMLStreamReader;
 
 import org.apache.tuscany.assembly.ConstrainingType;
-import org.apache.tuscany.contribution.processor.StAXArtifactProcessorExtension;
-import org.apache.tuscany.contribution.processor.URLArtifactProcessorExtension;
+import org.apache.tuscany.contribution.processor.StAXArtifactProcessor;
+import org.apache.tuscany.contribution.processor.URLArtifactProcessor;
 import org.apache.tuscany.contribution.resolver.ArtifactResolver;
 import org.apache.tuscany.contribution.service.ContributionReadException;
 import org.apache.tuscany.contribution.service.ContributionResolveException;
@@ -40,7 +40,7 @@
  * 
  * @version $Rev$ $Date$
  */
-public class ConstrainingTypeDocumentProcessor extends BaseArtifactProcessor implements URLArtifactProcessorExtension<ConstrainingType> {
+public class ConstrainingTypeDocumentProcessor extends BaseArtifactProcessor implements URLArtifactProcessor<ConstrainingType> {
     private XMLInputFactory inputFactory;
 
     /**
@@ -49,7 +49,7 @@
      * @param policyFactory
      * @param staxProcessor
      */
-    public ConstrainingTypeDocumentProcessor(StAXArtifactProcessorExtension staxProcessor, XMLInputFactory inputFactory) {
+    public ConstrainingTypeDocumentProcessor(StAXArtifactProcessor staxProcessor, XMLInputFactory inputFactory) {
         super(null, null, staxProcessor);
         this.inputFactory = inputFactory;
     }

Modified: incubator/tuscany/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/assembly/xml/ConstrainingTypeProcessor.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/assembly/xml/ConstrainingTypeProcessor.java?view=diff&rev=534738&r1=534737&r2=534738
==============================================================================
--- incubator/tuscany/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/assembly/xml/ConstrainingTypeProcessor.java (original)
+++ incubator/tuscany/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/assembly/xml/ConstrainingTypeProcessor.java Thu May  3 00:24:45 2007
@@ -33,7 +33,7 @@
 import org.apache.tuscany.assembly.AbstractService;
 import org.apache.tuscany.assembly.AssemblyFactory;
 import org.apache.tuscany.assembly.ConstrainingType;
-import org.apache.tuscany.contribution.processor.StAXArtifactProcessorExtension;
+import org.apache.tuscany.contribution.processor.StAXArtifactProcessor;
 import org.apache.tuscany.contribution.resolver.ArtifactResolver;
 import org.apache.tuscany.contribution.service.ContributionReadException;
 import org.apache.tuscany.contribution.service.ContributionResolveException;
@@ -47,7 +47,7 @@
  * 
  * @version $Rev$ $Date$
  */
-public class ConstrainingTypeProcessor extends BaseArtifactProcessor implements StAXArtifactProcessorExtension<ConstrainingType> {
+public class ConstrainingTypeProcessor extends BaseArtifactProcessor implements StAXArtifactProcessor<ConstrainingType> {
 
     /**
      * Construct a new constrainingType processor.
@@ -55,7 +55,7 @@
      * @param policyFactory
      * @param extensionProcessor
      */
-    public ConstrainingTypeProcessor(AssemblyFactory factory, PolicyFactory policyFactory, StAXArtifactProcessorExtension extensionProcessor) {
+    public ConstrainingTypeProcessor(AssemblyFactory factory, PolicyFactory policyFactory, StAXArtifactProcessor extensionProcessor) {
         super(factory, policyFactory, extensionProcessor);
     }
 

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=534738&r1=534737&r2=534738
==============================================================================
--- 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 Thu May  3 00:24:45 2007
@@ -37,7 +37,6 @@
 import org.apache.tuscany.assembly.Property;
 import org.apache.tuscany.assembly.impl.DefaultAssemblyFactory;
 import org.apache.tuscany.contribution.processor.DefaultStAXArtifactProcessorExtensionPoint;
-import org.apache.tuscany.contribution.resolver.DefaultArtifactResolver;
 import org.apache.tuscany.interfacedef.InterfaceContractMapper;
 import org.apache.tuscany.interfacedef.impl.DefaultInterfaceContractMapper;
 import org.apache.tuscany.policy.PolicyFactory;
@@ -52,8 +51,6 @@
  */
 public class ReadAllTestCase extends TestCase {
     private DefaultStAXArtifactProcessorExtensionPoint staxProcessors;
-    private DefaultArtifactResolver resolver; 
-    private CompositeProcessor compositeProcessor;
 
     public void setUp() throws Exception {
         AssemblyFactory factory = new DefaultAssemblyFactory();
@@ -61,17 +58,13 @@
         InterfaceContractMapper mapper = new DefaultInterfaceContractMapper();
         
         staxProcessors = new DefaultStAXArtifactProcessorExtensionPoint();
-        compositeProcessor = new CompositeProcessor(factory, policyFactory, mapper, staxProcessors);
-        staxProcessors.addExtension(compositeProcessor);
+        staxProcessors.addExtension(new CompositeProcessor(factory, policyFactory, mapper, staxProcessors));
         staxProcessors.addExtension(new ComponentTypeProcessor(factory, policyFactory, staxProcessors));
         staxProcessors.addExtension(new ConstrainingTypeProcessor(factory, policyFactory, staxProcessors));
-
-        resolver = new DefaultArtifactResolver(getClass().getClassLoader());
     }
 
     public void tearDown() throws Exception {
         staxProcessors = null;
-        resolver = null;
     }
 
     public void testReadComposite() throws Exception {
@@ -155,34 +148,6 @@
         assertEquals(calcCompositeReference.getPolicySets().get(0).getName(), new QName("http://test/secure", "secure"));
         assertNotNull(calcCallback);
         // TODO test operations
-
-        //new PrintUtil(System.out).print(composite);
-    }
-
-    public void testReadCompositeAndWireIt() throws Exception {
-
-        InputStream is = getClass().getResourceAsStream("TestAllDivide.composite");
-        Composite included = staxProcessors.read(is, Composite.class);
-        assertNotNull(included);
-        resolver.add(included);
-        
-        is = getClass().getResourceAsStream("TestAllCalculator.composite");
-        Composite composite = staxProcessors.read(is, Composite.class);
-        assertNotNull(composite);
-        staxProcessors.resolve(composite, resolver);
-        compositeProcessor.configureAndWire(composite);
-
-        Component calcComponent = composite.getComponents().get(0);
-        CompositeService calcCompositeService = (CompositeService)composite.getServices().get(0);
-        assertEquals(calcComponent.getServices().get(0), calcCompositeService.getPromotedService());
-
-        ComponentReference multiplyReference = calcComponent.getReferences().get(2);
-        CompositeReference calcCompositeReference = (CompositeReference)composite.getReferences().get(0);
-        assertEquals(multiplyReference, calcCompositeReference.getPromotedReferences().get(0));
-
-        Component addComponent = composite.getComponents().get(1);
-        ComponentReference addReference = calcComponent.getReferences().get(0);
-        assertEquals(addReference.getTargets().get(0), addComponent.getServices().get(0));
 
         //new PrintUtil(System.out).print(composite);
     }

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=534738&r1=534737&r2=534738
==============================================================================
--- 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 Thu May  3 00:24:45 2007
@@ -20,6 +20,7 @@
 package org.apache.tuscany.assembly.xml;
 
 import java.io.InputStream;
+import java.util.ArrayList;
 
 import javax.xml.stream.XMLInputFactory;
 import javax.xml.stream.XMLStreamReader;
@@ -27,9 +28,11 @@
 import junit.framework.TestCase;
 
 import org.apache.tuscany.assembly.AssemblyFactory;
+import org.apache.tuscany.assembly.Base;
 import org.apache.tuscany.assembly.Composite;
 import org.apache.tuscany.assembly.ConstrainingType;
 import org.apache.tuscany.assembly.impl.DefaultAssemblyFactory;
+import org.apache.tuscany.assembly.util.CompositeUtil;
 import org.apache.tuscany.contribution.processor.DefaultStAXArtifactProcessorExtensionPoint;
 import org.apache.tuscany.contribution.resolver.DefaultArtifactResolver;
 import org.apache.tuscany.interfacedef.InterfaceContractMapper;
@@ -86,7 +89,8 @@
         assertNotNull(composite);
         
         compositeReader.resolve(composite, resolver);
-        compositeReader.configureAndWire(composite);
+        CompositeUtil compositeUtil = new CompositeUtil(factory, mapper);
+        compositeUtil.configureAndWire(composite, new ArrayList<Base>());
         
         assertEquals(composite.getConstrainingType(), constrainingType);
         assertEquals(composite.getComponents().get(0).getConstrainingType(), constrainingType);
@@ -108,7 +112,8 @@
         is.close();
         
         compositeReader.resolve(composite, resolver);
-        compositeReader.configureAndWire(composite);
+        CompositeUtil compositeUtil = new CompositeUtil(factory, mapper);
+        compositeUtil.configureAndWire(composite, new ArrayList<Base>());
         
         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=534738&r1=534737&r2=534738
==============================================================================
--- 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 Thu May  3 00:24:45 2007
@@ -21,14 +21,17 @@
 
 import java.io.ByteArrayOutputStream;
 import java.io.InputStream;
+import java.util.ArrayList;
 
 import junit.framework.TestCase;
 
 import org.apache.tuscany.assembly.AssemblyFactory;
+import org.apache.tuscany.assembly.Base;
 import org.apache.tuscany.assembly.ComponentType;
 import org.apache.tuscany.assembly.Composite;
 import org.apache.tuscany.assembly.ConstrainingType;
 import org.apache.tuscany.assembly.impl.DefaultAssemblyFactory;
+import org.apache.tuscany.assembly.util.CompositeUtil;
 import org.apache.tuscany.contribution.processor.DefaultStAXArtifactProcessorExtensionPoint;
 import org.apache.tuscany.contribution.resolver.DefaultArtifactResolver;
 import org.apache.tuscany.interfacedef.InterfaceContractMapper;
@@ -47,16 +50,16 @@
     private AssemblyFactory factory;
     private PolicyFactory policyFactory;
     private InterfaceContractMapper mapper;
-    private CompositeProcessor compositeProcessor;
+    private CompositeUtil compositeUtil;
 
 
     public void setUp() throws Exception {
         factory = new DefaultAssemblyFactory();
         policyFactory = new DefaultPolicyFactory();
         mapper = new DefaultInterfaceContractMapper();
+        compositeUtil = new CompositeUtil(factory, mapper);
         staxProcessors = new DefaultStAXArtifactProcessorExtensionPoint();
-        compositeProcessor = new CompositeProcessor(factory, policyFactory, mapper, staxProcessors);
-        staxProcessors.addExtension(compositeProcessor);
+        staxProcessors.addExtension(new CompositeProcessor(factory, policyFactory, mapper, staxProcessors));
         staxProcessors.addExtension(new ComponentTypeProcessor(factory, policyFactory, staxProcessors));
         staxProcessors.addExtension(new ConstrainingTypeProcessor(factory, policyFactory, staxProcessors));
         resolver = new DefaultArtifactResolver(getClass().getClassLoader());
@@ -81,7 +84,7 @@
         InputStream is = getClass().getResourceAsStream("TestAllCalculator.composite");
         Composite composite = staxProcessors.read(is, Composite.class);
         staxProcessors.resolve(composite, resolver);
-        compositeProcessor.configureAndWire(composite);
+        compositeUtil.configureAndWire(composite, new ArrayList<Base>());
         ByteArrayOutputStream bos = new ByteArrayOutputStream();
         staxProcessors.write(composite, bos);
     }

Modified: incubator/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/assembly/util/CompositeUtil.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/assembly/util/CompositeUtil.java?view=diff&rev=534738&r1=534737&r2=534738
==============================================================================
--- incubator/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/assembly/util/CompositeUtil.java (original)
+++ incubator/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/assembly/util/CompositeUtil.java Thu May  3 00:24:45 2007
@@ -64,6 +64,54 @@
         this.assemblyFactory = assemblyFactory;
         this.interfaceContractMapper = interfaceContractMapper;
     }
+    
+    /**
+     * Configure and wire a composite.
+     * 
+     * @param composite
+     * @param problems
+     */
+    public void configureAndWire(Composite composite, List<Base> problems) {
+        
+        // Collect and fuse includes
+        fuseIncludes(composite, problems);
+
+        // Expand nested composites
+        expandComposites(composite, problems);
+
+        // Configure all components
+        configureComponents(composite, problems);
+
+        // Wire the composite
+        wireComposite(composite, problems);
+
+        // Activate composite services
+        activateCompositeServices(composite, problems);
+
+        // Wire composite references
+        wireCompositeReferences(composite, problems);
+    }
+
+    /**
+     * Configure and wire a composite.
+     * 
+     * @param composite
+     * @param problems
+     * 
+     * @deprecated
+     */
+    public void oldConfigureAndWire(Composite composite, List<Base> problems) {
+        
+        // Collect and fuse includes
+        fuseIncludes(composite, problems);
+
+        // Configure all components
+        configureComponents(composite, problems);
+
+        // Wire the composite
+        wireComposite(composite, problems);
+
+    }
 
     /**
      * Collect all includes in a graph of includes.
@@ -84,7 +132,7 @@
      * @param composite
      * @param includes
      */
-    public void fuseIncludes(Composite composite, List<Base> problems) {
+    protected void fuseIncludes(Composite composite, List<Base> problems) {
         
         // First collect all includes
         List<Composite> includes = new ArrayList<Composite>();
@@ -353,7 +401,7 @@
      * @param composite
      * @param problems
      */
-    public void configureComponents(Composite composite, List<Base> problems) {
+    protected void configureComponents(Composite composite, List<Base> problems) {
         configureComponents(composite, null, problems);
     }
 
@@ -856,7 +904,7 @@
      * @param composite
      * @param problems
      */
-    public void activateCompositeServices(Composite composite, List<Base> problems)  {
+    protected void activateCompositeServices(Composite composite, List<Base> problems)  {
         
         // Process nested composites recursively
         for (Component component: composite.getComponents()) {
@@ -876,8 +924,12 @@
                             
                             // Add the component service to the innermost promoted component
                             SCABinding scaBinding = promotedService.getBinding(SCABinding.class);
-                            Component promotedComponent = scaBinding.getComponent();
-                            promotedComponent.getServices().add(componentService);
+                            if (scaBinding != null) {
+                                Component promotedComponent = scaBinding.getComponent();
+                                promotedComponent.getServices().add(componentService);
+                            } else {
+                                problems.add(promotedService);
+                            }
                         }
                     }
                 }
@@ -892,20 +944,24 @@
 
                 // Create a new component service to represent this composite service
                 // on the promoted component
-                ComponentService newComponentService = assemblyFactory.createComponentService();
-                newComponentService.setName(null);
-                newComponentService.setService(compositeService);
                 SCABinding scaBinding = promotedService.getBinding(SCABinding.class);
-                Component component = scaBinding.getComponent();
-                component.getServices().add(newComponentService);
-                newComponentService.getBindings().add(scaBinding);
-                newComponentService.getBindings().addAll(compositeService.getBindings());
-                newComponentService.setInterfaceContract(compositeService.getInterfaceContract());
-                newComponentService.setCallback(compositeService.getCallback());
-                
-                // Change the composite service to now promote the newly created
-                // component service directly
-                compositeService.setPromotedService(newComponentService);
+                if (scaBinding != null) {
+                    Component component = scaBinding.getComponent();
+                    ComponentService newComponentService = assemblyFactory.createComponentService();
+                    newComponentService.setName(null);
+                    newComponentService.setService(compositeService);
+                    component.getServices().add(newComponentService);
+                    newComponentService.getBindings().add(scaBinding);
+                    newComponentService.getBindings().addAll(compositeService.getBindings());
+                    newComponentService.setInterfaceContract(compositeService.getInterfaceContract());
+                    newComponentService.setCallback(compositeService.getCallback());
+                    
+                    // Change the composite service to now promote the newly created
+                    // component service directly
+                    compositeService.setPromotedService(newComponentService);
+                } else {
+                    problems.add(promotedService);
+                }
             }
         }
     }
@@ -915,7 +971,7 @@
      * @param composite
      * @param problems
      */
-    public void wireCompositeReferences(Composite composite, List<Base> problems)  {
+    protected void wireCompositeReferences(Composite composite, List<Base> problems)  {
         
         // Process nested composites recursively
         for (Component component: composite.getComponents()) {
@@ -990,7 +1046,7 @@
      * @param composite
      * @param problems
      */
-    public void wireComposite(Composite composite, List<Base> problems) {
+    protected void wireComposite(Composite composite, List<Base> problems) {
         
         // Wire nested composites recursively
         for (Component component: composite.getComponents()) {
@@ -1035,7 +1091,7 @@
      * @param composite
      * @param problems
      */
-    public void expandComposites(Composite composite, List<Base> problems) {
+    protected void expandComposites(Composite composite, List<Base> problems) {
         for (Component component: composite.getComponents()) {
             Implementation implementation = component.getImplementation();
             if (implementation instanceof Composite) {

Added: incubator/tuscany/java/sca/modules/assembly/src/test/java/org/apache/tuscany/assembly/util/CompositeUtilTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/assembly/src/test/java/org/apache/tuscany/assembly/util/CompositeUtilTestCase.java?view=auto&rev=534738
==============================================================================
--- incubator/tuscany/java/sca/modules/assembly/src/test/java/org/apache/tuscany/assembly/util/CompositeUtilTestCase.java (added)
+++ incubator/tuscany/java/sca/modules/assembly/src/test/java/org/apache/tuscany/assembly/util/CompositeUtilTestCase.java Thu May  3 00:24:45 2007
@@ -0,0 +1,137 @@
+/*
+ * 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.util;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.xml.namespace.QName;
+
+import junit.framework.TestCase;
+
+import org.apache.tuscany.assembly.AssemblyFactory;
+import org.apache.tuscany.assembly.Base;
+import org.apache.tuscany.assembly.Component;
+import org.apache.tuscany.assembly.Composite;
+import org.apache.tuscany.assembly.CompositeReference;
+import org.apache.tuscany.assembly.CompositeService;
+import org.apache.tuscany.assembly.impl.DefaultAssemblyFactory;
+import org.apache.tuscany.interfacedef.impl.DefaultInterfaceContractMapper;
+
+public class CompositeUtilTestCase extends TestCase {
+    
+    private CompositeUtil compositeUtil;
+    private AssemblyFactory factory;
+    private List<Base> problems;
+    
+    protected void setUp() throws Exception {
+        factory = new DefaultAssemblyFactory();
+        compositeUtil = new CompositeUtil(factory, new DefaultInterfaceContractMapper());
+        problems = new ArrayList<Base>();
+    }
+    
+    protected void tearDown() throws Exception {
+        compositeUtil = null;
+        factory = null;
+        problems = null;
+    }
+    
+    public void testFuseIncludes() {
+        Composite c1 = factory.createComposite();
+        c1.setName(new QName("http://foo", "C1"));
+        Component a = factory.createComponent();
+        a.setName("a");
+        c1.getComponents().add(a);
+        CompositeService s = factory.createCompositeService();
+        s.setName("s");
+        c1.getServices().add(s);
+        CompositeReference r = factory.createCompositeReference();
+        r.setName("r");
+        c1.getReferences().add(r);
+
+        Composite c2 = factory.createComposite();
+        c2.setName(new QName("http://foo", "C2"));
+        c1.getIncludes().add(c2);
+        Component b = factory.createComponent();
+        b.setName("b");
+        c2.getComponents().add(b);
+        
+        Composite c = factory.createComposite();
+        c.setName(new QName("http://foo", "C"));
+        c.getIncludes().add(c1);
+        
+        compositeUtil.fuseIncludes(c, problems);
+        
+        assertTrue(c.getComponents().get(0).getName().equals("a"));
+        assertTrue(c.getComponents().get(1).getName().equals("b"));
+        assertTrue(c.getServices().get(0).getName().equals("s"));
+        assertTrue(c.getReferences().get(0).getName().equals("r"));
+    }
+    
+    public void testExpandComposites() {
+        Composite c1 = factory.createComposite();
+        c1.setName(new QName("http://foo", "C1"));
+        Component a = factory.createComponent();
+        a.setName("a");
+        c1.getComponents().add(a);
+        CompositeService s = factory.createCompositeService();
+        s.setName("s");
+        c1.getServices().add(s);
+        CompositeReference r = factory.createCompositeReference();
+        r.setName("r");
+        c1.getReferences().add(r);
+
+        Composite c2 = factory.createComposite();
+        c2.setName(new QName("http://foo", "C2"));
+        Component b = factory.createComponent();
+        b.setName("b");
+        c2.getComponents().add(b);
+        
+        Composite c = factory.createComposite();
+        c.setName(new QName("http://foo", "C"));
+        Component x = factory.createComponent();
+        x.setName("x");
+        x.setImplementation(c1);
+        c.getComponents().add(x);
+        Component y = factory.createComponent();
+        y.setName("y");
+        y.setImplementation(c2);
+        c.getComponents().add(y);
+        Component z = factory.createComponent();
+        z.setName("z");
+        z.setImplementation(c1);
+        c.getComponents().add(z);
+        
+        compositeUtil.expandComposites(c, problems);
+        
+        assertTrue(c.getComponents().get(0).getImplementation() != c1);
+        assertTrue(c.getComponents().get(1).getImplementation() != c2);
+        assertTrue(c.getComponents().get(2).getImplementation() != c1);
+
+        Composite i = (Composite)c.getComponents().get(0).getImplementation();
+        assertTrue(i.getComponents().get(0) != a);
+        assertTrue(i.getComponents().get(0).getName().equals("a"));
+        assertTrue(i.getServices().get(0).getName().equals("s"));
+        assertTrue(i.getServices().get(0) != s);
+        assertTrue(i.getReferences().get(0).getName().equals("r"));
+        assertTrue(i.getReferences().get(0) != r);
+    }
+
+}

Propchange: incubator/tuscany/java/sca/modules/assembly/src/test/java/org/apache/tuscany/assembly/util/CompositeUtilTestCase.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/modules/assembly/src/test/java/org/apache/tuscany/assembly/util/CompositeUtilTestCase.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: incubator/tuscany/java/sca/modules/binding-rmi/src/main/java/org/apache/tuscany/binding/rmi/xml/RMIBindingProcessor.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/binding-rmi/src/main/java/org/apache/tuscany/binding/rmi/xml/RMIBindingProcessor.java?view=diff&rev=534738&r1=534737&r2=534738
==============================================================================
--- incubator/tuscany/java/sca/modules/binding-rmi/src/main/java/org/apache/tuscany/binding/rmi/xml/RMIBindingProcessor.java (original)
+++ incubator/tuscany/java/sca/modules/binding-rmi/src/main/java/org/apache/tuscany/binding/rmi/xml/RMIBindingProcessor.java Thu May  3 00:24:45 2007
@@ -32,7 +32,7 @@
 import org.apache.tuscany.binding.rmi.RMIBinding;
 import org.apache.tuscany.binding.rmi.RMIBindingConstants;
 import org.apache.tuscany.binding.rmi.RMIBindingFactory;
-import org.apache.tuscany.contribution.processor.StAXArtifactProcessorExtension;
+import org.apache.tuscany.contribution.processor.StAXArtifactProcessor;
 import org.apache.tuscany.contribution.resolver.ArtifactResolver;
 import org.apache.tuscany.contribution.service.ContributionReadException;
 import org.apache.tuscany.contribution.service.ContributionResolveException;
@@ -40,7 +40,7 @@
 import org.apache.tuscany.policy.PolicyFactory;
 
 public class RMIBindingProcessor extends BaseArtifactProcessor implements
-    StAXArtifactProcessorExtension<RMIBinding>, RMIBindingConstants {
+    StAXArtifactProcessor<RMIBinding>, RMIBindingConstants {
 
     private RMIBindingFactory rmiBindingFactory;
 

Modified: incubator/tuscany/java/sca/modules/binding-ws-xml/src/main/java/org/apache/tuscany/binding/ws/xml/WebServiceBindingProcessor.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/binding-ws-xml/src/main/java/org/apache/tuscany/binding/ws/xml/WebServiceBindingProcessor.java?view=diff&rev=534738&r1=534737&r2=534738
==============================================================================
--- incubator/tuscany/java/sca/modules/binding-ws-xml/src/main/java/org/apache/tuscany/binding/ws/xml/WebServiceBindingProcessor.java (original)
+++ incubator/tuscany/java/sca/modules/binding-ws-xml/src/main/java/org/apache/tuscany/binding/ws/xml/WebServiceBindingProcessor.java Thu May  3 00:24:45 2007
@@ -37,7 +37,7 @@
 import org.apache.tuscany.assembly.xml.Constants;
 import org.apache.tuscany.binding.ws.WebServiceBinding;
 import org.apache.tuscany.binding.ws.WebServiceBindingFactory;
-import org.apache.tuscany.contribution.processor.StAXArtifactProcessorExtension;
+import org.apache.tuscany.contribution.processor.StAXArtifactProcessor;
 import org.apache.tuscany.contribution.resolver.ArtifactResolver;
 import org.apache.tuscany.contribution.service.ContributionReadException;
 import org.apache.tuscany.contribution.service.ContributionResolveException;
@@ -51,7 +51,7 @@
 import org.apache.tuscany.policy.PolicyFactory;
 
 public class WebServiceBindingProcessor extends BaseArtifactProcessor implements
-    StAXArtifactProcessorExtension<WebServiceBinding>, WebServiceConstants {
+    StAXArtifactProcessor<WebServiceBinding>, WebServiceConstants {
 
     private WSDLFactory wsdlFactory;
     private WSDLInterfaceIntrospector introspector;

Modified: incubator/tuscany/java/sca/modules/binding-ws-xml/src/test/java/org/apache/tuscany/binding/ws/xml/ReadTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/binding-ws-xml/src/test/java/org/apache/tuscany/binding/ws/xml/ReadTestCase.java?view=diff&rev=534738&r1=534737&r2=534738
==============================================================================
--- incubator/tuscany/java/sca/modules/binding-ws-xml/src/test/java/org/apache/tuscany/binding/ws/xml/ReadTestCase.java (original)
+++ incubator/tuscany/java/sca/modules/binding-ws-xml/src/test/java/org/apache/tuscany/binding/ws/xml/ReadTestCase.java Thu May  3 00:24:45 2007
@@ -106,9 +106,7 @@
         assertNotNull(composite);
 
         CompositeUtil compositeUtil = new CompositeUtil(factory, mapper);
-        compositeUtil.fuseIncludes(composite, new ArrayList<Base>());
-        compositeUtil.configureComponents(composite, new ArrayList<Base>());
-        compositeUtil.wireComposite(composite, new ArrayList<Base>());
+        compositeUtil.configureAndWire(composite, new ArrayList<Base>());
 
         //new PrintUtil(System.out).print(composite);
     }

Modified: incubator/tuscany/java/sca/modules/contribution-impl/src/main/java/org/apache/tuscany/contribution/processor/impl/AbstractContributionPackageProcessor.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/contribution-impl/src/main/java/org/apache/tuscany/contribution/processor/impl/AbstractContributionPackageProcessor.java?view=diff&rev=534738&r1=534737&r2=534738
==============================================================================
--- incubator/tuscany/java/sca/modules/contribution-impl/src/main/java/org/apache/tuscany/contribution/processor/impl/AbstractContributionPackageProcessor.java (original)
+++ incubator/tuscany/java/sca/modules/contribution-impl/src/main/java/org/apache/tuscany/contribution/processor/impl/AbstractContributionPackageProcessor.java Thu May  3 00:24:45 2007
@@ -23,7 +23,7 @@
 import java.net.URI;
 import java.net.URL;
 
-import org.apache.tuscany.contribution.processor.PackageProcessorExtension;
+import org.apache.tuscany.contribution.processor.PackageProcessor;
 import org.apache.tuscany.contribution.processor.PackageProcessorExtensionPoint;
 
 /**
@@ -31,7 +31,7 @@
  * 
  * @version $Rev$ $Date$
  */
-public abstract class AbstractContributionPackageProcessor implements PackageProcessorExtension {
+public abstract class AbstractContributionPackageProcessor implements PackageProcessor {
     /**
      * The ContributionProcessorRegistry that this processor should register
      * with; usually set by injection. This registry may also be used to process

Modified: incubator/tuscany/java/sca/modules/contribution-impl/src/main/java/org/apache/tuscany/contribution/processor/impl/DefaultPackageProcessorExtensionPoint.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/contribution-impl/src/main/java/org/apache/tuscany/contribution/processor/impl/DefaultPackageProcessorExtensionPoint.java?view=diff&rev=534738&r1=534737&r2=534738
==============================================================================
--- incubator/tuscany/java/sca/modules/contribution-impl/src/main/java/org/apache/tuscany/contribution/processor/impl/DefaultPackageProcessorExtensionPoint.java (original)
+++ incubator/tuscany/java/sca/modules/contribution-impl/src/main/java/org/apache/tuscany/contribution/processor/impl/DefaultPackageProcessorExtensionPoint.java Thu May  3 00:24:45 2007
@@ -28,7 +28,7 @@
 import java.util.List;
 import java.util.Map;
 
-import org.apache.tuscany.contribution.processor.PackageProcessorExtension;
+import org.apache.tuscany.contribution.processor.PackageProcessor;
 import org.apache.tuscany.contribution.processor.PackageProcessorExtensionPoint;
 import org.apache.tuscany.contribution.service.ContributionException;
 import org.apache.tuscany.contribution.service.TypeDescriber;
@@ -44,7 +44,7 @@
     /**
      * Processor registry
      */
-    private Map<String, PackageProcessorExtension> registry = new HashMap<String, PackageProcessorExtension>();
+    private Map<String, PackageProcessor> registry = new HashMap<String, PackageProcessor>();
 
     /**
      * Helper method to describe contentType for each artifact
@@ -59,7 +59,7 @@
         }
     }
 
-    public void register(String contentType, PackageProcessorExtension processor) {
+    public void register(String contentType, PackageProcessor processor) {
         registry.put(contentType, processor);
     }
 
@@ -74,7 +74,7 @@
             throw new UnsupportedContentTypeException("Unsupported contribution package", packageSourceURL.toString());
         }
 
-        PackageProcessorExtension packageProcessor = this.registry.get(contentType);
+        PackageProcessor packageProcessor = this.registry.get(contentType);
         if (packageProcessor == null) {
             throw new UnsupportedContentTypeException(contentType, packageSourceURL.getPath());
         }
@@ -84,7 +84,7 @@
 
     public URL getArtifactURL(URL packageSourceURL, URI artifact) throws MalformedURLException {
         String contentType = this.packageTypeDescriber.getType(packageSourceURL, null);
-        PackageProcessorExtension packageProcessor = this.registry.get(contentType);
+        PackageProcessor packageProcessor = this.registry.get(contentType);
         return packageProcessor.getArtifactURL(packageSourceURL, artifact);
     }
 }

Modified: incubator/tuscany/java/sca/modules/contribution-impl/src/main/java/org/apache/tuscany/contribution/processor/impl/FolderContributionProcessor.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/contribution-impl/src/main/java/org/apache/tuscany/contribution/processor/impl/FolderContributionProcessor.java?view=diff&rev=534738&r1=534737&r2=534738
==============================================================================
--- incubator/tuscany/java/sca/modules/contribution-impl/src/main/java/org/apache/tuscany/contribution/processor/impl/FolderContributionProcessor.java (original)
+++ incubator/tuscany/java/sca/modules/contribution-impl/src/main/java/org/apache/tuscany/contribution/processor/impl/FolderContributionProcessor.java Thu May  3 00:24:45 2007
@@ -30,13 +30,13 @@
 import java.util.List;
 
 import org.apache.tuscany.contribution.ContentType;
-import org.apache.tuscany.contribution.processor.PackageProcessorExtension;
+import org.apache.tuscany.contribution.processor.PackageProcessor;
 import org.apache.tuscany.contribution.processor.PackageProcessorExtensionPoint;
 import org.apache.tuscany.contribution.service.ContributionException;
 import org.apache.tuscany.contribution.service.util.FileHelper;
 
 public class FolderContributionProcessor extends AbstractContributionPackageProcessor implements
-    PackageProcessorExtension {
+    PackageProcessor {
     /**
      * Package-type that this package processor can handle
      */

Modified: incubator/tuscany/java/sca/modules/contribution-impl/src/main/java/org/apache/tuscany/contribution/processor/impl/JarContributionProcessor.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/contribution-impl/src/main/java/org/apache/tuscany/contribution/processor/impl/JarContributionProcessor.java?view=diff&rev=534738&r1=534737&r2=534738
==============================================================================
--- incubator/tuscany/java/sca/modules/contribution-impl/src/main/java/org/apache/tuscany/contribution/processor/impl/JarContributionProcessor.java (original)
+++ incubator/tuscany/java/sca/modules/contribution-impl/src/main/java/org/apache/tuscany/contribution/processor/impl/JarContributionProcessor.java Thu May  3 00:24:45 2007
@@ -30,12 +30,12 @@
 import java.util.jar.JarInputStream;
 
 import org.apache.tuscany.contribution.ContentType;
-import org.apache.tuscany.contribution.processor.PackageProcessorExtension;
+import org.apache.tuscany.contribution.processor.PackageProcessor;
 import org.apache.tuscany.contribution.processor.PackageProcessorExtensionPoint;
 import org.apache.tuscany.contribution.service.ContributionException;
 
 public class JarContributionProcessor extends AbstractContributionPackageProcessor implements
-    PackageProcessorExtension {
+    PackageProcessor {
     /**
      * Package-type that this package processor can handle
      */

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=534738&r1=534737&r2=534738
==============================================================================
--- 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 Thu May  3 00:24:45 2007
@@ -38,8 +38,8 @@
 import org.apache.tuscany.contribution.Contribution;
 import org.apache.tuscany.contribution.ContributionFactory;
 import org.apache.tuscany.contribution.DeployedArtifact;
-import org.apache.tuscany.contribution.processor.PackageProcessorExtension;
-import org.apache.tuscany.contribution.processor.URLArtifactProcessorExtension;
+import org.apache.tuscany.contribution.processor.PackageProcessor;
+import org.apache.tuscany.contribution.processor.URLArtifactProcessor;
 import org.apache.tuscany.contribution.resolver.ArtifactResolver;
 import org.apache.tuscany.contribution.service.ContributionException;
 import org.apache.tuscany.contribution.service.ContributionMetadataLoaderException;
@@ -60,13 +60,13 @@
     /**
      * Registry of available package processors.
      */
-    protected PackageProcessorExtension packageProcessor;
+    protected PackageProcessor packageProcessor;
 
     /**
      * Registry of available artifact processors
      */
 
-    protected URLArtifactProcessorExtension artifactProcessor;
+    protected URLArtifactProcessor artifactProcessor;
 
     /**
      * Artifact Resolver
@@ -95,8 +95,8 @@
     
     
     public ContributionServiceImpl(ContributionRepository repository,
-                                   PackageProcessorExtension packageProcessor,
-                                   URLArtifactProcessorExtension artifactProcessor,
+                                   PackageProcessor packageProcessor,
+                                   URLArtifactProcessor artifactProcessor,
                                    ArtifactResolver artifactResolver,
                                    AssemblyFactory assemblyFactory,
                                    ContributionFactory contributionFactory) {

Added: incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/contribution/processor/ArtifactProcessor.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/contribution/processor/ArtifactProcessor.java?view=auto&rev=534738
==============================================================================
--- incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/contribution/processor/ArtifactProcessor.java (added)
+++ incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/contribution/processor/ArtifactProcessor.java Thu May  3 00:24:45 2007
@@ -0,0 +1,48 @@
+/*
+ * 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.contribution.processor;
+
+import org.apache.tuscany.contribution.resolver.ArtifactResolver;
+import org.apache.tuscany.contribution.service.ContributionResolveException;
+
+
+
+/**
+ * Interface for extensions that can process contributions.
+ * 
+ * @version $Rev$ $Date$
+ */
+public interface ArtifactProcessor <M> {
+    
+    /**
+     * Resolve references from this model to other models. For example references
+     * from a composite to another one, or references from a composite to a WSDL
+     * model.
+     * @param model the model to resolve
+     * @param the resolver to use to resolve referenced models
+     */
+    void resolve(M model, ArtifactResolver resolver) throws ContributionResolveException;
+    
+    /**
+     * Returns the type of model handled by this artifact processor.
+     * @return the type of model handled by this artifact processor
+     */
+    Class<M> getModelType(); 
+    
+}

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

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

Added: incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/contribution/processor/ContributionPostProcessor.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/contribution/processor/ContributionPostProcessor.java?view=auto&rev=534738
==============================================================================
--- incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/contribution/processor/ContributionPostProcessor.java (added)
+++ incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/contribution/processor/ContributionPostProcessor.java Thu May  3 00:24:45 2007
@@ -0,0 +1,31 @@
+/*
+ * 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.contribution.processor;
+
+import org.apache.tuscany.contribution.Contribution;
+
+/**
+ * A processor invoked after the contribution is loaded 
+ * 
+ * @version $Rev$ $Date$
+ */
+public interface ContributionPostProcessor {
+    void visit(Contribution contribution);
+}

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

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

Modified: incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/contribution/processor/ContributionPostProcessorExtensionPoint.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/contribution/processor/ContributionPostProcessorExtensionPoint.java?view=diff&rev=534738&r1=534737&r2=534738
==============================================================================
--- incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/contribution/processor/ContributionPostProcessorExtensionPoint.java (original)
+++ incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/contribution/processor/ContributionPostProcessorExtensionPoint.java Thu May  3 00:24:45 2007
@@ -29,10 +29,10 @@
      * Add a ContributionPostProcessor
      * @param processor
      */
-    void addExtension(ContributionPostProcessorExtension processor);
+    void addExtension(ContributionPostProcessor processor);
     /**
      * Remove a ContributionPostProcessor
      * @param processor
      */
-    void removeExtension(ContributionPostProcessorExtension processor);
+    void removeExtension(ContributionPostProcessor processor);
 }

Modified: incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/contribution/processor/DefaultArtifactProcessorExtensionPoint.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/contribution/processor/DefaultArtifactProcessorExtensionPoint.java?view=diff&rev=534738&r1=534737&r2=534738
==============================================================================
--- incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/contribution/processor/DefaultArtifactProcessorExtensionPoint.java (original)
+++ incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/contribution/processor/DefaultArtifactProcessorExtensionPoint.java Thu May  3 00:24:45 2007
@@ -28,10 +28,10 @@
  * @version $Rev$ $Date$
  */
 abstract class DefaultArtifactProcessorExtensionPoint {
-    protected final Map<Object, ArtifactProcessorExtension> processorsByArtifactType = 
-        new HashMap<Object, ArtifactProcessorExtension>();
-    protected final Map<Class<?>, ArtifactProcessorExtension> processorsByModelType = 
-        new HashMap<Class<?>, ArtifactProcessorExtension>();
+    protected final Map<Object, ArtifactProcessor> processorsByArtifactType = 
+        new HashMap<Object, ArtifactProcessor>();
+    protected final Map<Class<?>, ArtifactProcessor> processorsByModelType = 
+        new HashMap<Class<?>, ArtifactProcessor>();
 
     /**
      * Constructs a new loader registry.
@@ -44,7 +44,7 @@
      * @param artifactType an artifact type
      * @return the processor associated with the given artifact type
      */
-    protected ArtifactProcessorExtension getProcessor(Object artifactType) {
+    protected ArtifactProcessor getProcessor(Object artifactType) {
         return processorsByArtifactType.get(artifactType);
     }
 
@@ -53,10 +53,10 @@
      * @param modelType a model type
      * @return the processor associated with the given model type
      */
-    protected ArtifactProcessorExtension getProcessor(Class<?> modelType) {
+    protected ArtifactProcessor getProcessor(Class<?> modelType) {
         Class<?>[] classes = modelType.getInterfaces();
         for (Class<?> c : classes) {
-            ArtifactProcessorExtension processor = processorsByModelType.get(c);
+            ArtifactProcessor processor = processorsByModelType.get(c);
             if (processor != null) {
                 return 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=534738&r1=534737&r2=534738
==============================================================================
--- 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 Thu May  3 00:24:45 2007
@@ -43,7 +43,7 @@
  */
 public class DefaultStAXArtifactProcessorExtensionPoint
     extends DefaultArtifactProcessorExtensionPoint
-    implements StAXArtifactProcessorExtensionPoint, StAXArtifactProcessorExtension<Object> {
+    implements StAXArtifactProcessorExtensionPoint, StAXArtifactProcessor<Object> {
 
     private XMLInputFactory inputFactory;
     private XMLOutputFactory outputFactory;
@@ -69,7 +69,7 @@
         
         // Delegate to the processor associated with the element qname
         QName name = source.getName();
-        StAXArtifactProcessorExtension<?> processor = (StAXArtifactProcessorExtension<?>)this.getProcessor(name);
+        StAXArtifactProcessor<?> processor = (StAXArtifactProcessor<?>)this.getProcessor(name);
         if (processor == null) {
             return null;
         }
@@ -81,8 +81,8 @@
         
         // Delegate to the processor associated with the model type
         if (model != null) {
-            StAXArtifactProcessorExtension<Object> processor = 
-                (StAXArtifactProcessorExtension<Object>)this.getProcessor((Class<Object>)model.getClass());
+            StAXArtifactProcessor<Object> processor = 
+                (StAXArtifactProcessor<Object>)this.getProcessor((Class<Object>)model.getClass());
             if (processor != null) {
                 processor.write(model, outputSource);
             }
@@ -94,8 +94,8 @@
 
         // Delegate to the processor associated with the model type
         if (model != null) {
-            StAXArtifactProcessorExtension<Object> processor = 
-                (StAXArtifactProcessorExtension<Object>)this.getProcessor((Class<Object>)model.getClass());
+            StAXArtifactProcessor<Object> processor = 
+                (StAXArtifactProcessor<Object>)this.getProcessor((Class<Object>)model.getClass());
             if (processor != null) {
                 processor.resolve(model, resolver);
             }
@@ -166,12 +166,12 @@
         }
     }
 
-    public void addExtension(StAXArtifactProcessorExtension artifactProcessor) {
+    public void addExtension(StAXArtifactProcessor artifactProcessor) {
         processorsByArtifactType.put((Object)artifactProcessor.getArtifactType(), artifactProcessor);
         processorsByModelType.put(artifactProcessor.getModelType(), artifactProcessor);
     }
     
-    public void removeExtension(StAXArtifactProcessorExtension artifactProcessor) {
+    public void removeExtension(StAXArtifactProcessor artifactProcessor) {
         processorsByArtifactType.remove((Object)artifactProcessor.getArtifactType());
         processorsByModelType.remove(artifactProcessor.getModelType());        
     }

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=534738&r1=534737&r2=534738
==============================================================================
--- 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 Thu May  3 00:24:45 2007
@@ -33,7 +33,7 @@
  */
 public class DefaultURLArtifactProcessorExtensionPoint
     extends DefaultArtifactProcessorExtensionPoint
-    implements URLArtifactProcessorExtensionPoint, URLArtifactProcessorExtension<Object> {
+    implements URLArtifactProcessorExtensionPoint, URLArtifactProcessor<Object> {
 
     /**
      * Constructs a new loader registry.
@@ -46,7 +46,7 @@
 
     @SuppressWarnings("unchecked")
     public Object read(URL contributionURL, URI sourceURI, URL sourceURL) throws ContributionReadException {
-        URLArtifactProcessorExtension<Object> processor = null;
+        URLArtifactProcessor<Object> processor = null;
         
         // Delegate to the processor associated with file extension
         String extension = sourceURL.getFile();
@@ -54,7 +54,7 @@
         //handle files without extension (e.g NOTICE)
         if (extensionStart > 0) {
             extension = extension.substring(extensionStart);
-            processor = (URLArtifactProcessorExtension<Object>)this.getProcessor(extension);            
+            processor = (URLArtifactProcessor<Object>)this.getProcessor(extension);            
         }
         if (processor == null) {
             return null;
@@ -67,8 +67,8 @@
 
         // Delegate to the processor associated with the model type
         if (model != null) {
-            URLArtifactProcessorExtension<Object> processor = 
-                (URLArtifactProcessorExtension<Object>)this.getProcessor((Class<Object>)model.getClass());
+            URLArtifactProcessor<Object> processor = 
+                (URLArtifactProcessor<Object>)this.getProcessor((Class<Object>)model.getClass());
             if (processor != null) {
                 processor.resolve(model, resolver);
             }
@@ -87,12 +87,12 @@
         }
     }
     
-    public void addExtension(URLArtifactProcessorExtension artifactProcessor) {
+    public void addExtension(URLArtifactProcessor artifactProcessor) {
         processorsByArtifactType.put((Object)artifactProcessor.getArtifactType(), artifactProcessor);
         processorsByModelType.put(artifactProcessor.getModelType(), artifactProcessor);
     }
     
-    public void removeExtension(URLArtifactProcessorExtension artifactProcessor) {
+    public void removeExtension(URLArtifactProcessor artifactProcessor) {
         processorsByArtifactType.remove((Object)artifactProcessor.getArtifactType());
         processorsByModelType.remove(artifactProcessor.getModelType());        
     }

Added: incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/contribution/processor/PackageProcessor.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/contribution/processor/PackageProcessor.java?view=auto&rev=534738
==============================================================================
--- incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/contribution/processor/PackageProcessor.java (added)
+++ incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/contribution/processor/PackageProcessor.java Thu May  3 00:24:45 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.contribution.processor;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.MalformedURLException;
+import java.net.URI;
+import java.net.URL;
+import java.util.List;
+
+import org.apache.tuscany.contribution.service.ContributionException;
+
+/**
+ * Interface for services that can process contributions.
+ * 
+ * @version $Rev$ $Date$
+ */
+public interface PackageProcessor {
+    // /**
+    // * Returns the type of package handled by this package processor.
+    // * @return the type of package handled by this package processor
+    // */
+    // String getPackageType();
+
+    /**
+     * Retrieve a list of artifacts for the specific package type
+     * 
+     * @param packageSourceURL location of the artifact
+     * @param inputStream optional content of the package
+     * @return
+     * @throws ContributionException
+     * @throws IOException
+     */
+    List<URI> getArtifacts(URL packageSourceURL, InputStream inputStream) throws ContributionException, IOException;
+
+    /**
+     * Return the URL for an artifact in the package
+     * 
+     * @param packageSourceURL The package URL
+     * @param artifact The relative URI for the artifact
+     * @return
+     */
+    URL getArtifactURL(URL packageSourceURL, URI artifact) throws MalformedURLException;
+}

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

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

Modified: incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/contribution/processor/PackageProcessorExtensionPoint.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/contribution/processor/PackageProcessorExtensionPoint.java?view=diff&rev=534738&r1=534737&r2=534738
==============================================================================
--- incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/contribution/processor/PackageProcessorExtensionPoint.java (original)
+++ incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/contribution/processor/PackageProcessorExtensionPoint.java Thu May  3 00:24:45 2007
@@ -21,12 +21,12 @@
 /**
  * @version $Rev$ $Date$
  */
-public interface PackageProcessorExtensionPoint extends PackageProcessorExtension {
+public interface PackageProcessorExtensionPoint extends PackageProcessor {
     /**
      * Register a ContributionPackageProcessor using the package type as the key
      * @param processor
      */
-    void register(String packageType, PackageProcessorExtension processor);
+    void register(String packageType, PackageProcessor processor);
     
     /**
      * Unregister a ContributionProcessor by package type

Added: incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/contribution/processor/StAXArtifactProcessor.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/contribution/processor/StAXArtifactProcessor.java?view=auto&rev=534738
==============================================================================
--- incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/contribution/processor/StAXArtifactProcessor.java (added)
+++ incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/contribution/processor/StAXArtifactProcessor.java Thu May  3 00:24:45 2007
@@ -0,0 +1,58 @@
+/*
+ * 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.contribution.processor;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.XMLStreamWriter;
+
+import org.apache.tuscany.contribution.service.ContributionReadException;
+import org.apache.tuscany.contribution.service.ContributionWriteException;
+
+/**
+ * An artifact processor that can read models from a StAX XMLStreamReader.
+ * 
+ * @version $Rev$ $Date$
+ */
+public interface StAXArtifactProcessor<M> extends ArtifactProcessor<M> {
+
+    /**
+     * 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(XMLStreamReader 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.
+     */
+    void write(M model, XMLStreamWriter outputSource) throws ContributionWriteException;
+    
+    /**
+     * Returns the type of artifact handled by this artifact processor. 
+     * @return the type of artifact handled by this artifact processor
+     */
+    QName getArtifactType();
+
+}

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

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

Modified: incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/contribution/processor/StAXArtifactProcessorExtensionPoint.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/contribution/processor/StAXArtifactProcessorExtensionPoint.java?view=diff&rev=534738&r1=534737&r2=534738
==============================================================================
--- incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/contribution/processor/StAXArtifactProcessorExtensionPoint.java (original)
+++ incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/contribution/processor/StAXArtifactProcessorExtensionPoint.java Thu May  3 00:24:45 2007
@@ -24,6 +24,6 @@
  * @version $Rev$ $Date$
  */
 public interface StAXArtifactProcessorExtensionPoint extends 
-    ArtifactProcessorExtensionPoint<StAXArtifactProcessorExtension> {
+    ArtifactProcessorExtensionPoint<StAXArtifactProcessor> {
 
 }



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