You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by David Jencks <da...@yahoo.com> on 2013/02/26 21:19:18 UTC

{config admin] Changing a ManagedService[Factory] pids

I was looking at the code for ManagedServiceTracker.modifiedService and it looks odd to me.  Before I spend a lot of time verifying what does happen I thought I should ask about what should happen :-)

Lets say you have a MS registered with pids {1, 2} and you change the service registration so its interested in pids {2, 3} and there are existing configs for 1, 2, 3.  What should happen?

I think that:

-- MS stops getting updates for pid 1
-- continues to get updates for changes to pid 2, but does not receive an update for the existing config for pid 2 (it already got one
-- gets an update with the current state of the existing config for pid 3

Is this what should happen?  The code looks to me like MS will get an update for the existing config for pid 2, which would be a duplicate notification.  As I said, I didn't check that this is what happens, its just based on looking at the code.

thanks!
david jencks


Re: {config admin] Changing a ManagedService[Factory] pids

Posted by Felix Meschberger <fm...@adobe.com>.
Hi,

Am 26.02.2013 um 21:19 schrieb David Jencks:

> I was looking at the code for ManagedServiceTracker.modifiedService and it looks odd to me.  Before I spend a lot of time verifying what does happen I thought I should ask about what should happen :-)
> 
> Lets say you have a MS registered with pids {1, 2} and you change the service registration so its interested in pids {2, 3} and there are existing configs for 1, 2, 3.  What should happen?
> 
> I think that:
> 
> -- MS stops getting updates for pid 1

Yes

> -- continues to get updates for changes to pid 2, but does not receive an update for the existing config for pid 2 (it already got one

Yes

> -- gets an update with the current state of the existing config for pid 3

Yes

> 
> Is this what should happen?  The code looks to me like MS will get an update for the existing config for pid 2, which would be a duplicate notification.  As I said, I didn't check that this is what happens, its just based on looking at the code.

Before actually supplying the configuration, the ConfigurationMap.shallTake method is called which makes sure the configuration to be supplied has a higher revision counter than any configuration of the same PID already supplied.

So, no, pid2 is only applied once.

I have just added a test case to verify that.

Regards
Felix

> 
> thanks!
> david jencks
> 


--
Felix Meschberger | Principal Scientist | Adobe