You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by rf...@apache.org on 2007/02/28 20:36:15 UTC

svn commit: r512923 - in /incubator/tuscany/branches/sca-java-integration/sca: kernel/core/src/main/java/org/apache/tuscany/core/services/deployment/ kernel/core/src/main/resources/org/apache/tuscany/core/ kernel/host-api/src/main/java/org/apache/tusca...

Author: rfeng
Date: Wed Feb 28 11:36:14 2007
New Revision: 512923

URL: http://svn.apache.org/viewvc?view=rev&rev=512923
Log:
[sca-integration-branch] Add methods to ContributionService and AssemblyService to match the SCA 1.0 spec

Added:
    incubator/tuscany/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/services/deployment/ArtifactResolverRegistryImpl.java   (with props)
Modified:
    incubator/tuscany/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/services/deployment/AssemblyServiceImpl.java
    incubator/tuscany/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/services/deployment/ContributionServiceImpl.java
    incubator/tuscany/branches/sca-java-integration/sca/kernel/core/src/main/resources/org/apache/tuscany/core/deployment.scdl
    incubator/tuscany/branches/sca-java-integration/sca/kernel/host-api/src/main/java/org/apache/tuscany/host/deployment/AssemblyService.java
    incubator/tuscany/branches/sca-java-integration/sca/kernel/host-api/src/main/java/org/apache/tuscany/host/deployment/ContributionService.java
    incubator/tuscany/branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/deployer/ArtifactResolver.java
    incubator/tuscany/branches/sca-java-integration/sca/services/idl/wsdl/src/main/java/org/apache/tuscany/idl/wsdl/WSDLContributionProcessor.java
    incubator/tuscany/branches/sca-java-integration/sca/services/idl/wsdl/src/main/java/org/apache/tuscany/idl/wsdl/XSDContributionProcessor.java
    incubator/tuscany/branches/sca-java-integration/sca/services/idl/wsdl/src/test/java/org/apache/tuscany/idl/wsdl/WSDLContributionProcessorTestCase.java
    incubator/tuscany/branches/sca-java-integration/sca/services/idl/wsdl/src/test/java/org/apache/tuscany/idl/wsdl/XSDContributionProcessorTestCase.java

Added: incubator/tuscany/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/services/deployment/ArtifactResolverRegistryImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/services/deployment/ArtifactResolverRegistryImpl.java?view=auto&rev=512923
==============================================================================
--- incubator/tuscany/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/services/deployment/ArtifactResolverRegistryImpl.java (added)
+++ incubator/tuscany/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/services/deployment/ArtifactResolverRegistryImpl.java Wed Feb 28 11:36:14 2007
@@ -0,0 +1,70 @@
+/*
+ * 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.core.services.deployment;
+
+import java.net.URI;
+import java.net.URL;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.tuscany.spi.deployer.ArtifactResolver;
+import org.apache.tuscany.spi.deployer.ArtifactResolverRegistry;
+import org.apache.tuscany.spi.deployer.DeploymentContext;
+import org.apache.tuscany.spi.model.Contribution;
+import org.osoa.sca.annotations.EagerInit;
+
+/**
+ * @version $Rev$ $Date$
+ */
+@EagerInit
+public class ArtifactResolverRegistryImpl implements ArtifactResolverRegistry {
+    private Map<Class, ArtifactResolver> registry = new HashMap<Class, ArtifactResolver>();
+
+    public void registerResolver(Class<?> modelClass, ArtifactResolver resolver) {
+        registry.put(modelClass, resolver);
+    }
+
+    public void unregisterResolver(Class<?> modelClass) {
+        registry.remove(modelClass);
+    }
+
+    public <T> T resolve(Contribution contribution,
+                         Class<T> modelClass,
+                         String namespace,
+                         String name,
+                         Map attributes,
+                         DeploymentContext context) {
+        ArtifactResolver resolver = registry.get(modelClass);
+        if (resolver == null) {
+            return null;
+        }
+        return resolver.resolve(contribution, modelClass, namespace, name, attributes, context);
+    }
+
+    public URL resolve(Contribution contribution, String targetNamespace, String location, String baseURI) {
+        // FIXME: What's a URI resolver?
+        ArtifactResolver resolver = registry.get(URI.class);
+        if (resolver == null) {
+            return null;
+        }
+        return resolver.resolve(contribution, targetNamespace, location, baseURI);
+    }
+
+}

