Carsten Ziegeler wrote > Carsten Ziegeler wrote >> It seems we moved one step forward with SLING-6772 and introducing a >> default mapping for service users. >> >> However nearly at the same time we made a big step backwards: many of >> our modules which use a service user now have a dependency (reference) >> to org.apache.sling.serviceusermapping.ServiceUserMapped in order to >> avoid that a component starts without the service user being present. >> Unfortunately this service user is only available if a configuration for >> that service user exists - but this is not created for the default mapping. >> >> Ultimately this means we've moved another big step away from a >> configurationless Sling - which is really sad. >> >> Any ideas how to solve this? >> > > After an offline discussion with Karl, we came to the conclusion that this > could be solved with a service hook that registers the ServiceUserMapped on > demand, based on the default mapping and the requested subname. > > As the service user implementation already registers these hooks anyway, > this shouldn't be too hard. >
While this would work, I just realized that this totally defeats the purpose of those service references in the first place: the idea is that a component only starts if a service user is available. If we now register the mapping on demand, this means the reference is satisfied directly and then the component will start. However, if the installation is not using the default mapping but a custom one - which arrives "later" - the component will fail nevertheless. Regards Carsten -- Carsten Ziegeler Adobe Research Switzerland [email protected]
