users@jax-rs-spec.java.net

[jax-rs-spec users] [jsr339-experts] Re: Client initialization on server-side

From: Sergey Beryozkin <sberyozkin_at_talend.com>
Date: Mon, 6 Feb 2012 13:08:31 +0000

On 03/02/12 15:00, Santiago Pericas-Geertsen wrote:
>
> On Feb 1, 2012, at 10:36 AM, Bill Burke wrote:
>
>> The binding of providers on the server side for JAX-RS resources is
>> pretty staightforward.
>>
>> It is not so straightforward for Clients though. Should we allow the
>> injection of Client instances? i.e.
>>
>> @Resource Client client;
>>
>> In this case, how would the Client be initialized? With what
>> providers? This is important as there will be client-specific
>> filters/interceptors and server-specific filters/interceptors. This
>> also has an effect on default providers created by the container and
>> how those default providers are registered.
>

It's a good idea to get the clients injected, but Client does not
represent an individual instance, it is a factory in the 2.0 API, right ?
Should it be Target instead ?

Sergey

> Could you comment on [1] to keep track of this?
>
> -- Santiago
>
> [1] http://java.net/jira/browse/JAX_RS_SPEC-170
>
>>
>> Some ideas:
>>
>> * have a @Client/_at_Server annotation that could be applied to a
>> provider to scope it for either Client and/or Server.
>>
>> * Add getClientClasses() and getClientSingletons() to Application
>>
>> * Make the Configuration interface simpler so users can implement it
>> and register it just like they do with the Application class. You
>> might even be able to define binding annotations and have multiple
>> Configurations per application that could be injected.
>>
>> Bill
>>
>> --
>> Bill Burke
>> JBoss, a division of Red Hat
>> http://bill.burkecentral.com
>