Skip to content

Commit

Permalink
[WAGON-449] Use new connection manager when set
Browse files Browse the repository at this point in the history
Recreate the http-wagon CLIENT after calling
setPoolingHttpClientConnectionManager.

This also includes setting CLIENT to a nonfinal field, and as a result
its name is changed to httpClient to satisfy naming conventions.
  • Loading branch information
hypirion committed Jan 22, 2016
1 parent d4c1240 commit 4f42503
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 3 additions & 0 deletions pom.xml
Expand Up @@ -128,6 +128,9 @@ under the License.
<contributor>
<name>Grzegorz Grzybek</name>
</contributor>
<contributor>
<name>Jean Niklas L'orange</name>
</contributor>
</contributors>

<mailingLists>
Expand Down
Expand Up @@ -364,7 +364,7 @@ private static PoolingHttpClientConnectionManager createConnManager()
return connManager;
}

private static final CloseableHttpClient CLIENT = createClient();
private static CloseableHttpClient httpClient = createClient();

private static CloseableHttpClient createClient()
{
Expand Down Expand Up @@ -481,6 +481,7 @@ public static void setPoolingHttpClientConnectionManager(
PoolingHttpClientConnectionManager poolingHttpClientConnectionManager )
{
httpClientConnectionManager = poolingHttpClientConnectionManager;
httpClient = createClient();
}

public void put( File source, String resourceName )
Expand Down Expand Up @@ -829,7 +830,7 @@ protected CloseableHttpResponse execute( HttpUriRequest httpMethod )
}
}

return CLIENT.execute( httpMethod, localContext );
return httpClient.execute( httpMethod, localContext );
}

protected void setHeaders( HttpUriRequest method )
Expand Down

0 comments on commit 4f42503

Please sign in to comment.