I'm trying to get my head around schemas / configuration / contributions etc. so I took took the panarama example and cut it down changed the names and am attempting to inject a service into a property as part of the conversion rules.

This is on hivemind-1.1-beta2 (using simple standard interfaces such as Comparator and Runnable):

<?xml version="1.0"?>
<module id="hivetest" version="1.0.0" package="hivetest">
   
    <service-point id="Comparator" interface="java.util.Comparator">
        <create-instance class="impl.TestComparator"/>   
    </service-point>
           
    <schema id="Obj">
        <element name="obj">
            <attribute name="attr"/>
            <conversion class="impl.Obj"/>
        </element>
        <element name="sobj">
            <attribute name="attr"/>
            <rules>
                <create-object class="impl.Obj"/>
                <invoke-parent method="addElement"/>
                <read-content property="attr"/> 
               <!-- this is the problem line below : -->                            
                <set-property property="comparator" value="service:hivetest.Comparator"/>
            </rules>
        </element>
    </schema>
           
    <configuration-point id="Objs" schema-id="Obj" />
           
    <service-point id="TestService" interface="java.lang.Runnable">
        <invoke-factory>
            <construct class="impl.TestService">
                <set-configuration configuration-id="Objs" property="objs"/>
            </construct>
        </invoke-factory>
    </service-point>

    <contribution configuration-id="hivetest.Objs">
      <obj attr="test"/>
        <obj attr="test2"/>
        <sobj>test3</sobj>
      </contribution>

</module>

Basically, the comparator property is not being set and there is no feedback why. If I change the type of the property to a string, the string value is set but it looks like the translator for service is not being invoked inside the rules element.

Is there something wrong with what I am doing ?

regards,

Chris

Reply via email to