Author: mcardle
Date: Thu Mar 23 05:38:24 2006
New Revision: 204

URL: https://jahia.mine.nu/websvn/listing.php?sc=1&rev=204&repname=esi_server
Log:
* introduces and increases settable maxConnections

Modified:
    trunk/src/net/sf/j2ep/ProxyFilter.java

Modified: trunk/src/net/sf/j2ep/ProxyFilter.java
URL: 
https://jahia.mine.nu/websvn/diff.php?path=/trunk/src/net/sf/j2ep/ProxyFilter.java&rev=204&repname=esi_server
==============================================================================
--- trunk/src/net/sf/j2ep/ProxyFilter.java (original)
+++ trunk/src/net/sf/j2ep/ProxyFilter.java Thu Mar 23 05:38:24 2006
@@ -87,11 +87,17 @@
      * The httpclient used to make all connections with, supplied by 
commons-httpclient.
      */
     private static HttpClient httpClient;
+    private static MultiThreadedHttpConnectionManager 
multiThreadedHttpConnectionManager;
 
     public static HttpClient getHttpClient() {
         return httpClient;
     }
 
+    public static MultiThreadedHttpConnectionManager 
getMultiThreadedHttpConnectionManager() {
+            return multiThreadedHttpConnectionManager;
+    }
+
+
     /**
      * Implementation of a reverse-proxy. All request go through here. This is
      * the main class where are handling starts.
@@ -301,7 +307,10 @@
         Utils.startupWithTrust();
 
         
AllowedMethodHandler.setAllowedMethods("OPTIONS,GET,HEAD,POST,PUT,DELETE,TRACE");
-        httpClient = new HttpClient(new MultiThreadedHttpConnectionManager());
+        multiThreadedHttpConnectionManager = new 
MultiThreadedHttpConnectionManager();
+        
multiThreadedHttpConnectionManager.getParams().setDefaultMaxConnectionsPerHost(20);
  //tODO:get from settingsBean
+        
multiThreadedHttpConnectionManager.getParams().setMaxTotalConnections(40); 
//tODO:get from settingsBean
+        httpClient = new HttpClient(multiThreadedHttpConnectionManager);
         
httpClient.getParams().setBooleanParameter(HttpClientParams.USE_EXPECT_CONTINUE,
 false);
         //ignore cookies since we are dealing with them ourselves
         httpClient.getParams().setCookiePolicy(CookiePolicy.IGNORE_COOKIES);

Reply via email to