From 33596b6fca3804b5e9e685dbe144b7a6879fa96c Mon Sep 17 00:00:00 2001 From: Kanagaraj Manickam k00365106 Date: Mon, 12 Feb 2018 10:18:20 +0530 Subject: Ignore conn manager closure, take care by closure Issue-ID: CLI-92 Change-Id: If2eeabd3a6ee18ab38eca4dff5a67114e372652f Signed-off-by: Kanagaraj Manickam k00365106 --- .../main/java/org/onap/cli/fw/http/connect/OnapHttpConnection.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'profiles/http/src/main/java/org') 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) { -- cgit 1.2.3-korg