1 /*
2 * ====================================================================
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance
9 * with the License. You may obtain a copy of the License at
10 *
11 * http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing,
14 * software distributed under the License is distributed on an
15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 * KIND, either express or implied. See the License for the
17 * specific language governing permissions and limitations
18 * under the License.
19 * ====================================================================
20 *
21 * This software consists of voluntary contributions made by many
22 * individuals on behalf of the Apache Software Foundation. For more
23 * information on the Apache Software Foundation, please see
24 * <http://www.apache.org/>.
25 *
26 */
27
28 package org.apache.http.client.methods;
29
30 import org.apache.http.conn.ClientConnectionRequest;
31 import org.apache.http.conn.ConnectionReleaseTrigger;
32
33 import java.io.IOException;
34
35
36 /**
37 * Interface representing an HTTP request that can be aborted by shutting
38 * down the underlying HTTP connection.
39 *
40 * @since 4.0
41 *
42 * @deprecated (4.3) use {@link HttpExecutionAware}
43 */
44 @Deprecated
45 public interface AbortableHttpRequest {
46
47 /**
48 * Sets the {@link org.apache.http.conn.ClientConnectionRequest}
49 * callback that can be used to abort a long-lived request for a connection.
50 * If the request is already aborted, throws an {@link IOException}.
51 *
52 * @see org.apache.http.conn.ClientConnectionManager
53 */
54 void setConnectionRequest(ClientConnectionRequest connRequest) throws IOException;
55
56 /**
57 * Sets the {@link ConnectionReleaseTrigger} callback that can
58 * be used to abort an active connection.
59 * Typically, this will be the
60 * {@link org.apache.http.conn.ManagedClientConnection} itself.
61 * If the request is already aborted, throws an {@link IOException}.
62 */
63 void setReleaseTrigger(ConnectionReleaseTrigger releaseTrigger) throws IOException;
64
65 /**
66 * Aborts this http request. Any active execution of this method should
67 * return immediately. If the request has not started, it will abort after
68 * the next execution. Aborting this request will cause all subsequent
69 * executions with this request to fail.
70 *
71 * @see org.apache.http.client.HttpClient#execute(HttpUriRequest)
72 * @see org.apache.http.client.HttpClient#execute(org.apache.http.HttpHost,
73 * org.apache.http.HttpRequest)
74 * @see org.apache.http.client.HttpClient#execute(HttpUriRequest,
75 * org.apache.http.protocol.HttpContext)
76 * @see org.apache.http.client.HttpClient#execute(org.apache.http.HttpHost,
77 * org.apache.http.HttpRequest, org.apache.http.protocol.HttpContext)
78 */
79 void abort();
80
81 }
82