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

[jsr339-experts] Why is Reader/WriterInterceptor generic?

From: Bill Burke <bburke_at_redhat.com>
Date: Wed, 01 Feb 2012 10:17:59 -0500

Is the generic type supposed to be used for matching purposes? i.e. if
you have

ReaderInterceptor<Widget>

that interceptor will only be applied to that type? Not good, IMO, as
you would need to recalcuate interceptors chains per-request (on the
client) and per-response (on the server). Is there really an existing
usecase on why we need this?

If you want to go this route, IMO, Reader/WriterInterceptor should have
a isReadable()/isWritable() method just like MessageBodyReader/Writer
has. Also you should be allowed to have @Produces/_at_Consumes which would
effect binding as well.

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