summaryrefslogtreecommitdiffstats
path: root/sca-java-2.x/trunk/modules/common-http
diff options
context:
space:
mode:
authorrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2010-12-08 23:45:14 +0000
committerrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2010-12-08 23:45:14 +0000
commitc71524917eeecfa8aeb5c497d2c3660f0862ab71 (patch)
tree8dce4111b0864cdd2a43d7e1d7a89b56cbf082f1 /sca-java-2.x/trunk/modules/common-http
parent9f766005792dbd31f8c6d0306ddbbf5c68173104 (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')
-rw-r--r--sca-java-2.x/trunk/modules/common-http/META-INF/MANIFEST.MF1
-rw-r--r--sca-java-2.x/trunk/modules/common-http/src/main/java/org/apache/tuscany/sca/common/http/client/HttpClientFactory.java7
2 files changed, 8 insertions, 0 deletions
diff --git a/sca-java-2.x/trunk/modules/common-http/META-INF/MANIFEST.MF b/sca-java-2.x/trunk/modules/common-http/META-INF/MANIFEST.MF
index ccb1db35c5..267a70a118 100644
--- a/sca-java-2.x/trunk/modules/common-http/META-INF/MANIFEST.MF
+++ b/sca-java-2.x/trunk/modules/common-http/META-INF/MANIFEST.MF
@@ -14,6 +14,7 @@ Import-Package: javax.servlet.http,
org.apache.http,
org.apache.http.client,
org.apache.http.conn,
+ org.apache.http.conn.params,
org.apache.http.conn.scheme,
org.apache.http.conn.ssl,
org.apache.http.impl.client,
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);
}