[
https://issues.apache.org/jira/browse/SLING-4312?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14324375#comment-14324375
]
Marius Petria commented on SLING-4312:
--------------------------------------
I created a first draft for exposing a ServiceUserMapping for each active
mapping [1]. It basically unregisters/registers one service for each mapping in
updateBindings method.
The usage would be
{code}
@Reference(target = "(subServiceName=myservicename)"
ServiceUserMapping mapping;
@Activate
void activate() {
Map<String, Object> authenticationInfo = new ...;
authenticationInfo.put(ResourceResolverFactory.SUBSERVICE,
mapping.getSubServiceName());
resourceResolverFactory. getServiceResourceResolver(authenticationInfo);
}
{code}
[~cziegeler] can you have a look and tell me if I am going in the right
direction?
[1]
https://github.com/mpetria/sling/commit/c499631ac8866f909db6a9ac3783d7b998ac5956
> 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
>
> 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)