users@jersey.java.net

Re: [Jersey] A Jersey Client doing HTTP Cache

From: Paul Sandoz <Paul.Sandoz_at_oracle.com>
Date: Tue, 12 Oct 2010 13:17:08 +0200

On Oct 12, 2010, at 6:26 AM, Imran M Yousuf wrote:
>
>>> Note that i moved the configuration in the constructor of
>>> DefaultApacheHttpMethodExecutor to the constructor of
>>> ApacheHttpClientHandler, this is associated with the setting of
>>> pre-emptive
>>> authentication and timeouts for configiuration on the Apache
>>> HttpClient and
>>> not really specific to the method execution itself.
>>>
>
> Not related to method execution directly, but IMHO, it is indirectly
> as it controls how to authorize and how long to wait for server.
> Furthermore, as you might have noticed in the change in GitHub above,
> due to moving it away from executor I needed to set them in my custom
> client handler and I am afraid that would be the case always for other
> users as well. How can we have it a common place so that I or others
> who might want to use do not have rewrite these few lines of code?
>
>>> Please let me know if this is sufficient for you,
>>> Paul.
>
> Well, its sufficient, I do mind writing the 2 settings repeatedly, but
> I would have preferred not to :).
>

Can CacheableClientHandler can extend from ApacheHttpClientHandler and
use the following constructor:

     public ApacheHttpClientHandler(HttpClient client, ClientConfig
config,
             ApacheHttpMethodExecutor methodExecutor)

Paul.