hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r658781 - in /httpcomponents/httpclient/trunk/module-client/src: main/java/org/apache/http/client/params/ main/java/org/apache/http/conn/params/ main/java/org/apache/http/impl/client/ test/java/org/apache/http/impl/client/
Date Wed, 21 May 2008 17:42:13 GMT
Author: olegk
Date: Wed May 21 10:42:13 2008
New Revision: 658781

URL: http://svn.apache.org/viewvc?rev=658781&view=rev
Log:
Moved connection manager timeout parameter to ConnManagerPNames

Removed:
    httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/conn/params/HttpConnParams.java
Modified:
    httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/client/params/ClientPNames.java
    httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/client/params/ClientParamBean.java
    httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/client/params/HttpClientParams.java
    httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/conn/params/ConnManagerPNames.java
    httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/conn/params/ConnManagerParamBean.java
    httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/conn/params/HttpConnectionManagerParams.java
    httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/client/DefaultClientRequestDirector.java
    httpcomponents/httpclient/trunk/module-client/src/test/java/org/apache/http/impl/client/TestStatefulConnManagement.java

Modified: httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/client/params/ClientPNames.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/client/params/ClientPNames.java?rev=658781&r1=658780&r2=658781&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/client/params/ClientPNames.java
(original)
+++ httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/client/params/ClientPNames.java
Wed May 21 10:42:13 2008
@@ -43,16 +43,6 @@
 public interface ClientPNames {
 
     /**
-     * Defines the timeout in milliseconds used when retrieving an instance of 
-     * {@link org.apache.http.conn.ManagedClientConnection} from the
-     * {@link org.apache.http.conn.ClientConnectionManager}.
-     * <p>
-     * This parameter expects a value of type {@link Long}.
-     * </p>
-     */ 
-    public static final String CONNECTION_MANAGER_TIMEOUT = "http.connection-manager.timeout";

-
-    /**
      * Defines the class name of the default {@link org.apache.http.conn.ClientConnectionManager}
      * <p>
      * This parameter expects a value of type {@link String}.

Modified: httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/client/params/ClientParamBean.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/client/params/ClientParamBean.java?rev=658781&r1=658780&r2=658781&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/client/params/ClientParamBean.java
(original)
+++ httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/client/params/ClientParamBean.java
Wed May 21 10:42:13 2008
@@ -45,10 +45,6 @@
         super(params);
     }
 
-    public void setConnectionManagerTimeout (final long timeout) {
-        params.setLongParameter(ClientPNames.CONNECTION_MANAGER_TIMEOUT, timeout);
-    }
-
     public void setConnectionManagerFactoryClassName (final String factory) {
         params.setParameter(ClientPNames.CONNECTION_MANAGER_FACTORY_CLASS_NAME, factory);
     }

Modified: httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/client/params/HttpClientParams.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/client/params/HttpClientParams.java?rev=658781&r1=658780&r2=658781&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/client/params/HttpClientParams.java
(original)
+++ httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/client/params/HttpClientParams.java
Wed May 21 10:42:13 2008
@@ -47,36 +47,6 @@
         super();
     }
 
-    /**
-     * Returns the timeout in milliseconds used when retrieving a
-     * {@link org.apache.http.conn.ManagedClientConnection} from the
-     * {@link org.apache.http.conn.ClientConnectionManager}.
-     * 
-     * @return timeout in milliseconds.
-     */ 
-    public static long getConnectionManagerTimeout(final HttpParams params) {
-        if (params == null) {
-            throw new IllegalArgumentException("HTTP parameters may not be null");
-        }
-        return params.getLongParameter
-            (ClientPNames.CONNECTION_MANAGER_TIMEOUT, 0);
-    }
-
-    /**
-     * Sets the timeout in milliseconds used when retrieving a
-     * {@link org.apache.http.conn.ManagedClientConnection} from the
-     * {@link org.apache.http.conn.ClientConnectionManager}.
-     * 
-     * @param timeout the timeout in milliseconds
-     */ 
-    public static void setConnectionManagerTimeout(final HttpParams params, long timeout)
{
-        if (params == null) {
-            throw new IllegalArgumentException("HTTP parameters may not be null");
-        }
-        params.setLongParameter
-            (ClientPNames.CONNECTION_MANAGER_TIMEOUT, timeout);
-    }
-
     public static boolean isRedirecting(final HttpParams params) {
         if (params == null) {
             throw new IllegalArgumentException("HTTP parameters may not be null");

Modified: httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/conn/params/ConnManagerPNames.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/conn/params/ConnManagerPNames.java?rev=658781&r1=658780&r2=658781&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/conn/params/ConnManagerPNames.java
(original)
+++ httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/conn/params/ConnManagerPNames.java
Wed May 21 10:42:13 2008
@@ -40,6 +40,16 @@
  */
 public interface ConnManagerPNames {
 
+    /**
+     * Defines the timeout in milliseconds used when retrieving an instance of 
+     * {@link org.apache.http.conn.ManagedClientConnection} from the
+     * {@link org.apache.http.conn.ClientConnectionManager}.
+     * <p>
+     * This parameter expects a value of type {@link Long}.
+     * </p>
+     */ 
+    public static final String TIMEOUT = "http.conn-manager.timeout"; 
+
     /** 
      * Defines the maximum number of connections per route.
      * This limit is interpreted by client connection managers

Modified: httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/conn/params/ConnManagerParamBean.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/conn/params/ConnManagerParamBean.java?rev=658781&r1=658780&r2=658781&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/conn/params/ConnManagerParamBean.java
(original)
+++ httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/conn/params/ConnManagerParamBean.java
Wed May 21 10:42:13 2008
@@ -44,6 +44,10 @@
     public ConnManagerParamBean (final HttpParams params) {
         super(params);
     }
+    
+    public void setTimeout (final long timeout) {
+        params.setLongParameter(ConnManagerPNames.TIMEOUT, timeout);
+    }
 
     /** @see ConnManagerPNames#MAX_TOTAL_CONNECTIONS */
     public void setMaxTotalConnections (final int maxConnections) {

Modified: httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/conn/params/HttpConnectionManagerParams.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/conn/params/HttpConnectionManagerParams.java?rev=658781&r1=658780&r2=658781&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/conn/params/HttpConnectionManagerParams.java
(original)
+++ httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/conn/params/HttpConnectionManagerParams.java
Wed May 21 10:42:13 2008
@@ -52,6 +52,34 @@
     /** The default maximum number of connections allowed overall */
     public static final int DEFAULT_MAX_TOTAL_CONNECTIONS = 20;
 
+    /**
+     * Returns the timeout in milliseconds used when retrieving a
+     * {@link org.apache.http.conn.ManagedClientConnection} from the
+     * {@link org.apache.http.conn.ClientConnectionManager}.
+     * 
+     * @return timeout in milliseconds.
+     */ 
+    public static long getTimeout(final HttpParams params) {
+        if (params == null) {
+            throw new IllegalArgumentException("HTTP parameters may not be null");
+        }
+        return params.getLongParameter(TIMEOUT, 0);
+    }
+
+    /**
+     * Sets the timeout in milliseconds used when retrieving a
+     * {@link org.apache.http.conn.ManagedClientConnection} from the
+     * {@link org.apache.http.conn.ClientConnectionManager}.
+     * 
+     * @param timeout the timeout in milliseconds
+     */ 
+    public static void setTimeout(final HttpParams params, long timeout) {
+        if (params == null) {
+            throw new IllegalArgumentException("HTTP parameters may not be null");
+        }
+        params.setLongParameter(TIMEOUT, timeout);
+    }
+
     /** The default maximum number of connections allowed per host */
     private static final ConnPerRoute DEFAULT_CONN_PER_ROUTE = new ConnPerRoute() {
         

Modified: httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/client/DefaultClientRequestDirector.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/client/DefaultClientRequestDirector.java?rev=658781&r1=658780&r2=658781&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/client/DefaultClientRequestDirector.java
(original)
+++ httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/client/DefaultClientRequestDirector.java
Wed May 21 10:42:13 2008
@@ -74,6 +74,7 @@
 import org.apache.http.conn.ClientConnectionManager;
 import org.apache.http.conn.ClientConnectionRequest;
 import org.apache.http.conn.ManagedClientConnection;
+import org.apache.http.conn.params.HttpConnectionManagerParams;
 import org.apache.http.conn.routing.BasicRouteDirector;
 import org.apache.http.conn.routing.HttpRoute;
 import org.apache.http.conn.routing.HttpRouteDirector;
@@ -277,7 +278,7 @@
 
         RoutedRequest roureq = new RoutedRequest(origWrapper, origRoute); 
 
-        long timeout = HttpClientParams.getConnectionManagerTimeout(params);
+        long timeout = HttpConnectionManagerParams.getTimeout(params);
         
         int execCount = 0;
         

Modified: httpcomponents/httpclient/trunk/module-client/src/test/java/org/apache/http/impl/client/TestStatefulConnManagement.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/module-client/src/test/java/org/apache/http/impl/client/TestStatefulConnManagement.java?rev=658781&r1=658780&r2=658781&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/module-client/src/test/java/org/apache/http/impl/client/TestStatefulConnManagement.java
(original)
+++ httpcomponents/httpclient/trunk/module-client/src/test/java/org/apache/http/impl/client/TestStatefulConnManagement.java
Wed May 21 10:42:13 2008
@@ -42,7 +42,6 @@
 import org.apache.http.client.HttpClient;
 import org.apache.http.client.UserTokenHandler;
 import org.apache.http.client.methods.HttpGet;
-import org.apache.http.client.params.HttpClientParams;
 import org.apache.http.conn.ManagedClientConnection;
 import org.apache.http.conn.params.ConnPerRouteBean;
 import org.apache.http.conn.params.HttpConnectionManagerParams;
@@ -103,7 +102,7 @@
         HttpConnectionManagerParams.setMaxTotalConnections(params, workerCount);
         HttpConnectionManagerParams.setMaxConnectionsPerRoute(params, 
                 new ConnPerRouteBean(workerCount));
-        HttpClientParams.setConnectionManagerTimeout(params, 10L);
+        HttpConnectionManagerParams.setTimeout(params, 10L);
         
         ThreadSafeClientConnManager mgr = new ThreadSafeClientConnManager(
                 params, supportedSchemes);        



Mime
View raw message