users@jax-rs-spec.java.net

[jax-rs-spec users] [jsr339-experts] Re: Re: Intercepting after MBR reads the stream but before invoking ?

From: Bill Burke <bburke_at_redhat.com>
Date: Mon, 14 Oct 2013 10:15:39 -0400

On 10/10/2013 9:12 AM, Santiago Pericas-Geertsen wrote:
>
> On Oct 9, 2013, at 4:48 PM, Sergey Beryozkin <sberyozkin_at_talend.com> wrote:
>
>> Hi
>> On 09/10/13 17:19, Santiago Pericas-Geertsen wrote:
>>>
>>> On Oct 8, 2013, at 7:46 AM, Sergey Beryozkin <sberyozkin_at_talend.com> wrote:
>>>
>>>> Hi
>>>>
>>>> Now and then we get the queries on how to get access not only to the target class/method (ResourceInfo helps there) but to the parameter instances, before the application code gets invoked, example for the monitoring purposes.
>>>> ResourceInfo + UriInfo + accessing InputStream if any from the filters can offer the way to access all of the values representing individual target method parameters, but I wonder if we can offer something simpler/cooler,
>>>>
>>>> Any ideas ? what about introducing one extra stage, in addition to Pre and Post matching, PreInvoking where we'd have a provider like ResourceInfoFilter with the signature like this:
>>>>
>>>> ResourceInfo getResourceInfo();
>>>>
>>>> ResourceInfo will have a new method added too:
>>>>
>>>> List<Object> getMehodParameterValues();
>>>>
>>>> this will throw ISE unless invoked from ResourceInfoFilter ?
>>>
>>> If CDI is available, wouldn't a CDI interceptor work for this purpose?
>>>
>> I guess yes, Spring AOP will do too. Do you reckon it is completely out of JAX-RS scope, it seems we nearly have it, but may be you are right.
>
> Some people have already questioned the need for Entity Interceptors in JAX-RS, arguing that it is a cross-cutting concern better handled by other specs like CDI. This one seems like an even tougher sell IMO.
>

JAX-RS interception models were designed to help process HTTP requests
on the client and server in both synchronous and asynchronous invocation
styles, *not* as an alternative to CDI or Spring AOP.

If anybody ever complains that we've overstepped our bounds, refer them
to a blog I wrote over 2 years ago:

http://bill.burkecentral.com/2011/05/24/interceptors-in-jax-rs-2-0/

Also, please refer any public critique of our model to me so I can link
my blog in their blog or forum comment sections.





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