You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hc.apache.org by ro...@apache.org on 2007/09/22 09:07:45 UTC

svn commit: r578383 - in /jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http: client/ conn/ impl/client/

Author: rolandw
Date: Sat Sep 22 00:07:44 2007
New Revision: 578383

URL: http://svn.apache.org/viewvc?rev=578383&view=rev
Log:
ClientConnectionManager declares InterruptedException

Modified:
    jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/client/ClientRequestDirector.java
    jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/client/HttpClient.java
    jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/conn/ClientConnectionManager.java
    jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/client/AbstractHttpClient.java
    jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/client/DefaultClientRequestDirector.java

Modified: jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/client/ClientRequestDirector.java
URL: http://svn.apache.org/viewvc/jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/client/ClientRequestDirector.java?rev=578383&r1=578382&r2=578383&view=diff
==============================================================================
--- jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/client/ClientRequestDirector.java (original)
+++ jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/client/ClientRequestDirector.java Sat Sep 22 00:07:44 2007
@@ -84,11 +84,12 @@
      * @return  the final response to the request.
      *          This is never an intermediate response with status code 1xx.
      *
-     * @throws HttpException    in case of a problem
-     * @throws IOException      in case of an IO problem
+     * @throws HttpException            in case of a problem
+     * @throws IOException              in case of an IO problem
+     * @throws InterruptedException     in case of an interrupt
      */
     HttpResponse execute(RoutedRequest roureq, HttpContext context)
-        throws HttpException, IOException
+        throws HttpException, IOException, InterruptedException
         ;
 
 

Modified: jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/client/HttpClient.java
URL: http://svn.apache.org/viewvc/jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/client/HttpClient.java?rev=578383&r1=578382&r2=578383&view=diff
==============================================================================
--- jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/client/HttpClient.java (original)
+++ jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/client/HttpClient.java Sat Sep 22 00:07:44 2007
@@ -91,20 +91,21 @@
         ;
 
     /**
-     * Executes a request using the {@link #getDefaultContext() default context}.
-     *              
-     * see there for details.
+     * Executes a request using the
+     * {@link #getDefaultContext() default context}.
+     * See there for details.
      *
      * @param request   the request to execute
      *
      * @return  the response to the request
      *
-     * @throws HttpException    in case of a problem
-     * @throws IOException      in case of an IO problem
+     * @throws HttpException            in case of a problem
+     * @throws IOException              in case of an IO problem
+     * @throws InterruptedException     in case of an interrupt
      * <br/><i @@@>timeout exceptions?</i>
      */
     HttpResponse execute(HttpUriRequest request)
-        throws HttpException, IOException
+        throws HttpException, IOException, InterruptedException
         ;
 
 
@@ -125,10 +126,11 @@
      *
      * @throws HttpException    in case of a problem
      * @throws IOException      in case of an IO problem
+     * @throws InterruptedException     in case of an interrupt
      * <br/><i @@@>timeout exceptions?</i>
      */
     HttpResponse execute(HttpUriRequest request, HttpContext context)
-        throws HttpException, IOException
+        throws HttpException, IOException, InterruptedException
         ;
 
 
@@ -146,10 +148,11 @@
      *
      * @throws HttpException    in case of a problem
      * @throws IOException      in case of an IO problem
+     * @throws InterruptedException     in case of an interrupt
      * <br/><i @@@>timeout exceptions?</i>
      */
     HttpResponse execute(RoutedRequest roureq, HttpContext context)
-        throws HttpException, IOException
+        throws HttpException, IOException, InterruptedException
         ;
 
     /**
@@ -164,10 +167,11 @@
      *
      * @throws HttpException    in case of a problem
      * @throws IOException      in case of an IO problem
+     * @throws InterruptedException     in case of an interrupt
      * <br/><i @@@>timeout exceptions?</i>
      */
     HttpResponse execute(RoutedRequest roureq)
-        throws HttpException, IOException
+        throws HttpException, IOException, InterruptedException
         ;
 
 } // interface HttpClient

Modified: jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/conn/ClientConnectionManager.java
URL: http://svn.apache.org/viewvc/jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/conn/ClientConnectionManager.java?rev=578383&r1=578382&r2=578383&view=diff
==============================================================================
--- jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/conn/ClientConnectionManager.java (original)
+++ jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/conn/ClientConnectionManager.java Sat Sep 22 00:07:44 2007
@@ -79,8 +79,12 @@
      *
      * @return  a connection that can be used to communicate
      *          along the given route
