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

[jsr339-experts] Re: A Feature interface

From: Marek Potociar <marek.potociar_at_oracle.com>
Date: Mon, 27 Jun 2011 17:17:25 +0200

On 06/27/2011 02:34 PM, Sergey Beryozkin wrote:
>> The assumption was that we need to be able to control the features up to the invocation level. Here's a potential use
>> case:
>>
>> // All communication on this client is audited by default
>> client.register(AuditingFilter.class);
>>
>> // adding a specific resource security filter for the link
>> Link resource = client.link("http://some.resource/uri/").register(SomeResourceSecureHandler.class);
>>
>> This seems to be a common use case and we should support it.
>
> So we have ClientConfiguration already letting users specify the features - this is step 1. Creating a Client instance
> using a given ClientConfiguration sets this Client with the list of those features and thus presumably this Client will
> be 'affected' by those features.

Yes. I have spent a lot of time trying to figure out a better relationship between client and client configuration but
no other option seemed more appealing (it was just adding more complexity to the picture). I am open to revisit any of
this, however, if we are going to discuss this again, I would very much prefer we base such discussions on a concrete
update to the current proposal (NOTE: when I say "update to the current proposal" I mean that I would like to see an
evolution of the proposed API, not another complete revolution as we need to start moving on with other things too).

>
> SomeResourceSecureHandler.class above, has it been specified already in ClientConfiguration or it's been specified in
> the above code only for the 1st time ? If it's the former than that seems redundant, the latter - looks ok

In my example it was specified for the first time. The use-case copies the way how e.g. some amazon services are
accessed in Jersey - you need a specific Amazon security filter to be able to send your requests successfully through.
This filter is however useless with any other resource.

>
> I'm trying get up to speed - apologies if I will ask questions which have already been answered...

No problem :)

Btw. I assuem you have already read through the client API (and other) proposals on the project wiki:
http://java.net/projects/jax-rs-spec/pages/Home

If not, please, look at it.

Cheers,
Marek

>
> Cheers, Sergey
>
>
>>
>> Marek
>>
>> On 06/27/2011 02:00 PM, Sergey Beryozkin wrote:
>>> I'd prefer per-client Feature registration or per-runtime (affecting all the clients) one
>