Hi Reto This is interesting stuff. I have reviewed your patch and got the feeling that the Wink project would probably be a better home for this functionality.
There are two points that lead me to this assessment: * The only Sling dependency is the OptingServlet class (+ the SlingHttpServletRequest class, but that's because of the OptingServlet as well). * A lot of Wink dependency classes are in "internal" packages and should thus probably be considered a private API. Currently the Wink bundles export them, but I'd tend to consider this a bug in Wink. A comment by Wink Developer Bryant Luk seems to support this assumption. He essentially says he couldn't make them private because the library wasn't designed for OSGi. There seems to be some interest around OSGi support in the Wink community, and also other projects (e.g. Tuscany) seem to be interested in using Wink within an OSGi setup. Therefore, it seem to me that providing whiteboard support for JAX-RS directly in Wink would provide broader benefits. And it wouldn't stop anyone from using it within Sling either. WDYT? Regards Julian [0] https://issues.apache.org/jira/browse/WINK-269?focusedCommentId=12851123&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-12851123 On Mon, Aug 22, 2011 at 4:00 PM, Bertrand Delacretaz <[email protected]> wrote: > Hi Reto, > > On Mon, Aug 22, 2011 at 11:03 AM, Reto Bachmann-Gmür <[email protected]> wrote: >> ...As Sling is (also) about supporting the development of RESTfull >> web-application is seems natural to support the JAX-RS standard. >> Apache Clerezza show how this can be integrated quite nicely with he >> osgi white-board pattern. The proposed patch for SLING-2192 does not >> use any code from Clerezza but bases on the latest release of Apache >> Wink, by following the same service-selection convention as Clerezza >> the implementation is however compatible.... > > Cool stuff...IIRC we already had some plans to include jax-rs support > in Sling, and it certainly makes sense. > > I'd prefer to have this as an optional extension however, i.e. under > contrib, as people should use Sling's resource-based script/servlet > selection instead of relying mostly on paths as jax-rs does. Having > that option is fine, but not by default IMO, so that to keep the focus > on what we consider the normal way of doing things. > > Also, considering SLING-2191 and the related thread from a few minutes > ago, it might be better to mount the JaxRsServlet on a path (/jaxrs by > default maybe?) rather than by resource type, to avoid two resolution > mechanisms fighting for the same URL space. > > Opinions? > > -Bertrand >
