Skip to content

Commit

Permalink
Remove executor (#903)
Browse files Browse the repository at this point in the history
  • Loading branch information
tomas-sexenian authored Nov 27, 2024
1 parent 850a568 commit 878b5a2
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions java/src/main/java/com/genexus/internet/HttpClientJavaLib.java
Original file line number Diff line number Diff line change
Expand Up @@ -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.*;
Expand Down Expand Up @@ -95,7 +93,6 @@ private static void getPoolInstance() {
@Override
protected void finalize() {
this.closeOpenedStreams();
executor.shutdown();
}

private ConnectionKeepAliveStrategy generateKeepAliveStrategy() {
Expand Down Expand Up @@ -617,9 +614,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());
Expand All @@ -631,8 +626,7 @@ public void execute(String method, String url) {
resetStateAdapted();
}
}

private static ExecutorService executor = Executors.newSingleThreadExecutor();

private synchronized void displayHTTPConnections(){
Iterator<HttpRoute> iterator = storedRoutes.iterator();
while (iterator.hasNext()) {
Expand Down

0 comments on commit 878b5a2

Please sign in to comment.