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

From: Bill Burke <>
Date: Wed, 01 Feb 2012 10:36:37 -0500

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.

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 Burke
JBoss, a division of Red Hat