Details
-
New Feature
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
scr-1.6.0
-
None
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.