Uploaded image for project: 'Felix'
  1. Felix
  2. FELIX-3524

SCR configuration-pid from compendium 4.3

    XMLWordPrintableJSON

Details

    Description

      This issue is about implementing the new "configuration-pid" component attribute specified by the OSGi 4.3 compendium. So far, components were using the component name in order to retrieve the component configuration from config admin. But In the section 112.4.4, a component can now define an optional specific configuration-pid, in order to use a PID which is different from the component name.

      I have attached to this issue a proposed candidate patch, if someone could review it and hopefully commit it.
      I have not yet made a unit test, but if my propose patch seems reasonable and is accepted, then I will try to learn to implement the corresponding test.

      Here is a brief description of the patch:

      • first the parser (XmlHandler/ComponentMetaData) has been modified in order to parse the new configiration-pid attribute from the component element (the parsing fails if the version is not greater or equals to DS 1.2).
      • next, in ComponentRegistry.java, we are now holding the mapping between configuration pids and their respective components: a new method getComponentHoldersByPid(String pid) method has been added, and returns the iterator on the ComponentHolders which must be configured with the given pid. Please see comments in patch.
      • in ConfigurationSupport.java: when a configuration update is detected from config admin, then the updated is notified to all components whose configuration-pid are referencing the updated pid.

      thanks.

      Attachments

        1. FELIX-3524.patch
          19 kB
          Pierre De Rop
        2. FELIX-3524.patch
          28 kB
          Pierre De Rop

        Activity

          People

            fmeschbe Felix Meschberger
            pderop Pierre De Rop
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: