From: Kanagaraj Manickam k00365106 Date: Mon, 12 Feb 2018 04:48:20 +0000 (+0530) Subject: Ignore conn manager closure, take care by closure X-Git-Tag: v2.0.0~3 X-Git-Url: https://gerrit.onap.org/r/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F63%2F31363%2F2;p=cli.git Ignore conn manager closure, take care by closure Issue-ID: CLI-92 Change-Id: If2eeabd3a6ee18ab38eca4dff5a67114e372652f Signed-off-by: Kanagaraj Manickam k00365106 --- diff --git a/profiles/http/src/main/java/org/onap/cli/fw/http/connect/OnapHttpConnection.java b/profiles/http/src/main/java/org/onap/cli/fw/http/connect/OnapHttpConnection.java index 3e03efa7..235a3b98 100644 --- a/profiles/http/src/main/java/org/onap/cli/fw/http/connect/OnapHttpConnection.java +++ b/profiles/http/src/main/java/org/onap/cli/fw/http/connect/OnapHttpConnection.java @@ -126,7 +126,7 @@ public class OnapHttpConnection { .register("https", new SSLConnectionSocketFactory(sslContext, hostnameVerifier)).build(); HttpClientConnectionManager connManager = new PoolingHttpClientConnectionManager(socketFactoryRegistry); - this.httpClient = HttpClients.custom().setConnectionManager(connManager) + this.httpClient = HttpClients.custom().setConnectionManager(connManager) // NOSONAR .setRedirectStrategy(new LaxRedirectStrategy()).build(); } else { this.httpClient = HttpClients.createDefault(); // NOSONAR @@ -345,8 +345,12 @@ public class OnapHttpConnection { return result; } + @SuppressWarnings("deprecation") public void close() { this.mapCommonHeaders.clear(); + if (this.httpClient != null) { + this.httpClient.getConnectionManager().shutdown(); + } } private HttpEntity getMultipartEntity(HttpInput input) {