Skip to content

Commit 878b5a2

Browse files
Remove executor (#903)
Issue:200786
1 parent 850a568 commit 878b5a2

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

java/src/main/java/com/genexus/internet/HttpClientJavaLib.java

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@
1313
import java.security.cert.CertificateException;
1414
import java.util.*;
1515
import java.net.URI;
16-
import java.util.concurrent.ExecutorService;
17-
import java.util.concurrent.Executors;
1816
import javax.net.ssl.SSLContext;
1917

2018
import org.apache.http.*;
@@ -95,7 +93,6 @@ private static void getPoolInstance() {
9593
@Override
9694
protected void finalize() {
9795
this.closeOpenedStreams();
98-
executor.shutdown();
9996
}
10097

10198
private ConnectionKeepAliveStrategy generateKeepAliveStrategy() {
@@ -617,9 +614,7 @@ public void execute(String method, String url) {
617614
}
618615
finally {
619616
if (Application.isJMXEnabled()){
620-
if (executor.isShutdown())
621-
executor = Executors.newSingleThreadExecutor();
622-
executor.submit(this::displayHTTPConnections);
617+
this.displayHTTPConnections();
623618
}
624619
if (getIsURL()) {
625620
this.setHost(getPrevURLhost());
@@ -631,8 +626,7 @@ public void execute(String method, String url) {
631626
resetStateAdapted();
632627
}
633628
}
634-
635-
private static ExecutorService executor = Executors.newSingleThreadExecutor();
629+
636630
private synchronized void displayHTTPConnections(){
637631
Iterator<HttpRoute> iterator = storedRoutes.iterator();
638632
while (iterator.hasNext()) {

0 commit comments

Comments
 (0)