You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@aries.apache.org by "Guillaume Nodet (JIRA)" <ji...@apache.org> on 2016/08/26 09:34:20 UTC

[jira] [Comment Edited] (ARIES-1578) blueprint-cm doesn't support org.osgi.service.cm.ConfigurationPlugin

    [ https://issues.apache.org/jira/browse/ARIES-1578?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15438704#comment-15438704 ] 

Guillaume Nodet edited comment on ARIES-1578 at 8/26/16 9:33 AM:
-----------------------------------------------------------------

I don't think using a static map is a good idea.
The code is problematic because of the use of CmUtils.getConfiguration to retrieve the initial configuration, and the problem is more general, so that CmProperties and CmManagedProperties are affected as well.
We should be able to remove the use CmUtils.getConfiguration since the  ManagedService#update method is guaranteed to be called by ConfigAdmin, though it may be slightly more complicated as IIRC, the update() method can be called asynchronously.


was (Author: gnt):
I don't think using a static map is a good idea.
The code is problematic because of the use of CmUtils.getConfiguration to retrieve the initial configuration, but we should be able to remove it since the  ManagedService#update method is guaranteed to be called by ConfigAdmin.

> blueprint-cm doesn't support org.osgi.service.cm.ConfigurationPlugin
> --------------------------------------------------------------------
>
>                 Key: ARIES-1578
>                 URL: https://issues.apache.org/jira/browse/ARIES-1578
>             Project: Aries
>          Issue Type: Bug
>          Components: Blueprint
>            Reporter: Paolo Antinori
>            Assignee: Grzegorz Grzybek
>
> 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
> {code:java}
> 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();
>     }
> {code}
>  {{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.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)