ClientConnectionManager declares InterruptedException
git-svn-id: https://svn.apache.org/repos/asf/jakarta/httpcomponents/httpclient/trunk@578383 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
c67d2fc640
commit
5d5b2fa48d
|
@ -84,11 +84,12 @@ public interface ClientRequestDirector {
|
|||
* @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
|
||||
;
|
||||
|
||||
|
||||
|
|
|
@ -91,20 +91,21 @@ public interface HttpClient {
|
|||
;
|
||||
|
||||
/**
|
||||
* 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 @@ public interface HttpClient {
|
|||
*
|
||||
* @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 @@ public interface HttpClient {
|
|||
*
|
||||
* @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 @@ public interface HttpClient {
|
|||
*
|
||||
* @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
|
||||
|
|
|
@ -79,8 +79,12 @@ public interface ClientConnectionManager {
|
|||
*
|
||||
* @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 @@ public interface ClientConnectionManager {
|
|||
* 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
|
||||
;
|
||||
|
||||
|
||||
|
|
|
@ -406,21 +406,10 @@ public abstract class AbstractHttpClient
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* 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 abstract class AbstractHttpClient
|
|||
*/
|
||||
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 abstract class AbstractHttpClient
|
|||
|
||||
|
||||
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
|
||||
|
|
|
@ -254,7 +254,7 @@ public class DefaultClientRequestDirector
|
|||
|
||||
// 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 @@ public class DefaultClientRequestDirector
|
|||
} catch (IOException ex) {
|
||||
abortConnection();
|
||||
throw ex;
|
||||
} catch (InterruptedException ex) {
|
||||
abortConnection();
|
||||
throw ex;
|
||||
} catch (RuntimeException ex) {
|
||||
abortConnection();
|
||||
throw ex;
|
||||
|
@ -438,11 +441,14 @@ public class DefaultClientRequestDirector
|
|||
*
|
||||
* @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);
|
||||
|
||||
|
|
Loading…
Reference in New Issue