+     *
+     * @throws InterruptedException
+     *         if the calling thread is interrupted while waiting
      */
     ManagedClientConnection getConnection(HttpRoute route)
+        throws InterruptedException
         ;
 
 
@@ -97,11 +101,13 @@
      *          along the given route
      *
      * @throws ConnectionPoolTimeoutException
-     *          in case of a timeout
+     *         in case of a timeout
+     * @throws InterruptedException
+     *         if the calling thread is interrupted while waiting
      */
     ManagedClientConnection getConnection(HttpRoute route,
                                           long timeout)
-        throws ConnectionPoolTimeoutException
+        throws ConnectionPoolTimeoutException, InterruptedException
         ;
 
 

Modified: jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/client/AbstractHttpClient.java
URL: http://svn.apache.org/viewvc/jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/client/AbstractHttpClient.java?rev=578383&r1=578382&r2=578383&view=diff
==============================================================================
--- jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/client/AbstractHttpClient.java (original)
+++ jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/client/AbstractHttpClient.java Sat Sep 22 00:07:44 2007
@@ -406,21 +406,10 @@
     }
 
 
-    /**
-     * Maps to {@link #execute(HttpUriRequest,HttpContext)
-     *                 execute(request, context)}.
-     * The route is computed by {@link #determineRoute determineRoute}.
-     * This method uses {@link #getDefaultContext() default context}.
-     *
-     * @param request   the request to execute
-     *
-     * @return  the response to the request
-     *
-     * @throws HttpException    in case of a problem
-     * @throws IOException      in case of an IO problem
-     */
+
+    // non-javadoc, see interface HttpClient
     public final HttpResponse execute(HttpUriRequest request)
-        throws HttpException, IOException {
+        throws HttpException, IOException, InterruptedException {
 
         return execute(request, null);
     }
@@ -437,7 +426,7 @@
      */
     public final HttpResponse execute(HttpUriRequest request,
                                       HttpContext context)
-        throws HttpException, IOException {
+        throws HttpException, IOException, InterruptedException {
 
         if (request == null) {
             throw new IllegalArgumentException
@@ -468,14 +457,15 @@
 
     
     public HttpResponse execute(RoutedRequest roureq) 
-        throws HttpException, IOException {
+        throws HttpException, IOException, InterruptedException {
         return execute(roureq, null);
     }
 
 
     // non-javadoc, see interface HttpClient
-    public final HttpResponse execute(RoutedRequest roureq, HttpContext context)
-        throws HttpException, IOException {
+    public final HttpResponse execute(RoutedRequest roureq,
+                                      HttpContext context)
+        throws HttpException, IOException, InterruptedException {
 
         if (roureq == null) {
             throw new IllegalArgumentException

Modified: jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/client/DefaultClientRequestDirector.java
URL: http://svn.apache.org/viewvc/jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/client/DefaultClientRequestDirector.java?rev=578383&r1=578382&r2=578383&view=diff
==============================================================================
--- jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/client/DefaultClientRequestDirector.java (original)
+++ jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/client/DefaultClientRequestDirector.java Sat Sep 22 00:07:44 2007
@@ -254,7 +254,7 @@
     
     // non-javadoc, see interface ClientRequestDirector
     public HttpResponse execute(RoutedRequest roureq, HttpContext context)
-        throws HttpException, IOException {
+        throws HttpException, IOException, InterruptedException {
 
         HttpRequest orig = roureq.getRequest();
         HttpParamsLinker.link(orig, this.params);
@@ -426,6 +426,9 @@
         } catch (IOException ex) {
             abortConnection();
             throw ex;
+        } catch (InterruptedException ex) {
+            abortConnection();
+            throw ex;
         } catch (RuntimeException ex) {
             abortConnection();
             throw ex;
@@ -438,11 +441,14 @@
      *
      * @param route     the route for which to allocate a connection
      *
-     * @throws HttpException    in case of a problem
+     * @throws HttpException    in case of a (protocol) problem
+     * @throws ConnectionPoolTimeoutException   in case of a timeout
+     * @throws InterruptedException     in case of an interrupt
      */
     protected ManagedClientConnection allocateConnection(HttpRoute route,
                                                          long timeout)
-        throws HttpException, ConnectionPoolTimeoutException {
+        throws HttpException, ConnectionPoolTimeoutException,
+               InterruptedException {
 
         return connManager.getConnection(route, timeout);