Package org.apache.http.impl.conn
Class AbstractPoolEntry
java.lang.Object
org.apache.http.impl.conn.AbstractPoolEntry
- Direct Known Subclasses:
BasicPoolEntry,SingleClientConnManager.PoolEntry
public abstract class AbstractPoolEntry extends Object
A pool entry for use by connection manager implementations.
Pool entries work in conjunction with an
If the managed connections is released or revoked, the adapter gets disconnected, but the pool entry still contains the underlying connection and the established route.
adapter.
The adapter is handed out to applications that obtain a connection.
The pool entry stores the underlying connection and tracks the
route established.
The adapter delegates methods for establishing the route to
it's pool entry.
If the managed connections is released or revoked, the adapter gets disconnected, but the pool entry still contains the underlying connection and the established route.
- Since:
- 4.0
- Version:
- $Revision: 658775 $
- Author:
- Roland Weber, Michael Becke
-
Field Summary
Fields Modifier and Type Field Description protected OperatedClientConnectionconnectionThe underlying connection being pooled or used.protected ClientConnectionOperatorconnOperatorThe connection operator.protected HttpRouterouteThe route for which this entry gets allocated.protected ObjectstateConnection state objectprotected RouteTrackertrackerThe tracked route, ornullbefore tracking starts. -
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractPoolEntry(ClientConnectionOperator connOperator, HttpRoute route)Creates a new pool entry. -
Method Summary
Modifier and Type Method Description ObjectgetState()Returns the state object associated with this pool entry.voidlayerProtocol(HttpContext context, HttpParams params)Layers a protocol on top of an established tunnel.voidopen(HttpRoute route, HttpContext context, HttpParams params)Opens the underlying connection.voidsetState(Object state)Assigns a state object to this pool entry.protected voidshutdownEntry()Shuts down the entry.voidtunnelProxy(HttpHost next, boolean secure, HttpParams params)Tracks tunnelling of the connection to a chained proxy.voidtunnelTarget(boolean secure, HttpParams params)Tracks tunnelling of the connection to the target.
-
Field Details
-
connOperator
The connection operator. -
connection
The underlying connection being pooled or used. -
route
The route for which this entry gets allocated. -
state
Connection state object -
tracker
The tracked route, ornullbefore tracking starts.
-
-
Constructor Details
-
AbstractPoolEntry
Creates a new pool entry.- Parameters:
connOperator- the Connection Operator for this entryroute- the planned route for the connection, ornull
-
-
Method Details
-
getState
Returns the state object associated with this pool entry.- Returns:
- The state object
-
setState
Assigns a state object to this pool entry.- Parameters:
state- The state object
-
open
Opens the underlying connection.- Parameters:
route- the route along which to open the connectioncontext- the context for opening the connectionparams- the parameters for opening the connection- Throws:
IOException- in case of a problem
-
tunnelTarget
Tracks tunnelling of the connection to the target. The tunnel has to be established outside by sending a CONNECT request to the (last) proxy.- Parameters:
secure-trueif the tunnel should be considered secure,falseotherwiseparams- the parameters for tunnelling the connection- Throws:
IOException- in case of a problem
-
tunnelProxy
Tracks tunnelling of the connection to a chained proxy. The tunnel has to be established outside by sending a CONNECT request to the previous proxy.- Parameters:
next- the proxy to which the tunnel was established. SeeManagedClientConnection.tunnelProxyfor details.secure-trueif the tunnel should be considered secure,falseotherwiseparams- the parameters for tunnelling the connection- Throws:
IOException- in case of a problem
-
layerProtocol
Layers a protocol on top of an established tunnel.- Parameters:
context- the context for layeringparams- the parameters for layering- Throws:
IOException- in case of a problem
-
shutdownEntry
protected void shutdownEntry()Shuts down the entry. Ifopen(HttpRoute, HttpContext, HttpParams)is in progress, this will cause that open to possibly throw anIOException.
-