[snip]
Raymond Feng wrote:
Hi,

By the SCA spec, when a deployable composite is added to the SCA domain, it's "included" by the logical SCA domain composite. As a result, all top-level components must have unique names.

Thanks,
Raymond

----- Original Message ----- From: "Huang Kai" <[EMAIL PROTECTED]>
To: <[email protected]>
Cc: "???" <[EMAIL PROTECTED]>; "jiaoly" <[EMAIL PROTECTED]>; "??" <[EMAIL PROTECTED]>
Sent: Thursday, May 31, 2007 2:03 AM
Subject: Re: (SCA)How can get the service by composite service name


I understood. It seems so.

While this raise another question: Tuscany seemed skipped the 'composite' layer and direct access component service, then how to access services in two composites within same domain?

like this:

--------------------------------------------------------------------

CompositeA.composite:

<composite xmlns="http://www.osoa.org/xmlns/sca/1.0";
targetNamespace=http://www.globalfinance.com/NASDAQ";
name="NASDAQ">

<component name="StockQuoteServiceComponent">

   <implementation.java class="com.ibm.stock.StockQuoteServiceImpl"/>

</component>

</composite>

--------------------------------------------------------------------

CompositeB.composite:

<composite xmlns="http://www.osoa.org/xmlns/sca/1.0";
targetNamespace=http://www.globalfinance.com/HongKong";
name="HongKong">

<component name="StockQuoteServiceComponent">

   <implementation.java class="com.lenovo.stock.StockQuoteServiceImpl"/>

</component>

</composite>

-------------------------------------------------------------------------------

When these two composite all loaded in one SCADomain.

How do I get StockQuoteService supplied by CompositeB or CompositeA?

How can SCADomain.getService(Class, String) handle such name conflict?




Adding composites to a domain is described in section 1.10.6.1.

3075 1.10.6.1 add To Domain-Level Composite
3076 This functionality adds the composite identified by a supplied URI to the Domain Level 3077 Composite. The supplied composite URI must refer to a composite within a installed contribution. 3078 The composite's installed contribution determines how the composite’s artifacts are resolved 3079 (directly and indirectly). The supplied composite is added to the domain composite with 3080 semantics that correspond to the domain-level composite having an <include> statement that 3081 references the supplied composite. All of the composite’s components become top-level 3082 components and the services become externally visible services (eg. they would be present in a
3083 WSDL description of the domain).

So in your example you could do:

CompositeA.composite:

<composite xmlns="http://www.osoa.org/xmlns/sca/1.0";
targetNamespace=http://www.globalfinance.com/NASDAQ";
name="NASDAQ">

<component name="NasdaqStockQuoteServiceComponent">

  <implementation.java class="com.ibm.stock.StockQuoteServiceImpl"/>

</component>

</composite>

--------------------------------------------------------------------

CompositeB.composite:

<composite xmlns="http://www.osoa.org/xmlns/sca/1.0";
targetNamespace=http://www.globalfinance.com/HongKong";
name="HongKong">

<component name="HongKongStockQuoteServiceComponent">

  <implementation.java class="com.lenovo.stock.StockQuoteServiceImpl"/>

</component>

</composite>


Then call domain.getService(StockQuote.class, "NasdaqStockQuoteServiceComponent") and domain.getService(StockQuote.class, "HongKongStockQuoteServiceComponent").


Hope this helps.

--
Jean-Sebastien


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to