[ 
https://issues.apache.org/jira/browse/SLING-2192?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Bertrand Delacretaz updated SLING-2192:
---------------------------------------

    Attachment: SLING-2192-with-tests.patch

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. 

> Support JAX-RS resource classes
> -------------------------------
>
>                 Key: SLING-2192
>                 URL: https://issues.apache.org/jira/browse/SLING-2192
>             Project: Sling
>          Issue Type: New Feature
>            Reporter: Reto Bachmann-Gmür
>         Attachments: SLING-2192-new-jax-rs-bundle.patch, 
> SLING-2192-new-jax-rs-bundle.patch, 
> SLING-2192-with-sling-style-style-registration.patch, 
> SLING-2192-with-tests.patch
>
>
> It should be possible to register jax resource classes and providers as 
> services. As they don't implement a specific interface services that expose 
> java.lang.Object should be considered as javx-rs services iff they have the 
> service property "javax.ws.rs" set to true.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira


Reply via email to