jsr370-experts@jax-rs-spec.java.net

Re: JAX-WS like Provider in JAX-RS

From: Bill Burke <bburke_at_redhat.com>
Date: Fri, 16 Jan 2015 14:30:24 -0500

Isn't there some specification in Java EE that allows you to do this for
HTTP? I'm pretty sure Java EE has a non-annotated api for Java EE.
Anybody know what it is? ;)

On 1/16/2015 11:10 AM, Sergey Beryozkin wrote:
> Hi All,
>
> Happy New Year,
>
> I've seen a number of times users asking how to have a dynamic JAX-RS
> service which would support various HTTP methods but without having to
> annotate. Something like JAX-WS Provider [1].
>
> How about introducing javax.ws.rs.ServiceProvider interface:
>
> interface ServiceProvider {
> Response invoke(InputStream is);
> }
>
> The implementation can inject a JAX-RS Request context and get an HTTP
> verb name. UriInfo context will provide all the info about the request
> URI including path and query parameters, HttpHeaders - about headers.
> The injected Providers interface will help to read the stream into some
> concrete object for Post/Put requests if needed.
>
> If a given object implements ServiceProvider then the JAX-RS
> implementation will accept it as a service bean. @Path is defaulted to
> "" if no @Path is available.
>
> I think it can be introduced into a spec (API, text) fairly easy but I'm
> not expecting this proposal accepted easily too.
>
> Any comments ?
>
> Sergey
>
>
>
> [1] http://docs.oracle.com/javase/7/docs/api/javax/xml/ws/Provider.html

-- 
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com