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

Frank Hölting commented on FELIX-5693:
--------------------------------------

Yeah, that's right. is a bit confusing to register first, then filter out 
again. The ServiceRanking is then a kind of PersistencManager service version. 
This is not intuitive, but a new PersistenceManager can be registered without 
unregistering the old one and on the fly.  

I found the real mistake. But I'm not quite sure if there are any more bugs in 
connection with the use of ManagedService and own PersistenceManager. At least 
now my test case is working. In the appendix I have consulted a patch that 
prevents the unregistration of ManagedServcie after providing of the 
configuration and thus prevents the deactivation of my ManagedService Component 
immediately after activation.

I noticed a few inconsistencies.

1. the ManagedService pid is output as factoryPid in the log console. As if it 
were a ManagedServiceFactory pid. This may cause confusion.  E. g. 
- Console output:
(*service.factoryPid*=org. jcommand.executor.ExecutorComponent|org. 
jcommand.threadpool)
- Component definition:
@Component(property = { "*service.pid*=" + SubConfiguration.THREADPOOL_PID }, 
service = *ManagedService*.class)

2. with my FilePersistenceManager refactoring I don't need the above mentioned 
patch for the ManagedService. 

3. the call of the method ManagedService.update(Dictionary<String,? > 
configuration) returned configuration=null as parameter in my case.  I would 
have expected a ConfigurationException because the configuration was not found.

> 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)

Reply via email to