Uploaded image for project: 'HiveMind'
  1. HiveMind
  2. HIVEMIND-150

It is not possible to set a service into a property via schema rules

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 1.1
    • None
    • framework
    • None
    • Mac OS X, Windows 2000, Java 5

    Description

      The set-property schema conversion rule does not allow one to set a service into a created object.

      The following is an example of something that doesn't work (the following will result in an exception but is not visible if log4j isn't set up):

      <?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>

      Perhaps a set-service rule would be necessary or the set-property rule made a bit smarter.

      Attachments

        1. 150.diff
          3 kB
        2. 150-1.diff
          3 kB
          Chris Burnley
        3. 150-test.zip
          4 kB
          Chris Burnley
        4. 150.patch
          4 kB
          Chris Burnley
        5. 150.patch
          5 kB
          Chris Burnley

        Activity

          People

            Unassigned Unassigned
            cburnley Chris Burnley
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated: