On Aug 22, 2006, at 8:03 AM, Hawkins, Joel wrote:

Can anyone point me to an example that uses a Composite Reference? I
noticed that the one in BigBank is commented out.

I'm having trouble testing OSGi support against the latest code. I've
got a sample that looks like this:

<composite xmlns="http://www.osoa.org/xmlns/sca/1.0";
           xmlns:osgi="http://tuscany.apache.org/xmlns/osgi/1.0";
           name="Retailer_Warehouse">

    <service name="RetailerService" target="RetailerComponent">
        <interface.java
             interface="mypackage.Retailer"/>
        <osgi:binding.osgi
             service="mypackage.Retailer"/>
        <reference>RetailerComponent</reference>
    </service>

    <reference name="ShipperReference" override="may"
multiplicity="0..n">
        <interface.java
            interface="mypackage.Shipper"/>
        <osgi:binding.osgi
            service="mypackage.Shipper"
            filter="(objectclass=mypackage.Shipper)"
            immediate="false"/>
    </reference>

    <component name="RetailerComponent">
<implementation.java class="mypackage.RetailerComponentImpl/>
        <references>
            <reference name="warehouse" target="WarehouseComponent"/>
        </references>
    </component>

    <component name="WarehouseComponent">
<implementation.java class="mypackage.WarehouseComponentImpl"/>
        <references>
            <reference name="shipper">ShipperReference</reference>
            </references>
    </component>

</composite>

According to the spec, it should be legal for the target of the
"shipper" reference to be a Composite Reference (in this case,
ShipperReference):

"A composite reference is a valid target of a wire. In this case, the
name of the reference is the
value set on the wire targeting the reference". (pg 24 of the v.95
spec).

However, the composite above fails when ConnectorImpl attempts to locate
the target (the parent's children map contains only components and
services, no composite references). Is the problem with my Composite
definition, or is the problem with Tuscany?
For a composite reference, we would need to specify the wire target in the use of the composite as in:

<component name="xs:NCName">*
  <implementation.composite name="xs:NCName"/>
          <reference name="xs:NCName"/>wire-target-URI </reference>
 </component>

In the case above, I thought ShipperReference was wiring out over the binding and having the binding resolve the target through OSGi? If that is the case, what may be happening is a bug I ran into last night. Basically, the reference builder need to set a URI on the Reference model object, otherwise the composite reference builder assumes it is a composite reference. That should be fixed, or at least an error thrown.

To see if this is your problem, can you attach the code you are using to a JIRA and I'll take a look?

Jim


Thanks,
Joel
The contents of this e-mail are intended for the named addressee only. It contains information that may be confidential. Unless you are the named addressee or an authorized designee, you may not copy or use it, or disclose it to anyone else. If you received it in error please notify us immediately and then destroy it.

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



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

Reply via email to