You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Felix Meschberger (JIRA)" <ji...@apache.org> on 2015/03/09 13:20:38 UTC

[jira] [Commented] (SLING-4312) Register an osgi service for each available service user

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

Felix Meschberger commented on SLING-4312:
------------------------------------------

Ok, thanks. This starts to look ok. I think we can agree on this new service to be a marker. And a marker only.

As such I still (sorry) have a few comments of feedback:

* I think we should properly document the fact that the new service is a marker. Maybe even name it something like "ServiceUserMapped" ?
* Suggest to change the Mapping.SERVICENAME value to have a leading dot, that is {{.serviceName}} instead if {{serviceName}}. This marks the property private.
* I think we can remove the {{ServiceUserMapping.getSubServiceName()}} method since it adds no value. If a dependent service needs the subservice name due to, for example, multiple cardinality dependency, the service property of the ServiceReference can be queried.
* Suggest to defaine  ServiceUserMapper.SERVICE_NAME constant with the service name to prevent these tons of {{ServiceUserMapper.class.getName()}} calls.
* Suggest to implement an internal helper method to retrieve the service name for a bundle. This common method would be called from at least three locations (two in ServiceUserMappingBundleFilter and one in ServiceUserMapperImpl)

> Register an osgi service for each available service user 
> ---------------------------------------------------------
>
>                 Key: SLING-4312
>                 URL: https://issues.apache.org/jira/browse/SLING-4312
>             Project: Sling
>          Issue Type: Improvement
>          Components: Service User Mapper
>            Reporter: Marius Petria
>            Assignee: Marius Petria
>             Fix For: Service User Mapper 1.1.2
>
>         Attachments: SLING-4312.1.diff, SLING-4312.diff
>
>
> In order to only activate osgi components when a service user mapping is available it would be useful to have an osgi service registered for a service user. A component can reference the registered service name and only start when that becomes available.
> {code}
> @Reference(target="(name=serviceName)")
> ServiceUserExists userExists;
> {code}
>  



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