diff options
author | rfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68> | 2010-12-08 23:45:14 +0000 |
---|---|---|
committer | rfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68> | 2010-12-08 23:45:14 +0000 |
commit | c71524917eeecfa8aeb5c497d2c3660f0862ab71 (patch) | |
tree | 8dce4111b0864cdd2a43d7e1d7a89b56cbf082f1 /sca-java-2.x/trunk/modules/common-http/src/main/java/org/apache/tuscany/sca/common | |
parent | 9f766005792dbd31f8c6d0306ddbbf5c68173104 (diff) |
More version changes and make sure HttpClient connections are released
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1043772 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk/modules/common-http/src/main/java/org/apache/tuscany/sca/common')
-rw-r--r-- | sca-java-2.x/trunk/modules/common-http/src/main/java/org/apache/tuscany/sca/common/http/client/HttpClientFactory.java | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/sca-java-2.x/trunk/modules/common-http/src/main/java/org/apache/tuscany/sca/common/http/client/HttpClientFactory.java b/sca-java-2.x/trunk/modules/common-http/src/main/java/org/apache/tuscany/sca/common/http/client/HttpClientFactory.java index 225bc952fb..73bb9ebb8f 100644 --- a/sca-java-2.x/trunk/modules/common-http/src/main/java/org/apache/tuscany/sca/common/http/client/HttpClientFactory.java +++ b/sca-java-2.x/trunk/modules/common-http/src/main/java/org/apache/tuscany/sca/common/http/client/HttpClientFactory.java @@ -22,6 +22,7 @@ package org.apache.tuscany.sca.common.http.client; import org.apache.http.HttpHost; import org.apache.http.client.HttpClient; import org.apache.http.conn.ClientConnectionManager; +import org.apache.http.conn.params.ConnManagerParams; import org.apache.http.conn.scheme.PlainSocketFactory; import org.apache.http.conn.scheme.Scheme; import org.apache.http.conn.scheme.SchemeRegistry; @@ -42,6 +43,10 @@ public class HttpClientFactory { public HttpClient createHttpClient() { HttpParams defaultParameters = new BasicHttpParams(); //defaultParameters.setIntParameter(HttpConnectionManagerParams.MAX_TOTAL_CONNECTIONS, 10); + + ConnManagerParams.setMaxTotalConnections(defaultParameters, 160); + // ConnManagerParams.setMaxConnectionsPerRoute(defaultParameters, ConnPerRoute); + HttpProtocolParams.setContentCharset(defaultParameters, HTTP.UTF_8); HttpConnectionParams.setConnectionTimeout(defaultParameters, 60000); HttpConnectionParams.setSoTimeout(defaultParameters, 60000); @@ -52,6 +57,8 @@ public class HttpClientFactory { ClientConnectionManager connectionManager = new ThreadSafeClientConnManager(defaultParameters, supportedSchemes); + + return new DefaultHttpClient(connectionManager, defaultParameters); } |