felix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Felix Meschberger (JIRA)" <j...@apache.org>
Subject [jira] Commented: (FELIX-924) No component instance if no Configuration
Date Mon, 15 Jun 2009 09:03:07 GMT

    [ https://issues.apache.org/jira/browse/FELIX-924?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12719467#action_12719467

Felix Meschberger commented on FELIX-924:

Added declaration file support for configuration policy in Rev. 784693:

  * The configuration-policy element is now supported and is read
  * Upon declaration validation, the configuration-policy value is validated:
      - if not set, the default "optional" is assumed
      - for DS 1.0 namespaced declaration, the value is ignored and replaced by the default
"optional" (and a WARN message is logged)
      - for DS 1.1 namespaced declaration, the value is validated against defined values

Unit tests have also been added to verify this behaviour.

> 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
>            Assignee: 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.

View raw message