consider the following use case: - an OSGi/Sling-based library provides a SPI interface - applications of multiple tenants are deployed on the same instance - each tenant uses a different content tree, e.g. /content/tenant1 and /content/tenant2 - each tenant's application wants to register a different implementation of the SPI, to be applied on resource requests on the tenant's content subtree - this affects not only one SPI but multiple SPIs - we do not want to implement a detect-the-matching-SPI-implementation-for-a-given resource for each library again - we want to have a configuration of the mapping tenant's resource path -> SPI implementation in a central place and to be applied to all SPI implementation of a tenant's application
i've implemented a solution for this some months ago, it's currently part of a wcm.io library. documentation [1], source code [2] questions: 1. do you have these use cases as well? (we had a lot of enterprise projects where we needed exactly this in the last years) 2. does it make sense to contribute it to sling? 3. do you have better ideas for configuring the mapping or the implementation? stefan [1] http://wcm.io/sling/commons/context-aware-services.html [2] https://github.com/wcm-io/wcm-io-sling/tree/develop/commons/src/main/java/io/wcm/sling/commons/caservice