2
* $Header: /home/cvs/jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/HttpConnectionManager.java,v 1.15.2.1 2004/02/22 18:21:13 olegk Exp $
3
* $Revision: 1.15.2.1 $
4
* $Date: 2004/02/22 18:21:13 $
6
* ====================================================================
8
* Copyright 1999-2004 The Apache Software Foundation
10
* Licensed under the Apache License, Version 2.0 (the "License");
11
* you may not use this file except in compliance with the License.
12
* You may obtain a copy of the License at
14
* http://www.apache.org/licenses/LICENSE-2.0
16
* Unless required by applicable law or agreed to in writing, software
17
* distributed under the License is distributed on an "AS IS" BASIS,
18
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19
* See the License for the specific language governing permissions and
20
* limitations under the License.
21
* ====================================================================
23
* This software consists of voluntary contributions made by many
24
* individuals on behalf of the Apache Software Foundation. For more
25
* information on the Apache Software Foundation, please see
26
* <http://www.apache.org/>.
28
* [Additional notices, if required by prior licensing conditions]
32
package org.apache.commons.httpclient;
35
* An interface for classes that manage HttpConnections.
37
* @see org.apache.commons.httpclient.HttpConnection
38
* @see org.apache.commons.httpclient.HttpClient#HttpClient(HttpConnectionManager)
41
* @author <a href="mailto:mbowler@GargoyleSoftware.com">Mike Bowler</a>
45
public interface HttpConnectionManager {
48
* Gets an HttpConnection for a given host configuration. If a connection is
49
* not available this method will block until one is.
51
* The connection manager should be registered with any HttpConnection that
54
* @param hostConfiguration the host configuration to use to configure the
57
* @return an HttpConnection for the given configuration
59
* @see HttpConnection#setHttpConnectionManager(HttpConnectionManager)
61
HttpConnection getConnection(HostConfiguration hostConfiguration);
64
* Gets an HttpConnection for a given host configuration. If a connection is
65
* not available, this method will block for at most the specified number of
66
* milliseconds or until a connection becomes available.
68
* The connection manager should be registered with any HttpConnection that
71
* @param hostConfiguration the host configuration to use to configure the
73
* @param timeout - the time (in milliseconds) to wait for a connection to
74
* become available, 0 to specify an infinite timeout
76
* @return an HttpConnection for the given configuraiton
78
* @throws HttpException if no connection becomes available before the
81
* @see HttpConnection#setHttpConnectionManager(HttpConnectionManager)
83
HttpConnection getConnection(HostConfiguration hostConfiguration, long timeout)
87
* Releases the given HttpConnection for use by other requests.
89
* @param conn - The HttpConnection to make available.
91
void releaseConnection(HttpConnection conn);