users@jax-rs-spec.java.net

[jax-rs-spec users] [jsr339-experts] PLEASE REVIEW: Updated filtering API proposal

From: Marek Potociar <marek.potociar_at_oracle.com>
Date: Thu, 5 Apr 2012 17:11:17 +0200

Hello experts,

Please review the reworked filtering API proposal. To review, please checkout the remote branch:

git clone ssh://<user_name>@git.java.net/jax-rs-spec~git jaxrs-api
cd jaxrs-api
git checkout -t new-filter-api origin/new-filter-api

The API code is under src/jax-rs-api. Examples are under src/examples. The git commit history will help you to better see the actual changes.

What has changed (quite a lot):
filtering API has been split into server (container) and client part.
client side: ClientRequestFilter, ClientRequestContext, ClientResponseFilter, ClientResponseContext
server side: ContainerRequestFilter, ContainerRequestContext, ContainerResponseFilter, ContainerResponseContext, ResourceFilter
Response remains a common component (went through some modifications though - see bellow)
Container filters are by default pre-matching
There is a new @PostMatching name-binding annotation to support global resource (post-matching) filters and interceptors
DynamicBinding interface has been refactored into DynamicBinder provider interface and javadoc has been clarified.
Request changes have been rolled back - removed RequestHeaders, RequestBuilder & Request API methods.
Some of the removed methods were added to the filter context interfaces
ResponseHeaders has been removed, Response API has been updated to support common use cases and some of the ResponseHeaders methods
Client API has been updated to accommodate the Req/Resp API changes.
Examples have been updated to use the new filtering API. (Positive fact is that in all cases the use of the new API meant less code in the example filter implementation code.)
Other changes:
MessageProcessingException has been moved from core into root package
Client-side Target has been renamed to WebTarget to avoid a name clash with java.lang.annotation.Target from Java SE.

Looking forward to your feedback. If possible, we would like to put the proposal into the next EDR that is planned for 4/20, so please, make sure to send your feedback by Friday next week CoB (4/13).

Thank you,
Marek