This Confluence has been LDAP enabled, if you are an ASF Committer, please use your LDAP Credentials to login. Any problems file an INFRA jira ticket please.

Child pages
  • Multiple bindings and reference multiplicity
Skip to end of metadata
Go to start of metadata

Reference/Service Wiring Cases: 

Component Reference

Component Service

Effective Wire

Normalized/Resolved Component Reference

<component name="C1">
            <reference name="R1" target="C2/S1">
                    <binding.sca/>
                    <binding.y/>
            </reference>
</component>

<component name="C2">
            <service name="S1">
                        <binding.sca/>
            </service>
</component>

C1/R1 -- binding.sca --> C2/S1

<reference name="R1"> 
        <binding.sca uri="C2/S1"/>
</reference>

 

<component name="C2">
            <service name="S1">
                        <binding.y/>
            </service>
</component>

C1/R1 -- binding.y --> C2/S1

<reference name="R1"> 
        <binding.y uri="C2/S1"/>
</reference>

 

<component name="C2">
            <service name="S1">
                        <binding.x/>
            </service>
</component>

Invalid (no matching binding)

Invalid

<component name="C1">
            <reference name="R1" target="C2/S1 C3/S1">
                    <binding.sca/>
                    <binding.y/>
            </reference>
</component>

<component name="C2">
            <service name="S1">
                        <binding.sca/>
            </service>
</component>
<component name="C3">
            <service name="S1">
                        <binding.y/>
            </service>
</component>

Two wires:
1.     C1/R1-->C2/S1 (binding.sca)
2.     C1/R1-->C3/S1 (binding.y)

<reference name="R1">  
        <binding.sca uri="C2/S1"/> 
        <binding.y uri="C3/S1"/>
</reference>

<reference name="R1" multiplicity="1..1">
            <binding.x uri="http://a"/>
            <binding.y uri="http://b"/>
</reference>

 

Is this valid to have more than bindings with explicit URIs
for a reference with multiplity 0..1 or 1..1?

Invalid

<reference name="R1" multiplicity="1..N">
            <binding.x uri="http://a"/>
            <binding.y uri="http://b"/>
</reference>

 

Are there two wires?
C1/R1-->http://a (binding.x)
C1/R1-->http://b (binding.y)
Are the following references equivalent
if the multiplicity is 1..N or 0..N?
<reference name="R1" target="C2/S1 C3/S1">           
<binding.sca/>
</reference>
<reference name="R1">
            <binding.sca uri="C2/S1"/>
            <binding.sca uri="C3/S1"/>
</reference>

<reference name="R1">
            <binding.x uri="http://a"/>
            <binding.y uri="http://b"/>
</reference>

Reference Promotion Cases: (The inner component reference is promoted by a composite which is in turn configured by the outer component reference)

Inner Component Reference

Composite Reference

Outer Component Reference

Effective Wire

Normalized/Resolved Component Reference

Multiplicity = 1..1
<component name="C1">
    <reference name="R1" target="C2/S1">
    </reference>
</component>

<reference name="R1" promote="C1/R1">
<binding.x>
</reference>

<reference name="R1">
</reference>

C1/R1-->C2/S1 (binding.x)

<reference name="R1">  
        <binding.x uri="C2/S1"/> 
</reference>

Multiplicity = 1..1
<component name="C1">
    <reference name="R1" target="C2/S1">
    </reference></component>

<reference name="R1" promote="C1/R1">
        <binding.x>
</reference>

<reference name="R1" target="C3/S1">
</reference>

Is it valid to override the target?

Invalid (violates the multiplicity)

Multiplicity = 1..N
<component name="C1">
    <reference name="R1" target="C2/S1">
    </reference>
</component>

<reference name="R1" promote="C1/R1">
        <binding.x uri="http://a">
</reference>

<reference name="R1">
</reference>

C1/R1-->C2/S1 (binding.sca)
C1/R1-->http://a (binding.x)
(Spec line 1071: Component services and component references can be
promoted to composite services and references and also be wired internally
within the composite at the same time. For a reference, this only makes
sense if the reference supports a multiplicity greater than 1.)

<reference name="R1">  
        <binding.sca uri="C2/S1"/> 
        <binding.x uri=http://a/>
</reference>

Multiplicity = 1..N
<component name="C1">
    <reference name="R1" target="C2/S1">
    </reference></component>

<reference name="R1" promote="C1/R1">
</reference>

<reference name="R1" target="C3/S1">
</reference>

C1/R1-->C2/S1 (binding.sca)
C1/R1-->C3/S1 (binding.sca)?

<reference name="R1">  
        <binding.sca uri="C2/S1"/> 
        <binding.sca uri="C3/S1"/>
</reference>