users@jax-rs-spec.java.net

[jax-rs-spec users] [jsr339-experts] Re: Re: Re: HEADS-UP: Common configuration proposal

From: Marek Potociar <marek.potociar_at_oracle.com>
Date: Thu, 2 Aug 2012 11:44:01 +0200

On Aug 2, 2012, at 8:59 AM, Sergey Beryozkin <sberyozkin_at_talend.com> wrote:

> Hi
>
> On 01/08/12 23:12, Marek Potociar wrote:
>> Those 2 methods will be actually added extra (contrary to the proposal
>> text); The purpose is to be able to narrow down the contracts registered
>> by the provider. E.g. the provider class implements reader and writer
>> interceptor, but you only want to register it as a reader interceptor,
>> etc. The reason for adding those methods as extra overloads to their
>> single-parameter versions is to avoid the nasty compiler warnings when
>> the varargs are completely omitted.
>>
> Why would one want to register a provider with a subset of the contracts ? Technically it can make sense but I'm not sure about the practical side; not a big issue, just curious

We had some use cases in Jersey already - e.g.:

- Common message-level utilities, such as: LoggingFilter implements ClientRequestFilter, ClientResponseFilter, ContainerRequestFilter, ContainerResponseFilter {...}
But you want to only register it to log server-side response messages. I know, there is a workaround, but...

- encryption/decryption interceptor that implements Reader & WriterInterceptor, but you want to only support one side (e.g. response encryption) on your server.

- etc.

Marek

>
>> Btw. I have just pushed the proposed code to java.net <http://java.net>
>> so that you can review:
>> http://java.net/projects/jax-rs-spec/sources/git/revision/6cd8a4c38e81335338d7f7afeac234cc8e92db61
>
> Looks good
>
> Cheers, Sergey
>
>>
>> Marek
>>
>> On Aug 1, 2012, at 6:30 PM, Bill Burke <bburke_at_redhat.com
>> <mailto:bburke_at_redhat.com>> wrote:
>>
>>> I really like this and think it should be included in PR.
>>>
>>> * Are you sure a list of contracts are needed to pass to register()
>>> method? instanceof and Class.isAssignableFrom() can figure this out.
>>>
>>>
>>>
>>> On 8/1/12 10:08 AM, Marek Potociar wrote:
>>>> Hello experts,
>>>>
>>>> In an attempt to address multiple configuration-related issues in JAX-RS
>>>> Jira, I'd like to propose a following update to the API:
>>>> http://java.net/projects/jax-rs-spec/pages/CommonConfig
>>>>
>>>> Since we want to release a PR version of the API early next week, please
>>>> provide your feedback by tomorrow CoB, if possible. I'd like to include
>>>> the change in the PR release so that we can avoid such relatively
>>>> significant API disruption after the JAX-RS API 2.0-pr is released (if
>>>> possible).
>>>>
>>>> I apologise for a last minute notice. Of course, if you are not able to
>>>> review the proposal in the given short time-frame, we can incorporate
>>>> your feedback even after the PR is released.
>>>>
>>>> Thanks,
>>>> Marek
>>>
>>> --
>>> Bill Burke
>>> JBoss, a division of Red Hat
>>> http://bill.burkecentral.com
>>
>
>
> --
> Sergey Beryozkin
>
> Talend Community Coders
> http://coders.talend.com/
>
> Blog: http://sberyozkin.blogspot.com