hi *

On Feb 20, 2015, at 6:53 PM, Marius Petria <[email protected]> wrote:

> Hi,
> 
> I discovered an issue related to service users. Due to the indeterminism 
> of OSGI a consumer of ServiceUserMapper cannot be sure that 
> getServiceUserID will find a registered mapping even if that mapping has 
> been configured. For example if a component starts roughly at the same 
> time as the mapping is installed it can happen that the calls the 
> component makes to loginService to fail. More concretely that can happen 
> for example if one needs a session in an activate method to register jcr 
> event listener, or to read some configuration properties from the 
> repository.

I do acknoweledge the issue , said that..

> In order to make this behavior more predictable I created an issue [1] 
> proposing to always register an osgi service (I called it 
> ServiceUserMapping) right after a mapping is installed, such that consumer 
> components can reference it and wait for the mapping to be available. I 
> also worked out an implementation in [2].
> 
> First, I would like to ask you if you think the problem is valid and if 
> the approach is correct?

… I agree with what Felix’s said in [1].
Usually the person that set’s the OSGi configuration (aka the administrator) is 
different than the one that 
codes a bundle (aka the administrator). This can also happen in two distinct 
phases of the project.
I have the impression that this feature mixes the concerns…

regards

antonio 

> Second, it will be really helpful if you can also comment on the issue 
> around the provided implementation.
> 
> Marius
> 
> [1] https://issues.apache.org/jira/browse/SLING-4312
> [2] https://github.com/mpetria/sling/compare/mpetria:trunk...dev-SLING-4312
> 

Reply via email to