Return-Path: Delivered-To: apmail-ws-axis-dev-archive@www.apache.org Received: (qmail 86273 invoked from network); 28 Mar 2006 03:25:22 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 28 Mar 2006 03:25:22 -0000 Received: (qmail 20240 invoked by uid 500); 28 Mar 2006 03:25:12 -0000 Delivered-To: apmail-ws-axis-dev-archive@ws.apache.org Received: (qmail 20139 invoked by uid 500); 28 Mar 2006 03:25:11 -0000 Mailing-List: contact axis-cvs-help@ws.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list axis-cvs@ws.apache.org Received: (qmail 20124 invoked by uid 500); 28 Mar 2006 03:25:11 -0000 Delivered-To: apmail-ws-axis2-cvs@ws.apache.org Received: (qmail 20120 invoked by uid 99); 28 Mar 2006 03:25:11 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 27 Mar 2006 19:25:11 -0800 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [209.237.227.194] (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.29) with SMTP; Mon, 27 Mar 2006 19:25:10 -0800 Received: (qmail 86124 invoked by uid 65534); 28 Mar 2006 03:24:50 -0000 Message-ID: <20060328032450.86123.qmail@minotaur.apache.org> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r389378 - in /webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http: AbstractHTTPSender.java RESTSender.java SOAPOverHTTPSender.java Date: Tue, 28 Mar 2006 03:24:49 -0000 To: axis2-cvs@ws.apache.org From: dims@apache.org X-Mailer: svnmailer-1.0.7 X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: dims Date: Mon Mar 27 19:24:46 2006 New Revision: 389378 URL: http://svn.apache.org/viewcvs?rev=389378&view=rev Log: localize the creation of HttpClient to one method in the abstract class Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/AbstractHTTPSender.java webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/RESTSender.java webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/SOAPOverHTTPSender.java Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/AbstractHTTPSender.java URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/AbstractHTTPSender.java?rev=389378&r1=389377&r2=389378&view=diff ============================================================================== --- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/AbstractHTTPSender.java (original) +++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/AbstractHTTPSender.java Mon Mar 27 19:24:46 2006 @@ -19,6 +19,7 @@ import org.apache.commons.httpclient.NTCredentials; import org.apache.commons.httpclient.NameValuePair; import org.apache.commons.httpclient.UsernamePasswordCredentials; +import org.apache.commons.httpclient.MultiThreadedHttpConnectionManager; import org.apache.commons.httpclient.auth.AuthScope; import org.apache.commons.httpclient.methods.RequestEntity; import org.apache.commons.logging.Log; @@ -50,7 +51,6 @@ protected TransportOutDescription proxyOutSetting = null; protected OMOutputFormat format = new OMOutputFormat(); int connectionTimeout = HTTPConstants.DEFAULT_CONNECTION_TIMEOUT; - protected HttpClient httpClient; public void setChunked(boolean chunked) { this.chunked = chunked; @@ -469,5 +469,21 @@ public boolean isRepeatable() { return true; } + } + + protected HttpClient getHttpClient(MessageContext msgContext) { + MultiThreadedHttpConnectionManager connectionManager = new MultiThreadedHttpConnectionManager(); + + HttpClient httpClient = new HttpClient(connectionManager); + + // Get the timeout values set in the runtime + getTimeoutValues(msgContext); + + // SO_TIMEOUT -- timeout for blocking reads + httpClient.getHttpConnectionManager().getParams().setSoTimeout(soTimeout); + + // timeout for initial connection + httpClient.getHttpConnectionManager().getParams().setConnectionTimeout(connectionTimeout); + return httpClient; } } Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/RESTSender.java URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/RESTSender.java?rev=389378&r1=389377&r2=389378&view=diff ============================================================================== --- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/RESTSender.java (original) +++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/RESTSender.java Mon Mar 27 19:24:46 2006 @@ -147,23 +147,14 @@ + charEncoding); } - this.httpClient = new HttpClient(); + HttpClient httpClient = getHttpClient(msgContext); HostConfiguration hostConfig = this.getHostConfiguration(httpClient, msgContext, url); - // Get the timeout values set in the runtime - getTimeoutValues(msgContext); - - // SO_TIMEOUT -- timeout for blocking reads - httpClient.getHttpConnectionManager().getParams().setSoTimeout(soTimeout); - - // timeout for initial connection - httpClient.getHttpConnectionManager().getParams().setConnectionTimeout(connectionTimeout); - /** * with HostConfiguration */ - this.httpClient.executeMethod(hostConfig, getMethod, null); + httpClient.executeMethod(hostConfig, getMethod, null); if (getMethod.getStatusCode() == HttpStatus.SC_OK) { processResponse(getMethod, msgContext); @@ -192,16 +183,7 @@ // execute the HtttpMethodBase - a connection manager can be given for // handle multiple - httpClient = new HttpClient(); - - // Get the timeout values set in the runtime - getTimeoutValues(msgContext); - - // SO_TIMEOUT -- timeout for blocking reads - httpClient.getHttpConnectionManager().getParams().setSoTimeout(soTimeout); - - // timeout for initial connection - httpClient.getHttpConnectionManager().getParams().setConnectionTimeout(connectionTimeout); + HttpClient httpClient = getHttpClient(msgContext); // todo giving proxy and NTLM support PostMethod postMethod = new PostMethod(url.toString()); @@ -274,7 +256,7 @@ try { HostConfiguration config = this.getHostConfiguration(httpClient, msgContext, url); - this.httpClient.executeMethod(config, postMethod); + httpClient.executeMethod(config, postMethod); if (postMethod.getStatusCode() == HttpStatus.SC_OK) { processResponse(postMethod, msgContext); Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/SOAPOverHTTPSender.java URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/SOAPOverHTTPSender.java?rev=389378&r1=389377&r2=389378&view=diff ============================================================================== --- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/SOAPOverHTTPSender.java (original) +++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/SOAPOverHTTPSender.java Mon Mar 27 19:24:46 2006 @@ -32,17 +32,7 @@ // execute the HtttpMethodBase - a connection manager can be given for // handle multiple - httpClient = new HttpClient(); - - // Get the timeout values set in the runtime - getTimeoutValues(msgContext); - - // SO_TIMEOUT -- timeout for blocking reads - httpClient.getHttpConnectionManager().getParams().setSoTimeout(soTimeout); - - // timeout for initial connection - httpClient.getHttpConnectionManager().getParams().setConnectionTimeout(connectionTimeout); - + HttpClient httpClient = getHttpClient(msgContext); PostMethod postMethod = new PostMethod(url.toString()); String charEncoding = @@ -100,7 +90,7 @@ */ HostConfiguration config = this.getHostConfiguration(httpClient, msgContext, url); - this.httpClient.executeMethod(config, postMethod); + httpClient.executeMethod(config, postMethod); /* * Execution is over