Autowire applies to references with targets
-------------------------------------------

                 Key: TUSCANY-2617
                 URL: https://issues.apache.org/jira/browse/TUSCANY-2617
             Project: Tuscany
          Issue Type: Bug
          Components: Java SCA Assembly Model
            Reporter: Brent Daniel


If Autowire="true" is specified on a component with multiple references, some 
of which have targets, the runtime will autowire all references rather than 
only the ones without targets. 

For example, in the composite below "candyCatalog" and "fruitsCatalog" will be 
autowired in addition to "currencyConverter". 

<composite      xmlns="http://www.osoa.org/xmlns/sca/1.0";
                        
targetNamespace="http://soa.sca.samples.candystore/catalog";
                    name="StoreSupplierCatalogInnerComposite">
                    
    <service name="Catalog" promote="StoreSupplierCatalogInner/Catalog">
        <interface.java interface="soa.sca.samples.candystore.Catalog"/>
        <binding.ws/>
    </service>

        <component name="StoreSupplierCatalogInner" autowire="true" >
                <implementation.java 
class="soa.sca.samples.candystore.merger.MergedCatalogImpl"/> 
                <property name="currencyCode">USD</property>
                
                <reference name="candyCatalog" target="StoreCandyCatalog"/>
                <reference name="fruitsCatalog" target="FruitsCatalog"/>
                
                <!-- Since we are using autowire we do not need to specify a 
target -->
                <reference name="currencyConverter" />
        </component>

        <component name="FruitsCatalog">
                <implementation.java 
class="soa.sca.samples.candystore.FruitsCatalogImpl"/>
                <property name="currencyCode">USD</property>
                <reference name="currencyConverter" 
target="StoreCurrencyConverter"/>   
        </component>

        <component name="StoreCandyCatalog">
                <implementation.java 
class="soa.sca.samples.candystore.CandyCatalogImpl"/>
                <property name="currencyCode">USD</property>
                <reference name="currencyConverter" 
target="StoreCurrencyConverter"/>   
        </component>
        
    <component name="StoreCurrencyConverter">
                <implementation.java 
class="soa.sca.samples.candystore.CurrencyConverterImpl"/>
        </component>   
        
</composite>


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to