Uploaded image for project: 'Aries'
  1. Aries
  2. ARIES-1578

blueprint-cm doesn't support org.osgi.service.cm.ConfigurationPlugin

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • blueprint-cm-1.0.9
    • Blueprint
    • None

    Description

      I have found an issue with the blueprint-cm module:

      it doesn't integrate with possible implementation of org.osgi.service.cm.ConfigurationPlugin registered in the OSGi framework.

      That interface allows to intercept ConfigAdmin properties updates, allowing to manipulate their content without persisting them anywhere.

      A sample usacase can be a decrypt component that decrypts values on the fly.

      The issue on blueprint-cm is with the current implementation of CmPropertyPlaceholder:

      https://github.com/apache/aries/blob/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/CmPropertyPlaceholder.java#L130-L140

      public void updated(Dictionary props) {
          if ("reload".equalsIgnoreCase(updateStrategy) && !equals(properties, props)) {
              LOGGER.debug("Configuration updated for pid={}", persistentId);
              // Run in a separate thread to avoid re-entrance
              new Thread() {
                  public void run() {
                      blueprintContainer.reload();
                  }
              }.start();
          }
      

      updated() is correctly forwarded the props param, containing eventual manipulation of registered ConfigurationPlugin instances, but that content is discarded. The event will trigger a reload of the whole blueprint context, that will fetch the configuration from ConfigAdmin directly, thus bypassing the plugin behavior.

      Attachments

        Issue Links

          Activity

            People

              gnodet Guillaume Nodet
              paolo.antinori Paolo Antinori
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: