[
https://issues.apache.org/jira/browse/FELIX-5693?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16174769#comment-16174769
]
Frank Hölting edited comment on FELIX-5693 at 9/21/17 1:46 PM:
---------------------------------------------------------------
[~cziegeler] Here's my code review:
"First of all, only a single persistence manager is used. Using several PMs at
once is not supported anymore."
Yes, but always the service with the highest service ranking is used. This
means that the service startup order influences the behavior of the
Confinfiguration Admin implementation. The Activator of the ConfigurationAdmin
activates the FilePersistenceManager regardless of whether felix.cm.pm has been
set or not. The PersistenceManagerTracker#addingService method sorts according
to the service Ranking, Collections.sort(holders), and then the
PersistenceManager uses the highest ranking. I couldn't find a filter in
PersistenceManagerTracker that excludes the FilePersistenceManager if
felix.cm.pm was set. That's why I suspected that the situation will be the same
as in the 1.8.16 version of the ConfigurationAdmin implementation. A test
confirmed that. Attached two test cases once with felix.cm.pm and once without.
was (Author: fhoelting):
[~cziegeler] Here's my code review:
"First of all, only a single persistence manager is used. Using several PMs at
once is not supported anymore."
Yes, but always the service with the highest service ranking is used. This
means that the service startup order influences the behavior of the
Confinfiguration Admin implementation. The Activator of the ConfigurationAdmin
activates the FilePersistenceManager regardless of whether felix. cm. pm has
been set or not. The PersistenceManagerTracker#addingService method sorts
according to the service Ranking, Collections. sort (holders), and then the
PersistenceManager uses the highest ranking. I couldn't find a filter in
PersistenceManagerTracker that excludes the FilePersistenceManager if felix.
cm. pm was set. That's why I suspected that the situation will be the same as
in the 1.8.16 version of the ConfigurationAdmin implementation. A test
confirmed that. Attached two test cases once with felix. cm. pm and once
without.
> Improve persistent manager handling
> -----------------------------------
>
> Key: FELIX-5693
> URL: https://issues.apache.org/jira/browse/FELIX-5693
> Project: Felix
> Issue Type: Improvement
> Components: Configuration Admin
> Reporter: Carsten Ziegeler
> Assignee: Carsten Ziegeler
> Fix For: configadmin-1.9.0
>
> Attachments: case1_with_felix.cm.pm.txt, case2_without_felix.cm.pm.txt
>
>
> The current handling of persistence managers is a little bit fragile and not
> really deterministic.
> I propose the following enhancements:
> - Persistence managers can be registered with a "name" service property. The
> FilePersistenceManager gets a name, e.g. "file"
> - we add a new framework property configuration - if that's empty or not
> there, CM acts as today
> - if a value is configured, it's interpreted as a comma separated list of
> names. This list of names makes up the PMs to be used by the implementation.
> All of them must be registered and only these are used.
> - the PMs are used in the order they are specified in the list
> With this we have deterministic behaviour and full control while the default
> ootb behaviour is still maintained.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)