[resteasy-dev] Proposed changes to org.jboss.resteasy.client.jaxrs.engines.ApacheHttpClient4Engine

Weinan Li weli at redhat.com
Sun May 15 23:36:06 EDT 2016


Hi Rebecca,

Here are two relative issues maybe you'll be interested in:

https://issues.jboss.org/browse/RESTEASY-975
https://issues.jboss.org/browse/RESTEASY-1023

- Weinan Li

> On May 16, 2016, at 4:01 AM, Rebecca Searls <rsearls at redhat.com> wrote:
> 
> 
> I'm cleaning up the deprecated apache classes in resteasy-client.
> I am currently working on org.jboss.resteasy.client.jaxrs.engines.ApacheHttpClient4Engine.
> One of four ApacheHttpClient4Engine constructor methods is using the deprecated class 
> org.apache.http.impl.client.DefaultHttpClient.
> 
>   public ApacheHttpClient4Engine()
>   {
>      this.httpClient = new DefaultHttpClient();
>      this.createdHttpClient = true;
>   }
> 
> Apache's (version 4.3) requirement is to use a HttpClientBuilder to generated a new HttpClient
> object.  I can generated the HttpClient using Builder, HOWEVER doing so will mean a HttpHost 
> can never be assigned to the this.httpClient object. 
> 
> I propose doing the following to address this.
> 
>    1) Implement the no-arg constructor using the new Builder procedure.
>       Adding Javadoc comments of the restriction to this constructor. 
>    2) Create a new constructor method that requires the input argument of HttpHost
>        and generates the HttpClient using the Builder procedure.
> 
> 
> 
> ApacheHttpClient4Engine methods getDefaultProxy setDefaultProxy are obsolete.
> A HttpPort object can not longer be set or retrieved from HttpClient using 
> org.apache.http.params.HttpParams. 
> 
> I don't find any Resteasy code calling getDefaultProxy.  There is only 1 call
> to setDefaultProxy which is easily addressed.
> Since both methods are public, I propose the following changes.
> 
> 1) Tag both methods deprecated.
> 2) getDefaultProxy() will always return NULL;
> 3) setDefaultProxy() will do nothing.
> 4) Add Javadoc to both methods.
> 
> Comments and suggestions on these proposals would be appreciated.
> _______________________________________________
> resteasy-dev mailing list
> resteasy-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/resteasy-dev




More information about the resteasy-dev mailing list