Thanks for your contribution!
Looks interesting, I tested it and made a few changes to your patch:
-Moved bundle under extensions
-Added the examples to the test-services instead of a separate sample so that they run as part of the build time integration tests.
-Added an integration test, SimpleRootResourceTest
I saw three issues in my tests:
1) It seems like resources are not unregistered if you change their path: start with path A, install the bundle, change to path B in source code, install bundle, both A and B paths are active.
2) More logging would be useful, in the SlingRSRegistrar and related classes.
3) There seems to be an initialization timing issue, if starting a Sling instance with both jaxrs and test-services bundles installed sometimes the SimpleRootResource is not available. It becomes available after reinstalling the test-services bundle, so I assume the service detection is fragile w.r.t. installation/startup timing.
Could you add more similar integration tests, including one with a resource that's registered by resource type? We want to discourage path-based registration in general.
See launchpad/integration-tests/README.txt for how to run the integration tests individually agains a previously started instance, as they can take a few minutes when run in a full build.