Author: veithen
Date: Sun Jan 22 09:13:59 2017
New Revision: 1779785

URL: http://svn.apache.org/viewvc?rev=1779785&view=rev
Log:
Store the HttpResponse in the Request implementation instead of passing it 
around.

Modified:
    
axis/axis2/java/core/trunk/modules/transport/http/src/org/apache/axis2/transport/http/impl/httpclient4/RequestImpl.java

Modified: 
axis/axis2/java/core/trunk/modules/transport/http/src/org/apache/axis2/transport/http/impl/httpclient4/RequestImpl.java
URL: 
http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/transport/http/src/org/apache/axis2/transport/http/impl/httpclient4/RequestImpl.java?rev=1779785&r1=1779784&r2=1779785&view=diff
==============================================================================
--- 
axis/axis2/java/core/trunk/modules/transport/http/src/org/apache/axis2/transport/http/impl/httpclient4/RequestImpl.java
 (original)
+++ 
axis/axis2/java/core/trunk/modules/transport/http/src/org/apache/axis2/transport/http/impl/httpclient4/RequestImpl.java
 Sun Jan 22 09:13:59 2017
@@ -71,6 +71,7 @@ final class RequestImpl implements Reque
     protected final HttpRequestBase method;
     protected final AbstractHttpClient httpClient;
     private final HttpHost httpHost;
+    private HttpResponse response;
 
     RequestImpl(HTTPSenderImpl sender, MessageContext msgContext, final String 
methodName, URL url,
             AxisRequestEntity requestEntity) throws AxisFault {
@@ -141,14 +142,15 @@ final class RequestImpl implements Reque
     @Override
     public void execute() throws AxisFault {
         try {
-            handleResponse(executeMethod());
+            executeMethod();
+            handleResponse();
         } catch (IOException e) {
             log.info("Unable to send to url[" + url + "]", e);
             throw AxisFault.makeFault(e);
         }
     }
 
-    private HttpResponse executeMethod() throws IOException {
+    private void executeMethod() throws IOException {
         populateHostConfiguration();
 
         // add compression headers if needed
@@ -171,11 +173,10 @@ final class RequestImpl implements Reque
         sender.setTimeouts(msgContext, method);
         HttpContext localContext = new BasicHttpContext();
         // Why do we have add context here
-        return httpClient.execute(httpHost, method, localContext);
+        response = httpClient.execute(httpHost, method, localContext);
     }
 
-    private void handleResponse(HttpResponse response)
-            throws IOException {
+    private void handleResponse() throws IOException {
         boolean cleanup = true;
         try {
             int statusCode = response.getStatusLine().getStatusCode();


Reply via email to