Propchange: incubator/tuscany/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/services/deployment/ArtifactResolverRegistryImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/services/deployment/ArtifactResolverRegistryImpl.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: incubator/tuscany/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/services/deployment/AssemblyServiceImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/services/deployment/AssemblyServiceImpl.java?view=diff&rev=512923&r1=512922&r2=512923
==============================================================================
--- incubator/tuscany/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/services/deployment/AssemblyServiceImpl.java (original)
+++ incubator/tuscany/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/services/deployment/AssemblyServiceImpl.java Wed Feb 28 11:36:14 2007
@@ -59,29 +59,28 @@
     private final CompositeComponent domain;
 
     @Constructor
-    public AssemblyServiceImpl(@Autowire
-    ContributionService contributionService, CompositeComponent domain) {
+    public AssemblyServiceImpl(@Autowire ContributionService contributionService, CompositeComponent domain) {
         this.contributionService = contributionService;
         this.domain = domain;
     }
 
-    public Object addCompositeToDomain(URI contribution, URI composite) throws DeploymentException, IOException {
+    public Object addCompositeToDomain(URI contribution, URI composite) throws DeploymentException {
 
-        Contribution contributionMetadata = (Contribution) this.contributionService
-                .getContributionMetaData(contribution);
+        Contribution contributionMetadata =
+            (Contribution)this.contributionService.getContribution(contribution);
         DeployedArtifact scdlArtifact = contributionMetadata.getArtifacts().get(composite);
-        ComponentDefinition model = (ComponentDefinition) scdlArtifact.getModelObject(CompositeComponentType.class,
-                null);
+        ComponentDefinition model =
+            (ComponentDefinition)scdlArtifact.getModelObject(CompositeComponentType.class, null);
 
         Component component = null;
         Deployer deployer = null;
 
         SCAObject child = this.domain.getSystemChild(ComponentNames.TUSCANY_DEPLOYER);
-        assert (child instanceof AtomicComponent) : "Deployer must be an atomic component";
+        assert child instanceof AtomicComponent : "Deployer must be an atomic component";
 
         try {
 
-            deployer = (Deployer) ((AtomicComponent) child).getTargetInstance();
+            deployer = (Deployer)((AtomicComponent)child).getTargetInstance();
             component = deployer.deployFromContribution(this.domain, model);
 
         } catch (TargetResolutionException e) {
@@ -103,7 +102,7 @@
 
         URLConnection connection = changeSet.openConnection();
         String contentType = connection.getContentType();
-        //todo try and figure out content type from the URL
+        // todo try and figure out content type from the URL
         if (contentType == null) {
             throw new UnsupportedContentTypeException(null, changeSet.toString());
         }
@@ -138,5 +137,18 @@
 
     public void register(ChangeSetHandler handler) {
         registry.put(handler.getContentType(), handler);
+    }
+
+    public <T> T getDefinition(URI contribution, Class<T> type, String namespace, String name) {
+        return contributionService.resolve(contribution, type, namespace, name);
+    }
+
+    public Object getDomainComposite() {
+        return domain;
+    }
+
+    public void removeCompositeFromDomain(URI contribution, URI composite) throws DeploymentException {
+        // TODO:
+        throw new UnsupportedOperationException("To be implemented");
     }
 }

Modified: incubator/tuscany/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/services/deployment/ContributionServiceImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/services/deployment/ContributionServiceImpl.java?view=diff&rev=512923&r1=512922&r2=512923
==============================================================================
--- incubator/tuscany/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/services/deployment/ContributionServiceImpl.java (original)
+++ incubator/tuscany/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/services/deployment/ContributionServiceImpl.java Wed Feb 28 11:36:14 2007
@@ -31,9 +31,12 @@
 import org.apache.tuscany.host.deployment.ContributionService;
 import org.apache.tuscany.host.deployment.DeploymentException;
 import org.apache.tuscany.spi.annotation.Autowire;
+import org.apache.tuscany.spi.deployer.ArtifactResolverRegistry;
 import org.apache.tuscany.spi.deployer.ContributionProcessorRegistry;
 import org.apache.tuscany.spi.deployer.ContributionRepository;
+import org.apache.tuscany.spi.model.CompositeComponentType;
 import org.apache.tuscany.spi.model.Contribution;
+import org.apache.tuscany.spi.model.DeployedArtifact;
 
 /**
  * @version $Rev$ $Date$
@@ -50,16 +53,20 @@
     protected ContributionProcessorRegistry processorRegistry;
 
     /**
-     * Contribution registry This is a registry of processed Contributios index by URI
+     * Contribution registry This is a registry of processed Contributios index
+     * by URI
      */
     protected Map<URI, Contribution> contributionRegistry = new HashMap<URI, Contribution>();
 
-    public ContributionServiceImpl(@Autowire
-    ContributionRepository repository, @Autowire
-    ContributionProcessorRegistry processorRegistry) {
+    protected ArtifactResolverRegistry resolverRegistry;
+
+    public ContributionServiceImpl(@Autowire ContributionRepository repository, 
+                                   @Autowire ContributionProcessorRegistry processorRegistry,
+                                   @Autowire ArtifactResolverRegistry resolverRegistry) {
         super();
         this.contributionRepository = repository;
         this.processorRegistry = processorRegistry;
+        this.resolverRegistry = resolverRegistry;
     }
 
     public URI contribute(URL contribution, boolean storeInRepository) throws DeploymentException, IOException {
@@ -114,24 +121,33 @@
         return contribution.getUri();
     }
 
-    public Object getContributionMetaData(URI id) {
+    public Object getContribution(URI id) {
         return this.contributionRegistry.get(id);
     }
 
     public void remove(URI contribution) throws DeploymentException {
         // remove from repository
         this.contributionRegistry.remove(contribution);
-        // remove from registry
-        this.contributionRegistry.remove(contribution);
+    }
+
+    public void addDeploymentComposite(URI contribution, Object composite) {
+        CompositeComponentType model = (CompositeComponentType)composite;
+        URI compositeURI = URI.create(contribution.toString() + "/" + model.getName() + ".composite");
+        DeployedArtifact artifact = new DeployedArtifact(compositeURI);
+        // FIXME: the namespace should be from the CompositeComponentType model
+        artifact.addModelObject(composite.getClass(), null, composite);
+        Contribution contributionObject = (Contribution)getContribution(contribution);
+        contributionObject.addArtifact(artifact);
     }
 
     public <T> T resolve(URI contribution, Class<T> definitionType, String namespace, String name) {
-        // TODO Auto-generated method stub
-        return null;
+        Contribution contributionObject = (Contribution)getContribution(contribution);
+        return resolverRegistry.resolve(contributionObject, definitionType, namespace, name, null, null);
     }
 
     public URL resolve(URI contribution, String namespace, URI uri, URI baseURI) {
-        // TODO Auto-generated method stub
-        return null;
+        Contribution contributionObject = (Contribution)getContribution(contribution);
+        return resolverRegistry.resolve(contributionObject, namespace, uri.toString(), baseURI.toString());
     }
+
 }

Modified: incubator/tuscany/branches/sca-java-integration/sca/kernel/core/src/main/resources/org/apache/tuscany/core/deployment.scdl
URL: http://svn.apache.org/viewvc/incubator/tuscany/branches/sca-java-integration/sca/kernel/core/src/main/resources/org/apache/tuscany/core/deployment.scdl?view=diff&rev=512923&r1=512922&r2=512923
==============================================================================
--- incubator/tuscany/branches/sca-java-integration/sca/kernel/core/src/main/resources/org/apache/tuscany/core/deployment.scdl (original)
+++ incubator/tuscany/branches/sca-java-integration/sca/kernel/core/src/main/resources/org/apache/tuscany/core/deployment.scdl Wed Feb 28 11:36:14 2007
@@ -41,6 +41,11 @@
     <component name="contributionProcessorRegistry" initLevel="35">
         <system:implementation.system class="org.apache.tuscany.core.services.deployment.ContributionProcessorRegistryImpl" />
     </component>
+
+    <component name="artifactResolverRegistry" initLevel="35">
+        <system:implementation.system class="org.apache.tuscany.core.services.deployment.ArtifactResolverRegistryImpl" />
+    </component>
+
     <component name="contentTypeDescriber" initLevel="30">
         <system:implementation.system class="org.apache.tuscany.core.services.deployment.ContentTypeDescriberImpl" />
     </component>

Modified: incubator/tuscany/branches/sca-java-integration/sca/kernel/host-api/src/main/java/org/apache/tuscany/host/deployment/AssemblyService.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/branches/sca-java-integration/sca/kernel/host-api/src/main/java/org/apache/tuscany/host/deployment/AssemblyService.java?view=diff&rev=512923&r1=512922&r2=512923
==============================================================================
--- incubator/tuscany/branches/sca-java-integration/sca/kernel/host-api/src/main/java/org/apache/tuscany/host/deployment/AssemblyService.java (original)
+++ incubator/tuscany/branches/sca-java-integration/sca/kernel/host-api/src/main/java/org/apache/tuscany/host/deployment/AssemblyService.java Wed Feb 28 11:36:14 2007
@@ -25,32 +25,81 @@
 
 /**
  * Service interface for managing the logical assembly for a Tuscany runtime.
- *
+ * 
  * @version $Rev$ $Date$
  */
 public interface AssemblyService {
-    
-    Object addCompositeToDomain(URI contribution, URI composite) throws DeploymentException, IOException;
-    
+
+    /**
+     * Add the composite identified by a supplied URI to the Domain Level
+     * Composite. The supplied composite is added to the domain composite with
+     * semantics that correspond to the domain-level composite having an
+     * &lt;include&gt; statement that references the supplied composite. All of
+     * the composite’s components become top-level components and the services
+     * become externally visible services.
+     * 
+     * @param contribution The URI of the contribution
+     * @param composite The URI of the composite
+     * @return The added composite
+     * @throws DeploymentException
+     */
+    Object addCompositeToDomain(URI contribution, URI composite) throws DeploymentException;
+
+    /**
+     * Remove from the Domain Level composite the elements corresponding to the
+     * composite identified by a supplied composite URI. This means that the
+     * removal of the components, wires, services and references originally
+     * added to the domain level composite by the identified composite.
+     * 
+     * @param contribution
+     * @param composite
+     * @throws DeploymentException
+     */
+    void removeCompositeFromDomain(URI contribution, URI composite) throws DeploymentException;
+
+    /**
+     * Returns a &lt;composite&gt; definition that has an &lt;include&gt; line
+     * for each composite that had been added to the domain level composite.
+     * 
+     * @return The composite representing the SCA domain
+     */
+    Object getDomainComposite();
+
+    /**
+     * Get the definitions for named artifacts in the included composites.
+     * 
+     * @param <T> The type of the definition
+     * @param contribution The URI of an installed contribution
+     * @param type The java type of the symbol space such as
+     *            javax.wsdl.Definition
+     * @param namespace The namespace of the artifact
+     * @param name The name of the artifact
+     * @return A single definition, in whatever form is appropriate for that
+     *         definition type.
+     */
+    <T> T getDefinition(URI contribution, Class<T> type, String namespace, String name);
+
     /**
      * Apply a set of changes to the SCA Domain's logical assembly.
-     *
+     * 
      * @param changeSet the location of a resource containing a set of changes
      * @throws DeploymentException if there was a problem making the changes
-     * @throws IOException         if there was a problem accessing the resource
+     * @throws IOException if there was a problem accessing the resource
      */
     void applyChanges(URL changeSet) throws DeploymentException, IOException;
 
     /**
      * Apply a set of changes to the SCA Domain's logical assembly.
-     *
-     * @param changeSet   a stream for reading a resource containing a set of changes; the stream will not be closed
-     *                    but no guarantee is made on the position the stream is left in
-     * @param contentType the type of changeSet on the stream; must be a valid Content-Type value
-     *                    as specified by <a href="http://www.ietf.org/rfc/rfc2045.txt">RFC2045</a>
-     *                    and must not be null
+     * 
+     * @param changeSet a stream for reading a resource containing a set of
+     *            changes; the stream will not be closed but no guarantee is
+     *            made on the position the stream is left in
+     * @param contentType the type of changeSet on the stream; must be a valid
+     *            Content-Type value as specified by <a
+     *            href="http://www.ietf.org/rfc/rfc2045.txt">RFC2045</a> and
+     *            must not be null
      * @throws DeploymentException if there was a problem making the changes
-     * @throws IOException         if there was a problem reading the stream
+     * @throws IOException if there was a problem reading the stream
      */
     void applyChanges(InputStream changeSet, String contentType) throws DeploymentException, IOException;
 }

Modified: incubator/tuscany/branches/sca-java-integration/sca/kernel/host-api/src/main/java/org/apache/tuscany/host/deployment/ContributionService.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/branches/sca-java-integration/sca/kernel/host-api/src/main/java/org/apache/tuscany/host/deployment/ContributionService.java?view=diff&rev=512923&r1=512922&r2=512923
==============================================================================
--- incubator/tuscany/branches/sca-java-integration/sca/kernel/host-api/src/main/java/org/apache/tuscany/host/deployment/ContributionService.java (original)
+++ incubator/tuscany/branches/sca-java-integration/sca/kernel/host-api/src/main/java/org/apache/tuscany/host/deployment/ContributionService.java Wed Feb 28 11:36:14 2007
@@ -56,10 +56,21 @@
     URI contribute(URI source, InputStream contribution,  boolean storeInRepository) throws DeploymentException, IOException;
     
     /**
-     * @param contribution
-     * @return
+     * Get the model for an installed contribution
+     * @param contribution The URI of an installed contribution
+     * @return The model for the contribution or null if there is no such contribution
      */
-    Object getContributionMetaData(URI contribution);
+    Object getContribution(URI contribution);
+
+    /**
+     * Adds or updates a deployment composite using a supplied composite
+     * ("composite by value" – a data structure, not an existing resource in the
+     * domain) to the contribution identified by a supplied contribution URI.
+     * The added or updated deployment composite is given a relative URI that
+     * matches the "name" attribute of the composite, with a ".composite" suffix.
+     */
+    void addDeploymentComposite(URI contribution, Object composite);
+        
     
     /**
      * Remove a contribution from the SCA domain

Modified: incubator/tuscany/branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/deployer/ArtifactResolver.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/deployer/ArtifactResolver.java?view=diff&rev=512923&r1=512922&r2=512923
==============================================================================
--- incubator/tuscany/branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/deployer/ArtifactResolver.java (original)
+++ incubator/tuscany/branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/deployer/ArtifactResolver.java Wed Feb 28 11:36:14 2007
@@ -19,10 +19,11 @@
 
 package org.apache.tuscany.spi.deployer;
 
-import java.net.URI;
 import java.net.URL;
 import java.util.Map;
 
+import org.apache.tuscany.spi.model.Contribution;
+
 
 /**
  * SCA Assemblies reference many artifacts of a wide variety of types. These
@@ -46,7 +47,7 @@
     /**
      * Resolve an artifact by the qualified name
      * 
-     * @param contribution the URI of the contribution
+     * @param contribution the model of the contribution
      * @param modelClass The java type of the artifact 
      * @param namespace The namespace of the artifact
      * @param name The name of the artifact
@@ -55,7 +56,7 @@
      * @param context The deployment context
      * @return The resolved artifact
      */
-    <T> T resolve(URI contribution,
+    <T> T resolve(Contribution contribution,
                   Class<T> modelClass,
                   String namespace,
                   String name,
@@ -78,6 +79,6 @@
      * 
      * @return The URI of the resolved artifact
      */
-    URL resolve(URI contribution, String targetNamespace, String location, String baseURI);
+    URL resolve(Contribution contribution, String targetNamespace, String location, String baseURI);
 
 }

Modified: incubator/tuscany/branches/sca-java-integration/sca/services/idl/wsdl/src/main/java/org/apache/tuscany/idl/wsdl/WSDLContributionProcessor.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/branches/sca-java-integration/sca/services/idl/wsdl/src/main/java/org/apache/tuscany/idl/wsdl/WSDLContributionProcessor.java?view=diff&rev=512923&r1=512922&r2=512923
==============================================================================
--- incubator/tuscany/branches/sca-java-integration/sca/services/idl/wsdl/src/main/java/org/apache/tuscany/idl/wsdl/WSDLContributionProcessor.java (original)
+++ incubator/tuscany/branches/sca-java-integration/sca/services/idl/wsdl/src/main/java/org/apache/tuscany/idl/wsdl/WSDLContributionProcessor.java Wed Feb 28 11:36:14 2007
@@ -95,7 +95,7 @@
         reader.setFeature("javax.wsdl.verbose", false);
         reader.setExtensionRegistry(extensionRegistry);
 
-        WSDLLocatorImpl locator = new WSDLLocatorImpl(contribution.getUri(), location, inputStream);
+        WSDLLocatorImpl locator = new WSDLLocatorImpl(contribution, location, inputStream);
         Definition definition = reader.readWSDL(locator);
         String definitionNamespace = definition.getTargetNamespace();
         if (namespace != null && !namespace.equals(definitionNamespace)) {
@@ -193,12 +193,12 @@
     }
 
     public class WSDLLocatorImpl implements WSDLLocator {
-        private URI contribution;
+        private Contribution contribution;
         private InputStream inputStream;
         private String baseURI;
         private URI latestImportURI;
 
-        public WSDLLocatorImpl(URI contribution, URI baseURI, InputStream is) {
+        public WSDLLocatorImpl(Contribution contribution, URI baseURI, InputStream is) {
             this.contribution = contribution;
             this.baseURI = baseURI.toString();
             this.inputStream = is;

Modified: incubator/tuscany/branches/sca-java-integration/sca/services/idl/wsdl/src/main/java/org/apache/tuscany/idl/wsdl/XSDContributionProcessor.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/branches/sca-java-integration/sca/services/idl/wsdl/src/main/java/org/apache/tuscany/idl/wsdl/XSDContributionProcessor.java?view=diff&rev=512923&r1=512922&r2=512923
==============================================================================
--- incubator/tuscany/branches/sca-java-integration/sca/services/idl/wsdl/src/main/java/org/apache/tuscany/idl/wsdl/XSDContributionProcessor.java (original)
+++ incubator/tuscany/branches/sca-java-integration/sca/services/idl/wsdl/src/main/java/org/apache/tuscany/idl/wsdl/XSDContributionProcessor.java Wed Feb 28 11:36:14 2007
@@ -59,9 +59,9 @@
      * URI resolver implementation for xml schema
      */
     protected class URIResolverImpl implements URIResolver {
-        private URI contribution;
+        private Contribution contribution;
 
-        public URIResolverImpl(URI contriution) {
+        public URIResolverImpl(Contribution contriution) {
             this.contribution = contriution;
         }
 
@@ -82,7 +82,7 @@
     public XmlSchema loadSchema(Contribution contribution, String namespace, URI location, InputStream inputStream)
         throws IOException, DeploymentException {
         XmlSchemaCollection collection = new XmlSchemaCollection();
-        collection.setSchemaResolver(new URIResolverImpl(contribution.getUri()));
+        collection.setSchemaResolver(new URIResolverImpl(contribution));
         XmlSchema schema = collection.read(new InputStreamReader(inputStream), null);
 
         if (namespace != null && schema != null && !namespace.equals(schema.getTargetNamespace())) {

Modified: incubator/tuscany/branches/sca-java-integration/sca/services/idl/wsdl/src/test/java/org/apache/tuscany/idl/wsdl/WSDLContributionProcessorTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/branches/sca-java-integration/sca/services/idl/wsdl/src/test/java/org/apache/tuscany/idl/wsdl/WSDLContributionProcessorTestCase.java?view=diff&rev=512923&r1=512922&r2=512923
==============================================================================
--- incubator/tuscany/branches/sca-java-integration/sca/services/idl/wsdl/src/test/java/org/apache/tuscany/idl/wsdl/WSDLContributionProcessorTestCase.java (original)
+++ incubator/tuscany/branches/sca-java-integration/sca/services/idl/wsdl/src/test/java/org/apache/tuscany/idl/wsdl/WSDLContributionProcessorTestCase.java Wed Feb 28 11:36:14 2007
@@ -48,7 +48,7 @@
         processor = new WSDLContributionProcessor();
         ArtifactResolverRegistry registry = createMock(ArtifactResolverRegistry.class);
         URL url = getClass().getResource("test2.wsdl");
-        expect(registry.resolve(isA(URI.class),
+        expect(registry.resolve(isA(Contribution.class),
                                 (String)isNull(),
                                 isA(String.class),
                                 isA(String.class))).andReturn(url).anyTimes();

Modified: incubator/tuscany/branches/sca-java-integration/sca/services/idl/wsdl/src/test/java/org/apache/tuscany/idl/wsdl/XSDContributionProcessorTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/branches/sca-java-integration/sca/services/idl/wsdl/src/test/java/org/apache/tuscany/idl/wsdl/XSDContributionProcessorTestCase.java?view=diff&rev=512923&r1=512922&r2=512923
==============================================================================
--- incubator/tuscany/branches/sca-java-integration/sca/services/idl/wsdl/src/test/java/org/apache/tuscany/idl/wsdl/XSDContributionProcessorTestCase.java (original)
+++ incubator/tuscany/branches/sca-java-integration/sca/services/idl/wsdl/src/test/java/org/apache/tuscany/idl/wsdl/XSDContributionProcessorTestCase.java Wed Feb 28 11:36:14 2007
@@ -51,7 +51,7 @@
         processor = new XSDContributionProcessor();
         ArtifactResolverRegistry registry = createMock(ArtifactResolverRegistry.class);
         URL url = getClass().getResource("ipo.xsd");
-        expect(registry.resolve(isA(URI.class), isA(String.class), isA(String.class), (String)isNull())).andReturn(url)
+        expect(registry.resolve(isA(Contribution.class), isA(String.class), isA(String.class), (String)isNull())).andReturn(url)
             .anyTimes();
         processor.setArtifactResolverRegistry(registry);
         replay(registry);



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