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

[jsr339-experts] Request/Response and FilterContext

From: Santiago Pericas-Geertsen <Santiago.PericasGeertsen_at_oracle.com>
Date: Thu, 13 Oct 2011 13:22:58 -0400

Hello Experts,

 With the recent update to Request and Response to accommodate the 2.0 requirements, a few other classes were updated. One such class is FilterContext. This context object provides access to the Request and the Response (if available) --as well as the ability to create a fresh Response (for caching).

 The current version of FilterContext [1] provides methods that return Request/Response (read only) as well as RequestBuilder/ResponseBuilder (read/write). The rationale for this decision was that certain read-only filters (e.g. a Logger) should not need to deal with builders. There are also setters for updating these objects in the context.

 Question: Do we need all these methods in FilterContext? Or should we just provide methods that return builders (that also provide access to getters) and have the framework call build()?

 Thanks.

-- Santiago

[1] http://java.net/projects/jax-rs-spec/sources/git/content/src/jax-rs-api/src/main/java/javax/ws/rs/ext/FilterContext.java