No component instance if no Configuration
-----------------------------------------
Key: FELIX-924
URL: https://issues.apache.org/jira/browse/FELIX-924
Project: Felix
Issue Type: New Feature
Components: Declarative Services (SCR)
Affects Versions: scr-1.0.6
Environment: OSGi RFC-0134, OSGi R4.2 Early Draft 2
(http://www.osgi.org/download/osgi-4.2-early-draft2.pdf)
Reporter: Felix Meschberger
Fix For: scr-1.2.0
A way is needed for the component declaration to say only create a component
configuration IF there is a Configuration( or Configurations).
To support this, the follow attribute is added to the component element:
<attribute name="configuration-policy" type="scr:Tconfiguration-policy"
default="optional" use="optional" />
<simpleType name="Tconfiguration-policy">
<restriction base="string">
<enumeration value="optional" />
<enumeration value="require" />
<enumeration value="ignore" />
</restriction>
</simpleType>
If the attribute is present and set to require, then a component cannot be
satisfied (section 112.5.2) unless there is a Configuration in
ConfigurationAdmin for the component. In this situation, the No Configuration
case in 112.7 does not apply.If the component is a Factory Component and the
component is not satisfied because there is no Configuration present, then the
ComponentFactory service will not be registered.
If the attribute is present and set to ignore, then ConfigurationAdmin will not
be consulted for the component. In this situation, only the No Configuration
case in 112.7 applies.
If the attribute is not present or present and set to optional, then SCR will
act as it did prior to this RFC. That is, a Configuration will be used if
present in ConfigurationAdmin.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.