Ignore conn manager closure, take care by closure 63/31363/2
authorKanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com>
Mon, 12 Feb 2018 04:48:20 +0000 (10:18 +0530)
committerKanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com>
Mon, 12 Feb 2018 05:56:08 +0000 (11:26 +0530)
Issue-ID: CLI-92

Change-Id: If2eeabd3a6ee18ab38eca4dff5a67114e372652f
Signed-off-by: Kanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com>
profiles/http/src/main/java/org/onap/cli/fw/http/connect/OnapHttpConnection.java

index 3e03efa..235a3b9 100644 (file)
@@ -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) {