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

[jsr339-experts] Re: [jax-rs-spec users] Re: can you _at_Context inject Configurable or Configuration?

From: Marek Potociar <marek.potociar_at_oracle.com>
Date: Wed, 20 Feb 2013 14:37:40 +0100

On Feb 19, 2013, at 3:12 PM, Bill Burke <bburke_at_redhat.com> wrote:

>
>
> On 2/19/2013 8:48 AM, Marek Potociar wrote:
>>
>> On Feb 19, 2013, at 2:39 PM, Bill Burke <bburke_at_redhat.com
>> <mailto:bburke_at_redhat.com>> wrote:
>>
>>> I'm writing a sub-chapter on component registration and came across a
>>> problem. Is there any way of leveraging scanning so we can build a
>>> Client from scanned components? Would this work server side?
>>>
>>> @Context Configurable configurable;
>>
>> Should the above be Configuration? Configuration can be injected into
>> server side components (providers/resources).
>>
>
> Can you inject Configurable as well? Just wondering...

No, why would you want that? Once app is deployed config should not be mutable. Mutability would open the whole can of worms.

>
>>> @Context ClientBuilder builder;
>>
>> I was hoping we have closed the client component injection topic with
>> removal of @Uri for the time being.
>>
>
> That's fine, but, FWIW this is much different. Injecting a ClientBuilder would require no special configuration and the container could just initialize the builder with configured components (scanned or via Application). This is quite unlike @Uri which would often require outside external configuration of the underlying Client.

Now that @Uri has been dropped I'm strongly inclined to defer the whole server-side client component injection discussion. I do not want a half-baked last moment solution sneak into API.

Marek

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