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/03/16 17:26:09 UTC

svn commit: r519040 - /incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/deployer/ArtifactResolver.java

Author: rfeng
Date: Fri Mar 16 09:26:05 2007
New Revision: 519040

URL: http://svn.apache.org/viewvc?view=rev&rev=519040
Log:
Change the ArtifactResolver interface to take Contribution instead of URI

Modified:
    incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/deployer/ArtifactResolver.java

Modified: incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/deployer/ArtifactResolver.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/deployer/ArtifactResolver.java?view=diff&rev=519040&r1=519039&r2=519040
==============================================================================
--- incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/deployer/ArtifactResolver.java (original)
+++ incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/deployer/ArtifactResolver.java Fri Mar 16 09:26:05 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);
 
 }



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


Re: ArtifactResolver questions

Posted by Jim Marino <jm...@myromatours.com>.
>
> My orginal mindset is that we need some context for the resolving,  
> for example, a resolver might use the classloader to resolve  
> relative URIs.
>
> Isn't DeploymentContext designed for Load/Resolve/Build?

With the federated architecture, we can't assume DeploymentContext  
anymore or that the steps above occur in the same VM. I posted a  
message earlier today outlining some of this but the key thing is  
that building happens on slave nodes and it is against a  
PhysicalChangeSet, not the logical model. The logical model will be  
handled on the Controller, which will also be responsible for  
resolution, normalization, and generation of PhysicalChangeSets sets  
comprising PhysicalComponentDefinitions, PhysicalWireDefinitions, and  
PhysicalResourceDefinitions. This will be marshalled across to the  
appropriate nodes.

Jim



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


Re: ArtifactResolver questions

Posted by Raymond Feng <en...@gmail.com>.
Hi,

I think it might be better to polish the interface later on during the 
integration of contribution service stuff that Luciano is working on.

Anyway, some comments below.

Thanks,
Raymond

----- Original Message ----- 
From: "Jeremy Boynes" <jb...@apache.org>
To: <tu...@ws.apache.org>
Sent: Friday, March 16, 2007 10:08 AM
Subject: ArtifactResolver questions


> On Mar 16, 2007, at 9:46 AM, Raymond Feng wrote:
>
>> Hi,
>>
>> Contribution is the model object that hosts the metadata and 
>> introspected result for the contribution. Logically, you can use  the URI 
>> of the contribution to look up the ContributionService to  get the 
>> Contribution. I found it simpler for ArtifactResolver  extensions to 
>> receive Contribution directly.
>
> Doesn't this just move the responsibility for lookup to the caller of 
> this SPI? And given the caller should not know about the  implementation, 
> it has to be passed every time even if the resolver  does not need that 
> information?
>

I thought "lookup once" at the higher level is better.

> Actually, why is this a parameter at all? What makes Contribution 
> different from any other attribute passed in the Map?
>

The Map is used to hold addiontal attributes to further constrain the query 
and the entries are resolver-specific as I understand. I think we like the 
"strongly-typed" approach more.

> Finally, why is DeploymentContext passed - can't I use this outside  the 
> load phase?
>

My orginal mindset is that we need some context for the resolving, for 
example, a resolver might use the classloader to resolve relative URIs.

Isn't DeploymentContext designed for Load/Resolve/Build?

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


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


ArtifactResolver questions

Posted by Jeremy Boynes <jb...@apache.org>.
On Mar 16, 2007, at 9:46 AM, Raymond Feng wrote:

> Hi,
>
> Contribution is the model object that hosts the metadata and  
> introspected result for the contribution. Logically, you can use  
> the URI of the contribution to look up the ContributionService to  
> get the Contribution. I found it simpler for ArtifactResolver  
> extensions to receive Contribution directly.

Doesn't this just move the responsibility for lookup to the caller of  
this SPI? And given the caller should not know about the  
implementation, it has to be passed every time even if the resolver  
does not need that information?

Actually, why is this a parameter at all? What makes Contribution  
different from any other attribute passed in the Map?

Finally, why is DeploymentContext passed - can't I use this outside  
the load phase?

--
Jeremy


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


Re: svn commit: r519040 - /incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/deployer/ArtifactResolver.java

Posted by Raymond Feng <en...@gmail.com>.
Hi,

Contribution is the model object that hosts the metadata and introspected 
result for the contribution. Logically, you can use the URI of the 
contribution to look up the ContributionService to get the Contribution. I 
found it simpler for ArtifactResolver extensions to receive Contribution 
directly.

Thanks,
Raymond

----- Original Message ----- 
From: "Jeremy Boynes" <jb...@apache.org>
To: <tu...@ws.apache.org>
Sent: Friday, March 16, 2007 9:33 AM
Subject: Re: svn commit: r519040 - 
/incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/deployer/ArtifactResolver.java


> Why?
>
> On Mar 16, 2007, at 9:26 AM, rfeng@apache.org wrote:
>
>> Author: rfeng
>> Date: Fri Mar 16 09:26:05 2007
>> New Revision: 519040
>>
>> URL: http://svn.apache.org/viewvc?view=rev&rev=519040
>> Log:
>> Change the ArtifactResolver interface to take Contribution instead  of 
>> URI
>>
>> Modified:
>>     incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/ 
>> tuscany/spi/deployer/ArtifactResolver.java
>>
>> Modified: incubator/tuscany/java/sca/kernel/spi/src/main/java/org/ 
>> apache/tuscany/spi/deployer/ArtifactResolver.java
>> URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/kernel/ 
>> spi/src/main/java/org/apache/tuscany/spi/deployer/ 
>> ArtifactResolver.java?view=diff&rev=519040&r1=519039&r2=519040
>> ====================================================================== 
>> ========
>> --- incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/ 
>> tuscany/spi/deployer/ArtifactResolver.java (original)
>> +++ incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/ 
>> tuscany/spi/deployer/ArtifactResolver.java Fri Mar 16 09:26:05 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);
>>
>>  }
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
>> For additional commands, e-mail: tuscany-commits-help@ws.apache.org
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: tuscany-dev-help@ws.apache.org
> 


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


Re: svn commit: r519040 - /incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/deployer/ArtifactResolver.java

Posted by Jeremy Boynes <jb...@apache.org>.
Why?

On Mar 16, 2007, at 9:26 AM, rfeng@apache.org wrote:

> Author: rfeng
> Date: Fri Mar 16 09:26:05 2007
> New Revision: 519040
>
> URL: http://svn.apache.org/viewvc?view=rev&rev=519040
> Log:
> Change the ArtifactResolver interface to take Contribution instead  
> of URI
>
> Modified:
>     incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/ 
> tuscany/spi/deployer/ArtifactResolver.java
>
> Modified: incubator/tuscany/java/sca/kernel/spi/src/main/java/org/ 
> apache/tuscany/spi/deployer/ArtifactResolver.java
> URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/kernel/ 
> spi/src/main/java/org/apache/tuscany/spi/deployer/ 
> ArtifactResolver.java?view=diff&rev=519040&r1=519039&r2=519040
> ====================================================================== 
> ========
> --- incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/ 
> tuscany/spi/deployer/ArtifactResolver.java (original)
> +++ incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/ 
> tuscany/spi/deployer/ArtifactResolver.java Fri Mar 16 09:26:05 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);
>
>  }
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
> For additional commands, e-mail: tuscany-commits-help@ws.apache.org
>


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