michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: The client-side connection management and handling API that provides interfaces michael@0: and implementations for opening and managing client side HTTP connections. michael@0:

michael@0: The lowest layer of connection handling is comprised of michael@0: {@link org.apache.http.conn.OperatedClientConnection OperatedClientConnection} michael@0: and michael@0: {@link org.apache.http.conn.ClientConnectionOperator ClientConnectionOperator}. michael@0: The connection interface extends the core michael@0: {@link org.apache.http.HttpClientConnection HttpClientConnection} michael@0: by operations to set and update a socket. An operator encapsulates the logic to michael@0: open and layer sockets, typically using a michael@0: {@link org.apache.http.conn.scheme.SocketFactory}. The socket factory for michael@0: a protocol {@link org.apache.http.conn.scheme.Scheme} such as "http" or "https" michael@0: can be looked up in a {@link org.apache.http.conn.scheme.SchemeRegistry}. michael@0: Applications without a need for sophisticated connection management can use michael@0: this layer directly. michael@0:

michael@0:

michael@0: On top of that lies the connection management layer. A michael@0: {@link org.apache.http.conn.ClientConnectionManager} internally manages michael@0: operated connections, but hands out instances of michael@0: {@link org.apache.http.conn.ManagedClientConnection}. michael@0: This interface abstracts from the underlying socket operations and michael@0: provides convenient methods for opening and updating sockets in order michael@0: to establish a {@link org.apache.http.conn.routing.HttpRoute route}. michael@0: The operator is encapsulated by the connection manager and called michael@0: automatically. michael@0:

michael@0:

michael@0: Connections obtained from a manager have to be returned after use. michael@0: This can be {@link org.apache.http.conn.ConnectionReleaseTrigger triggered} michael@0: on various levels, either by releasing the michael@0: {@link org.apache.http.conn.ManagedClientConnection connection} directly, michael@0: or by calling a method on michael@0: an {@link org.apache.http.conn.BasicManagedEntity entity} received from michael@0: the connection, or by closing the michael@0: {@link org.apache.http.conn.EofSensorInputStream stream} from which michael@0: that entity is being read. michael@0:

michael@0:

michael@0: Connection managers will try to keep returned connections alive in michael@0: order to re-use them for subsequent requests along the same route. michael@0: The managed connection interface and all triggers for connection release michael@0: provide methods to enable or disable this behavior. michael@0:

michael@0: michael@0: michael@0: