On 2/23/16, 12:51 PM, "Guillaume Lucazeau" <glucaz...@gmail.com> wrote:

>The second issue is that my service needs access to an administrative
>session for this ordering. I mapped it to the admin user with
>ServiceUserMapperImpl.amended in sling:OsgiConfig nodes, however this
>configuration is fired after the bundle has started. Which means that my
>service fails because no mapping is found at the time it's started, and I
>have to manually restart it to execute this code.
>
>Is there a possibility to fire this configuration before the bundle start?
>I've looked at priorities but didn't manage to make it work.

You can use the ServiceUserMapped interface to wait until your configuration is 
registered. An OSGI service is registered for each mapping.

@Reference(target="(subServiceName=mySubService)”)
ServiceUserMapped serviceUserMapped;



[1] 
https://github.com/apache/sling/blob/7c4a53755aed1211c9af313a3973cd2543a7bbe0/bundles/extensions/serviceusermapper/src/main/java/org/apache/sling/serviceusermapping/ServiceUserMapped.java

Reply via email to