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

[jsr339-experts] Update in the client configuration API flow

From: Marek Potociar <marek.potociar_at_oracle.com>
Date: Tue, 20 Sep 2011 16:30:40 +0200

Hello experts,

Please review the proposed change I have just commited:
http://java.net/projects/jax-rs-spec/sources/git/revision/f48ae3d9a98a6194df3abe708347083bf78afc91

The change branches off the configuration flow of client-side artifacts from the main request-to-response execution
flow. From my recent discussion with Sergey on this list as well as from further feedback I have received privately it
seems the mixed mutable and immutable methods on Targets may indeed cause some user confusion.

To reduce the confusion we decided to make Target "dirty" immutable - Target will not expose any methods that would
return same Target instance, however Target's configuration state can be indirectly modified (in a separate method flow)
by accessing its Configuration instance and invoking mutators on that instance. Configuration interface is a
rename/replacement for former Configurable<T> interface. Please, look at the samples, they should be rather
self-explanatory.

We decided to use this solution because it allows for keeping the Target immutable wrt. URI which helps us preserve
URI-based identity contract (equals/hashCode) and makes it possible to use Target instances safely with e.g. Java
collection classes etc.

Kind regards,
Marek