Felix
  1. Felix
  2. FELIX-2526

Add a property to enable workarounds for CT assumptions

    Details

      Description

      The current OSGi Compendium CT for Declarative services hsa two assumptions, which violate the spec. Our implementation correctly implements the spec in these two areas and thus fails CT tests.

      The two assumptions are:

      (1) ComponentContext.getProperties() expected writable

      The CT expects the Dictionary returned from ComponentContext.getProperties() to be writeable because it is used to pass status information. I reported https://www.osgi.org/bugzilla/show_bug.cgi?id=90

      The workaround is to return the internally used Dictionary from the ComponentContextImpl.getProperties() implementation.

      (2) Configuration Location Binding ignored

      Configuration is created with a location binding such that validating Location Binding fails the configuration tests. The reason is that configuration is created bound to a test bundle, while the components are provided by another bundle. According to my understanding of the Configuration Admin specification, DS should respect location binding when providing Configuration to components. I reported https://www.osgi.org/bugzilla/show_bug.cgi?id=91

      The workaround is to ignore the location binding when accessing the configuration to be supplied to components.

      Defining a framework property to enable these two workarounds makes our implementation pass the CT. The property is only supported as a framework property and is only read when the bundle is started. By default the property is not set, thus disabling the workarounds and behaving spec compliant.

        Issue Links

          Activity

          Hide
          Felix Meschberger added a comment -

          Implemented the workaround in Rev. 982892 (and reversed a test in Rev. 982893).

          The implementation now supports a ds.ctworkaround flag as follows : If the ds.ctworkaround framework property is set to true on bundle startup, two workarounds for the OSGi Compendium R 4.2 CT for Declarative Services are active:

          • The ComponentContext.getProperties() implementation always returns the same writeable Dictionary instead of a read-only dictionary
          • Location binding of Configuration objects supplied to components is ignored.

          Setting the ds.ctworkaround framework property is required to pass the CT but setting the property in a productive environment is strongly discouraged.

          Show
          Felix Meschberger added a comment - Implemented the workaround in Rev. 982892 (and reversed a test in Rev. 982893). The implementation now supports a ds.ctworkaround flag as follows : If the ds.ctworkaround framework property is set to true on bundle startup, two workarounds for the OSGi Compendium R 4.2 CT for Declarative Services are active: The ComponentContext.getProperties() implementation always returns the same writeable Dictionary instead of a read-only dictionary Location binding of Configuration objects supplied to components is ignored. Setting the ds.ctworkaround framework property is required to pass the CT but setting the property in a productive environment is strongly discouraged.
          Hide
          Felix Meschberger added a comment -

          Apache Felix Declarative Services 1.6.0 has been released. The issues are now closed.

          Show
          Felix Meschberger added a comment - Apache Felix Declarative Services 1.6.0 has been released. The issues are now closed.

            People

            • Assignee:
              Felix Meschberger
              Reporter:
              Felix Meschberger
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development