> -----Original Message----- > From: Sergey Beryozkin [mailto:[email protected]] > Sent: Wednesday, February 23, 2011 2:21 AM > To: [email protected] > Subject: Re: Convenience features for generating HATEOAS urls? > > Hi > > > > Are UriBuilder instances thread-safe? If I assembled a cache of > UriBuilder instances mapped to the public methods of my class (which > have the @GET or @POST annotation), can I then use that and call > "build()" and other methods on that instance? For instance, does > "build()" on a UriBuilder return the same instance, or a new one? > > > > uriBuilder.build() returns a new URI instance every time. > I think, in CXF at least, calling build() on the same cached > UriBuilder instance, should be safe too because it does not modify any > state internally while building a URI. uriBuilder.clone won't be, but > uriBuilder.build() should be ok...
What about the "queryParam()" method? That returns a UriBuilder, not a URI.
