Skip to content

Commit 33f6b1d

Browse files
remove obsolete HTTPClient constants for 3.x and 4.x
1 parent d66c71c commit 33f6b1d

4 files changed

Lines changed: 7 additions & 15 deletions

File tree

modules/transport/http/src/main/java/org/apache/axis2/transport/http/AbstractHTTPTransportSender.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,7 @@ private static String findSOAPAction(MessageContext messageContext) {
495495

496496
public void setHTTPClientVersion(ConfigurationContext configurationContext) {
497497
configurationContext.setProperty(HTTPTransportConstants.HTTP_CLIENT_VERSION,
498-
HTTPTransportConstants.HTTP_CLIENT_3_X_VERSION);
498+
HTTPTransportConstants.HTTP_CLIENT_5_X_VERSION);
499499
}
500500

501501
}

modules/transport/http/src/main/java/org/apache/axis2/transport/http/AxisServlet.java

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -589,17 +589,10 @@ public void destroy() {
589589
// AXIS2-4898: MultiThreadedHttpConnectionManager starts a thread that is not stopped by the
590590
// shutdown of the connection manager. If we want to avoid a resource leak, we need to call
591591
// shutdownAll here.
592-
// TODO - This action need be changed according to current HTTPClient.
593-
String clientVersion = getHTTPClientVersion();
594-
if (clientVersion != null
595-
&& HTTPTransportConstants.HTTP_CLIENT_4_X_VERSION.equals(clientVersion)) {
596-
// TODO - Handle for HTTPClient 4
597-
} else {
598-
try {
599-
Class.forName("org.apache.commons.httpclient.MultiThreadedHttpConnectionManager").getMethod("shutdownAll").invoke(null);
600-
} catch (Exception ex) {
601-
log.warn("Failed to shut down MultiThreadedHttpConnectionManager", ex);
602-
}
592+
try {
593+
Class.forName("org.apache.commons.httpclient.MultiThreadedHttpConnectionManager").getMethod("shutdownAll").invoke(null);
594+
} catch (Exception ex) {
595+
log.error("Failed to shut down MultiThreadedHttpConnectionManager", ex);
603596
}
604597

605598
}

modules/transport/http/src/main/java/org/apache/axis2/transport/http/HTTPTransportConstants.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,7 @@ public class HTTPTransportConstants {
4040

4141
//Settings to define HTTPClient version
4242
public static final String HTTP_CLIENT_VERSION = "http.client.version";
43-
public static final String HTTP_CLIENT_3_X_VERSION = "http.client.version.3x";
44-
public static final String HTTP_CLIENT_4_X_VERSION = "http.client.version.4x";
43+
public static final String HTTP_CLIENT_5_X_VERSION = "http.client.version.5x";
4544

4645
public static final String ANONYMOUS = "anonymous";
4746
public static final String PROXY_HOST_NAME = "proxy_host";

modules/transport/http/src/main/java/org/apache/axis2/transport/http/impl/httpclient5/HTTPClient5TransportSender.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public void cleanup(MessageContext msgContext) throws AxisFault {
6363

6464
public void setHTTPClientVersion(ConfigurationContext configurationContext) {
6565
configurationContext.setProperty(HTTPTransportConstants.HTTP_CLIENT_VERSION,
66-
HTTPTransportConstants.HTTP_CLIENT_4_X_VERSION);
66+
HTTPTransportConstants.HTTP_CLIENT_5_X_VERSION);
6767
}
6868

6969

0 commit comments

Comments
 (0)