From e6213c9f696e7b3127fe2a177730431f19062916 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Sexenian?= <99925035+tomas-sexenian@users.noreply.github.com> Date: Wed, 9 Oct 2024 03:59:24 -0300 Subject: [PATCH] Remove executor Issue:200786 --- .../java/com/genexus/internet/HttpClientJavaLib.java | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/java/src/main/java/com/genexus/internet/HttpClientJavaLib.java b/java/src/main/java/com/genexus/internet/HttpClientJavaLib.java index a3fd0de21..4771697b4 100644 --- a/java/src/main/java/com/genexus/internet/HttpClientJavaLib.java +++ b/java/src/main/java/com/genexus/internet/HttpClientJavaLib.java @@ -13,8 +13,6 @@ import java.security.cert.CertificateException; import java.util.*; import java.net.URI; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Executors; import javax.net.ssl.SSLContext; import org.apache.http.*; @@ -96,7 +94,6 @@ private static void getPoolInstance() { @Override protected void finalize() { this.closeOpenedStreams(); - executor.shutdown(); } private ConnectionKeepAliveStrategy generateKeepAliveStrategy() { @@ -618,9 +615,7 @@ public void execute(String method, String url) { } finally { if (Application.isJMXEnabled()){ - if (executor.isShutdown()) - executor = Executors.newSingleThreadExecutor(); - executor.submit(this::displayHTTPConnections); + this.displayHTTPConnections(); } if (getIsURL()) { this.setHost(getPrevURLhost()); @@ -632,8 +627,7 @@ public void execute(String method, String url) { resetStateAdapted(); } } - - private static ExecutorService executor = Executors.newSingleThreadExecutor(); + private synchronized void displayHTTPConnections(){ Iterator iterator = storedRoutes.iterator(); while (iterator.hasNext()) {