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

[jsr339-experts] Re: Questions about WebTarget

From: Sergey Beryozkin <sberyozkin_at_talend.com>
Date: Wed, 17 Jul 2013 13:21:45 +0100

On 17/07/13 12:31, Sergey Beryozkin wrote:
> Hi
>
> I'd like to ask a couple of questions about WebTarget interface [1].
>
> 1. Methods matrixParam(), queryParam(), path(), all of resolveTemplate
> methods create a new WebTarget instance, does a state of the current
> WebTarget's URIBuilder gets affected or is it cloned first ?

I'm trying hard checking if I've missed something, the closest hint is
a text "Create a new WebTarget instance by resolving one or more URI
templates in the URI of the current target instance using supplied
name-encoded value pair" found in resolveTemplate* method docs, but I'm
still not 100% sure what exactly that implies re the (uribuilder) state
of the current target instance

Thanks, Sergey

>
> 2. Configuration inheritance (I guess it applies to the whole
> ClientBuilder -> Client -> WebTarget chain).
> Suppose I have WebTarget1 which creates a new WebTarget2. WebTarget1 has
> a configuration property "target1". WebTarget2 gets a snapshot of the
> WebTarget1's configuration, what happens when a property such as
> "target1" gets removed on WebTarget2's Configuration - is it just
> removed (no side-effect I guess for WebTarget1) or should it be
> IllegalStateException ?
>
> Thanks, Sergey
>
> [1]
> https://jax-rs-spec.java.net/nonav/2.0/apidocs/javax/ws/rs/client/WebTarget.html
>