You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@tuscany.apache.org by Dong Liu <do...@yahoo.com> on 2009/03/31 21:43:19 UTC

Use EmbeddedScaDomain to deploy multiple contributions

I tried to use Tuscany EmbeddedScaDomain to deploy multiple contributions which can share some common resources. Here are my contributions:
 
Contribution A (http://inner) contains InnerComposite, looks like:
 
<composite xmlns="http://www.osoa.org/xmlns/sca/1.0" targetNamespace="http://inner"
   name="InnerComposite">
  <component name="StoreServiceComponent">
        <implementation.java class="store.StoreServiceImpl"/> 
        <service name="StroreService">
                        <binding.sca uri="/StoreServiceComponent /StoreService"/>
       </service>
   </component> 
</composite>
 
Contribution B(http://outer) contains OuterComposite, looks like:
 
<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
    targetNamespace="http://hello"  xmlns:inner="http://inner"
    name="OuterComposite">
  
   <!--
     <include name="inner:InnerComposite"/>
    --> 
   <component name="HelloComponent">
        <implementation.java class="hello.HelloImpl"/>
        <reference name=”Store”/>
     </component>
  <wire  source=”HelloComponent/Store"
             Target="/StoreServiceComponent /StoreService"/>
 </composite>
 
Both composites are declared as deployable. Contribution A is exported to namespace http://inner and contribution B imports it.
 
The “Store” service is implemented using “COMPOSITE” Scope annotation, which is intend to provide a shareable store instance for other contributions such like B.
 
However, I got a warning message when deploying B after contribution A is deployed successfully. The warning message is “Wire target not found : HelloComponent/Store”. It looks like the wire in one composite can’t link to components belongs to other composites. 
 
I can make contribution B deployed only by adding the “include” declaration. But I am not sure this will meet my requirement because now the "Store" service belongs to two composites.  The instance shouldn’t be shared among multiple composites since its scope is “COMPOSITE”. 
 
If there are other solutions for this problem? 
 
 
Thanks
 
Dong


      

Re: Use EmbeddedScaDomain to deploy multiple contributions

Posted by Luciano Resende <lu...@gmail.com>.
On Tue, Mar 31, 2009 at 12:43 PM, Dong Liu <do...@yahoo.com> wrote:
> I tried to use Tuscany EmbeddedScaDomain to deploy multiple contributions
> which can share some common resources. Here are my contributions:
>......
>
> Both composites are declared as deployable. Contribution A is exported to
> namespace http://inner and contribution B imports it.
>
> The “Store” service is implemented using “COMPOSITE” Scope annotation, which
> is intend to provide a shareable store instance for other contributions such
> like B.
>
> However, I got a warning message when deploying B after contribution A is
> deployed successfully. The warning message is “Wire target not found :
> HelloComponent/Store”. It looks like the wire in one composite can’t link to
> components belongs to other composites.
>
> I can make contribution B deployed only by adding the “include” declaration.
> But I am not sure this will meet my requirement because now the "Store"
> service belongs to two composites.  The instance shouldn’t be shared among
> multiple composites since its scope is “COMPOSITE”.
>
> If there are other solutions for this problem?
>
>

Have you looked into itest/contribution-import-export or
tutorial/store/assets ? It has couple examples related to what you are
doing.

One thing I didn't see in your e-mail is how you are using
sca-contribution.xml, that is the file that would tell the Tuscany
runtime to use a different contribution when resolving dependencies
(based on import/export from sca-contribution.xml)

>
>
>
> Thanks
>
>
>
> Dong
>



-- 
Luciano Resende
Apache Tuscany, Apache PhotArk
http://people.apache.org/~lresende
http://lresende.blogspot.com/

Re: Use EmbeddedScaDomain to deploy multiple contributions

Posted by Luciano Resende <lu...@gmail.com>.
On Tue, Mar 31, 2009 at 1:18 PM, Raymond Feng <en...@gmail.com> wrote:
> Hi,
>
> The wire element has some errors:
>
>  <wire  source=”HelloComponent/Store"
>            Target="/StoreServiceComponent /StoreService"/>
>
> should be:
>
>  <wire  source=”HelloComponent/Store"
>           target="StoreServiceComponent /StoreService"/>
>

Good catch Raymond... but also no space on the target, right ?

 should be:

  <wire  source=”HelloComponent/Store"
           target="StoreServiceComponent/StoreService"/>



> Thanks,
> Raymond
>
> From: Dong Liu
> Sent: Tuesday, March 31, 2009 12:43 PM
> To: user@tuscany.apache.org
> Subject: Use EmbeddedScaDomain to deploy multiple contributions
>
>
> I tried to use Tuscany EmbeddedScaDomain to deploy multiple contributions
> which can share some common resources. Here are my contributions:
>
> Contribution A (http://inner) contains InnerComposite, looks like:
>
> <composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
> targetNamespace="http://inner"
>  name="InnerComposite">
>  <component name="StoreServiceComponent">
>       <implementation.java class="store.StoreServiceImpl"/>
>       <service name="StroreService">
>                       <binding.sca uri="/StoreServiceComponent
> /StoreService"/>
>      </service>
>  </component>
> </composite>
>
> Contribution B(http://outer) contains OuterComposite, looks like:
>
> <composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
>   targetNamespace="http://hello"  xmlns:inner="http://inner"
>   name="OuterComposite">
>
>  <!--
>    <include name="inner:InnerComposite"/>
>   -->
>  <component name="HelloComponent">
>       <implementation.java class="hello.HelloImpl"/>
>       <reference name=”Store”/>
>    </component>
>  <wire  source=”HelloComponent/Store"
>            Target="/StoreServiceComponent /StoreService"/>
> </composite>
>
> Both composites are declared as deployable. Contribution A is exported to
> namespace http://inner and contribution B imports it.
>
> The “Store” service is implemented using “COMPOSITE” Scope annotation, which
> is intend to provide a shareable store instance for other contributions such
> like B.
>
> However, I got a warning message when deploying B after contribution A is
> deployed successfully. The warning message is “Wire target not found :
> HelloComponent/Store”. It looks like the wire in one composite can’t link to
> components belongs to other composites.
>
> I can make contribution B deployed only by adding the “include” declaration.
> But I am not sure this will meet my requirement because now the "Store"
> service belongs to two composites.  The instance shouldn’t be shared among
> multiple composites since its scope is “COMPOSITE”.
>
> If there are other solutions for this problem?
>
>
> Thanks
>
> Dong
>



-- 
Luciano Resende
Apache Tuscany, Apache PhotArk
http://people.apache.org/~lresende
http://lresende.blogspot.com/

Re: Use EmbeddedScaDomain to deploy multiple contributions

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

The wire element has some errors:

  <wire  source=”HelloComponent/Store"
             Target="/StoreServiceComponent /StoreService"/>

should be:

  <wire  source=”HelloComponent/Store"
            target="StoreServiceComponent /StoreService"/>

Thanks,
Raymond

From: Dong Liu
Sent: Tuesday, March 31, 2009 12:43 PM
To: user@tuscany.apache.org
Subject: Use EmbeddedScaDomain to deploy multiple contributions


I tried to use Tuscany EmbeddedScaDomain to deploy multiple contributions 
which can share some common resources. Here are my contributions:

Contribution A (http://inner) contains InnerComposite, looks like:

<composite xmlns="http://www.osoa.org/xmlns/sca/1.0" 
targetNamespace="http://inner"
   name="InnerComposite">
  <component name="StoreServiceComponent">
        <implementation.java class="store.StoreServiceImpl"/>
        <service name="StroreService">
                        <binding.sca uri="/StoreServiceComponent 
/StoreService"/>
       </service>
   </component>
</composite>

Contribution B(http://outer) contains OuterComposite, looks like:

<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
    targetNamespace="http://hello"  xmlns:inner="http://inner"
    name="OuterComposite">

   <!--
     <include name="inner:InnerComposite"/>
    -->
   <component name="HelloComponent">
        <implementation.java class="hello.HelloImpl"/>
        <reference name=”Store”/>
     </component>
  <wire  source=”HelloComponent/Store"
             Target="/StoreServiceComponent /StoreService"/>
 </composite>

Both composites are declared as deployable. Contribution A is exported to 
namespace http://inner and contribution B imports it.

The “Store” service is implemented using “COMPOSITE” Scope annotation, which 
is intend to provide a shareable store instance for other contributions such 
like B.

However, I got a warning message when deploying B after contribution A is 
deployed successfully. The warning message is “Wire target not found : 
HelloComponent/Store”. It looks like the wire in one composite can’t link to 
components belongs to other composites.

I can make contribution B deployed only by adding the “include” declaration. 
But I am not sure this will meet my requirement because now the "Store" 
service belongs to two composites.  The instance shouldn’t be shared among 
multiple composites since its scope is “COMPOSITE”.

If there are other solutions for this problem?


Thanks

Dong