Unless CDI manages ALL JAX-RS message body readers (which it typically doesn't - at least not yet), the bellow would not work. But I wonder why would you do it this way instead of injecting JAX-RS Providers instance via @Context?
Marek
On Oct 23, 2012, at 9:08 PM, Jan Algermissen <jan.algermissen_at_nordsc.com> wrote:
> Hi,
>
> what is the desired behavior of a JAX-RS and CDI runtime when a message body reader or writer is injected using a CDI mechanism.
>
> For example, if using
>
> @Inject Instance<MessageBodyReader> mbrs;
>
> for(MessageBodyReader mbr : mbrs) {
> if(mbr.canRead( ... ) ) {
> someObject = mbr.readFrom( ... )
> }
> }
>
> is the expectation that any applicable JAX-RS interceptors are invoked?
>
> What about ordering/interference with CDI Interceptors?
>
> Jan