Savvas,

I have no evidence whatsoever. :)

But it seems strange to me that if implementations should be thread-safe,
this information is not written in bold in the javadocs :) Or it could be
decision left up to vendors to decide.

Anyway, if it is indeed thread-safe it makes things a lot easier since a
single instance can be used throughout the app.

On Tue, Oct 28, 2014 at 7:50 AM, Savvas Andreas Moysidis <
savvas.andreas.moysi...@gmail.com> wrote:

> Hi Rodrigo,
>
> That's precisely what my example above showcases. :)
>
> It may well be the case that the Client class is not thread-safe indeed
> but can I ask though what evidence have you got to believe that?
>
> Perhaps taking a look at the source code would clarify things? (or a
> commiter following this thread could verify instead)
>
> On 28 October 2014 01:23, Rodrigo Uchôa <rodrigo.uc...@gmail.com> wrote:
>
>> if Client implementations are thread-safe, shouldn't a single instance be
>> enough? Thus having a single instance for the whole app would do it. I
>> don't think it's the case.
>>
>> On Mon, Oct 27, 2014 at 10:21 PM, Savvas Andreas Moysidis <
>> savvas.andreas.moysi...@gmail.com> wrote:
>>
>>> The question, I suppose, is whether Client implementations are
>>> thread-safe or not which is something that is not stipulated by the
>>> interface contract.
>>>
>>> If they are(something which is sort of implied by the javadoc), then you
>>> could maybe declare and use a single instance like the following? (in a
>>> JavaEE context)
>>>
>>> @Singleton
>>> public class SomeService {
>>>
>>>     private Client restClient;
>>>
>>>     @PostConstruct
>>>     private void init() {
>>>         restClient = ClientBuilder.newClient();
>>>     }
>>>     .....................................................................
>>>     // Use restClient object here
>>>     .....................................................................
>>>
>>>     @PreDestroy
>>>     private void cleanUp() {
>>>         restClient.close();
>>>     }
>>> }
>>>
>>> On 27 October 2014 23:24, Mario Diana <mariodi...@gmail.com> wrote:
>>>
>>>> I'd be interested in hearing what common practice is regarding pooled
>>>> Client objects, too. Do people use the Apache objects pool library? That's
>>>> the only option I've heard of. Are there other mainstream solutions?
>>>>
>>>> Mario
>>>>
>>>> > On Oct 27, 2014, at 12:39 PM, Rodrigo Uchôa <rodrigo.uc...@gmail.com>
>>>> wrote:
>>>> >
>>>> > [...]
>>>>
>>>> > How should we implement a pool of Client objects in this scenario? Is
>>>> there a common solution?
>>>> >
>>>> > Regards,
>>>> > Rodrigo Uchoa.
>>>>
>>>>
>>>>
>>>> ------------------------------------------------------------------------------
>>>> _______________________________________________
>>>> Resteasy-users mailing list
>>>> Resteasy-users@lists.sourceforge.net
>>>> https://lists.sourceforge.net/lists/listinfo/resteasy-users
>>>>
>>>
>>>
>>>
>>> ------------------------------------------------------------------------------
>>>
>>> _______________________________________________
>>> Resteasy-users mailing list
>>> Resteasy-users@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/resteasy-users
>>>
>>>
>>
>>
>> ------------------------------------------------------------------------------
>>
>> _______________________________________________
>> Resteasy-users mailing list
>> Resteasy-users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/resteasy-users
>>
>>
>
>
> ------------------------------------------------------------------------------
>
> _______________________________________________
> Resteasy-users mailing list
> Resteasy-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/resteasy-users
>
>
------------------------------------------------------------------------------
_______________________________________________
Resteasy-users mailing list
Resteasy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/resteasy-users

Reply via email to