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

Re: Request for comments: Injecting _at_XxxParam into entity providers

From: Sergey Beryozkin <sberyozkin_at_talend.com>
Date: Sun, 7 Feb 2016 15:40:27 +0000

Well, what were you saying with "static access to a shared property map" ?

Besides, if injecting the parameters into the providers were supported
then obviously singleton resource services would have to support them too...

Sergey
On 07/02/16 08:38, Markus KARG wrote:
>
> I do not unerstand what you want to say, unfortunately. A writer
> interceptor is a singleton object that has access to custom properties
> bound to the request. A resource class can access UriInfo, just as a
> MBW, and UriInfo also is bound to a request. So what actually is the
> part that shall not work?
>
> *From:*Sergey Beryozkin [mailto:sberyozkin_at_talend.com]
> *Sent:* Samstag, 6. Februar 2016 14:35
> *To:* jsr370-experts_at_jax-rs-spec.java.net
> *Subject:* Re: Request for comments: Injecting @XxxParam into entity
> providers
>
> This idea expects the implementations to use the static storage
> (internal implementation detail of how properties are shared between
> in/out interceptors) and in CXF we do not use a static storage
>
> Sergey
> On 05/02/16 22:59, Markus KARG wrote:
>
> Yes it is simpler but using matrix params is a pain that way,
> while it would be really easy to use @MatrixParam. Hence the idea
> with the shared properties.
>
> *From:*Bill Burke [mailto:bburke_at_redhat.com]
> *Sent:* Freitag, 5. Februar 2016 22:44
> *To:* jsr370-experts_at_jax-rs-spec.java.net
> <mailto:jsr370-experts_at_jax-rs-spec.java.net>
> *Subject:* Re: Request for comments: Injecting @XxxParam into
> entity providers
>
> Or, you could just inject and use UriInfo. Simpler.
>
> On 2/5/2016 11:55 AM, Markus KARG wrote:
>
> As an alternative, we could grant MessageBodyWriter and
> resource classes static access to a shared property map (just
> like interceptors share a properties map). That way, a
> resource could get injected the @XxxParam instance, then put
> it into the map, and the MBW could look it up from there. That
> would be fine, too.
>
> *From:*Bill Burke [mailto:bburke_at_redhat.com]
> *Sent:* Donnerstag, 4. Februar 2016 20:31
> *To:* jsr370-experts_at_jax-rs-spec.java.net
> <mailto:jsr370-experts_at_jax-rs-spec.java.net>
> *Subject:* Re: Request for comments: Injecting @XxxParam into
> entity providers
>
> MBW, MBR, Interceptors, and Filters are all singletons. I
> have a ton of implementations of these classses that do
> initialization at boot time. @XXXParam annotations would
> require field injection which just would not work with singletons.
>
> So -1 unless you can provide a @Singleton annotation.
>
> On 2/4/2016 2:01 PM, Markus KARG wrote:
>
> Experts,
>
> I'd like to discuss an idea with you. I don't actually
> propose to do this change in JAX-RS 2.1, but depending on
> the outcome of our discussion it might make sense to
> prepare our products for such an API change to be part of
> JAX-RS 2.2 or 3.0.
>
> What I like you to comment on is that I really miss using
> @XxxParam in entity providers.
>
> Example: Today I wrote a MessageBodyWrite which needs to
> know the value of a matrix param. I solved it by @Context
> UriParam and uses a rather lengthy chain of API calls to
> finally get it. How much smarter the solution would like
> if I just could use @MatrixParam instead!
>
> So I really would love to get rid of the restriction that
> @XxxParam works with resource class only, but in fact
> would like to allow its use on entity providers also.
>
> What do you think?
>
> -Markus
>
>
>
>
>
> --
>
> Bill Burke
>
> JBoss, a division of Red Hat
>
> http://bill.burkecentral.com
>
>
>
>
> --
>
> Bill Burke
>
> JBoss, a division of Red Hat
>
> http://bill.burkecentral.com
>