Top Description Fields Constructors Methods
org.apache.http.impl.conn

public abstract Class AbstractPooledConnAdapter

extends AbstractClientConnAdapter
Class Inheritance
Known Direct Subclasses
org.apache.http.impl.conn.SingleClientConnManager.ConnAdapter, org.apache.http.impl.conn.tsccm.BasicPooledConnAdapter
Annotations
@Deprecated
Imports
java.io.IOException, org.apache.http.HttpHost, org.apache.http.conn.ClientConnectionManager, .OperatedClientConnection, org.apache.http.conn.routing.HttpRoute, org.apache.http.params.HttpParams, org.apache.http.protocol.HttpContext

Deprecated

(4.2) do not use

Abstract adapter from pool entries to managed client connections. The connection in the pool entry is used to initialize the base class. In addition, methods to establish a route are delegated to the pool entry. shutdown and close will clear the tracked route in the pool entry and call the respective method of the wrapped connection.
Since
4.0

Field Summary

Modifier and TypeField and Description
protected volatile AbstractPoolEntry
poolEntry

The wrapped pool entry.

Constructor Summary

AccessConstructor and Description
protected
AbstractPooledConnAdapter(final ClientConnectionManager
the connection manager
manager
,
final AbstractPoolEntry
the pool entry for the connection being wrapped
entry
)

Deprecated as a consequence of ClientConnectionManager and AbstractPoolEntry being deprecated.
Creates a new connection adapter.

Method Summary

Modifier and TypeMethod and Description
protected final void
protected void
assertValid(final AbstractPoolEntry entry)

Deprecated as a consequence of AbstractPoolEntry being deprecated.
Asserts that there is a valid pool entry.
public void
close()

Implements org.apache.http.HttpConnection.close.

Closes this connection gracefully.
protected synchronized void
detach()

Overrides org.apache.http.impl.conn.AbstractClientConnAdapter.detach.

Detaches this adapter from the wrapped connection.
public String
getId()

Implements org.apache.http.conn.ManagedHttpClientConnection.getId.

Returns connection ID which is expected to be unique for the life span of the connection manager.
protected AbstractPoolEntry

Returns:

the pool entry, or null if detached
getPoolEntry
()

Deprecated (4.0.1)
Obtains the pool entry.
public HttpRoute
getRoute()

Implements org.apache.http.conn.ManagedClientConnection.getRoute.

Obtains the current route of this connection.
public Object
getState()

Implements org.apache.http.conn.ManagedClientConnection.getState.

Returns the state object associated with this connection.
public void
layerProtocol(final HttpContext
the context for layering on top of this connection
context
,
final HttpParams
the parameters for layering on top of this connection
params
)

Implements org.apache.http.conn.ManagedClientConnection.layerProtocol.

Deprecated as a consequence of HttpParams being deprecated.
Layers a new protocol on top of a tunnelled connection.
public void
open(final HttpRoute
the route along which to open. It will be opened to the first proxy if present, or directly to the target.
route
,
final HttpContext
the context for opening this connection
context
,
final HttpParams
the parameters for opening this connection
params
)

Implements org.apache.http.conn.ManagedClientConnection.open.

Deprecated as a consequence of HttpParams being deprecated.
Opens this connection according to the given route.
public void
setState(final Object
The state object
state
)

Implements org.apache.http.conn.ManagedClientConnection.setState.

Assigns a state object to this connection.
public void
shutdown()

Implements org.apache.http.HttpConnection.shutdown.

Force-closes this connection.
public void
tunnelProxy(final HttpHost
the proxy to which the tunnel was established. This is not the proxy through which the tunnel was established, but the new end point of the tunnel. The tunnel does not yet reach to the target, use tunnelTarget to indicate an end-to-end tunnel.
next
,
final boolean
true if the connection should be considered secure, false otherwise
secure
,
final HttpParams
the parameters for tunnelling this connection
params
)

Implements org.apache.http.conn.ManagedClientConnection.tunnelProxy.

Deprecated as a consequence of HttpParams being deprecated.
Indicates that a tunnel to an intermediate proxy has been established.
public void
tunnelTarget(final boolean
true if the tunnel should be considered secure, false otherwise
secure
,
final HttpParams
the parameters for tunnelling this connection
params
)

Implements org.apache.http.conn.ManagedClientConnection.tunnelTarget.

Deprecated as a consequence of HttpParams being deprecated.
Indicates that a tunnel to the target has been established.
Inherited from org.apache.http.impl.conn.AbstractClientConnAdapter:
abortConnectionassertNotAbortedassertValidbindflushgetAttributegetLocalAddressgetLocalPortgetManagergetMetricsgetRemoteAddressgetRemotePortgetSocketgetSocketTimeoutgetSSLSessiongetWrappedConnectionisMarkedReusableisOpenisReleasedisResponseAvailableisSecureisStalemarkReusablereceiveResponseEntityreceiveResponseHeaderreleaseConnectionremoveAttributesendRequestEntitysendRequestHeadersetAttributesetIdleDurationsetSocketTimeoutunmarkReusable

Field Detail

poolEntryback to summary
protected volatile AbstractPoolEntry poolEntry

Deprecated

as a consequence of AbstractPoolEntry being deprecated. See corresponding docs for further information.

The wrapped pool entry.

Constructor Detail

AbstractPooledConnAdapterback to summary
protected AbstractPooledConnAdapter(final ClientConnectionManager manager, final AbstractPoolEntry entry)

Deprecated

as a consequence of ClientConnectionManager and AbstractPoolEntry being deprecated. See corresponding docs for further information.

Creates a new connection adapter.

Parameters
manager:ClientConnectionManager

the connection manager

entry:AbstractPoolEntry

the pool entry for the connection being wrapped

Method Detail

assertAttachedback to summary
protected final void assertAttached()

Deprecated

(4.1) use assertValid(AbstractPoolEntry)

Annotations
@Deprecated
assertValidback to summary
protected void assertValid(final AbstractPoolEntry entry)

Deprecated

as a consequence of AbstractPoolEntry being deprecated. See corresponding docs for further information.

Asserts that there is a valid pool entry.

Exceptions
ConnectionShutdownException:
if there is no pool entry or connection has been aborted
See Also
assertValid(OperatedClientConnection)
closeback to summary
public void close() throws IOException

Implements org.apache.http.HttpConnection.close.

Doc from org.apache.http.HttpConnection.close.

Closes this connection gracefully. This method will attempt to flush the internal output buffer prior to closing the underlying socket. This method MUST NOT be called from a different thread to force shutdown of the connection. Use shutdown instead.

Annotations
@Override
Exceptions
IOException:

Doc from java.io.Closeable.close.

if an I/O error occurs

detachback to summary
protected synchronized void detach()

Overrides org.apache.http.impl.conn.AbstractClientConnAdapter.detach.

Detaches this adapter from the wrapped connection. This adapter becomes useless.

Annotations
@Override
getIdback to summary
public String getId()

Implements org.apache.http.conn.ManagedHttpClientConnection.getId.

Doc from org.apache.http.conn.ManagedHttpClientConnection.getId.

Returns connection ID which is expected to be unique for the life span of the connection manager.

Annotations
@Override
getPoolEntryback to summary
protected AbstractPoolEntry getPoolEntry()

Deprecated

(4.0.1)

Obtains the pool entry.

Returns:AbstractPoolEntry

the pool entry, or null if detached

Annotations
@Deprecated
getRouteback to summary
public HttpRoute getRoute()

Implements org.apache.http.conn.ManagedClientConnection.getRoute.

Doc from org.apache.http.conn.ManagedClientConnection.getRoute.

Obtains the current route of this connection.

Returns:HttpRoute

the route established so far, or null if not connected

Annotations
@Override
getStateback to summary
public Object getState()

Implements org.apache.http.conn.ManagedClientConnection.getState.

Doc from org.apache.http.conn.ManagedClientConnection.getState.

Returns the state object associated with this connection.

Returns:Object

The state object

Annotations
@Override
layerProtocolback to summary
public void layerProtocol(final HttpContext context, final HttpParams params) throws IOException

Implements org.apache.http.conn.ManagedClientConnection.layerProtocol.

Doc from org.apache.http.conn.ManagedClientConnection.layerProtocol.

Deprecated

as a consequence of HttpParams being deprecated. See corresponding docs for further information.

Layers a new protocol on top of a tunnelled connection. This is typically used to create a TLS/SSL connection through a proxy. The route is the one previously passed to open. It is not guaranteed that the layered connection is secure.

Parameters
context:HttpContext

the context for layering on top of this connection

params:HttpParams

the parameters for layering on top of this connection

Annotations
@Override
Exceptions
IOException:
in case of a problem
openback to summary
public void open(final HttpRoute route, final HttpContext context, final HttpParams params) throws IOException

Implements org.apache.http.conn.ManagedClientConnection.open.

Doc from org.apache.http.conn.ManagedClientConnection.open.

Deprecated

as a consequence of HttpParams being deprecated. See corresponding docs for further information.

Opens this connection according to the given route.

Parameters
route:HttpRoute

the route along which to open. It will be opened to the first proxy if present, or directly to the target.

context:HttpContext

the context for opening this connection

params:HttpParams

the parameters for opening this connection

Annotations
@Override
Exceptions
IOException:
in case of a problem
setStateback to summary
public void setState(final Object state)

Implements org.apache.http.conn.ManagedClientConnection.setState.

Doc from org.apache.http.conn.ManagedClientConnection.setState.

Assigns a state object to this connection. Connection managers may make use of the connection state when allocating persistent connections.

Parameters
state:Object

The state object

Annotations
@Override
shutdownback to summary
public void shutdown() throws IOException

Implements org.apache.http.HttpConnection.shutdown.

Doc from org.apache.http.HttpConnection.shutdown.

Force-closes this connection. This is the only method of a connection which may be called from a different thread to terminate the connection. This method will not attempt to flush the transmitter's internal buffer prior to closing the underlying socket.

Annotations
@Override
tunnelProxyback to summary
public void tunnelProxy(final HttpHost next, final boolean secure, final HttpParams params) throws IOException

Implements org.apache.http.conn.ManagedClientConnection.tunnelProxy.

Doc from org.apache.http.conn.ManagedClientConnection.tunnelProxy.

Deprecated

as a consequence of HttpParams being deprecated. See corresponding docs for further information.

Indicates that a tunnel to an intermediate proxy has been established. This is used exclusively for so-called proxy chains, where a request has to pass through multiple proxies before reaching the target. In that case, all proxies but the last need to be tunnelled when establishing the connection. Tunnelling of the last proxy to the target is optional and would be indicated via tunnelTarget.

Parameters
next:HttpHost

the proxy to which the tunnel was established. This is not the proxy through which the tunnel was established, but the new end point of the tunnel. The tunnel does not yet reach to the target, use tunnelTarget to indicate an end-to-end tunnel.

secure:boolean

true if the connection should be considered secure, false otherwise

params:HttpParams

the parameters for tunnelling this connection

Annotations
@Override
Exceptions
IOException:
in case of a problem
tunnelTargetback to summary
public void tunnelTarget(final boolean secure, final HttpParams params) throws IOException

Implements org.apache.http.conn.ManagedClientConnection.tunnelTarget.

Doc from org.apache.http.conn.ManagedClientConnection.tunnelTarget.

Deprecated

as a consequence of HttpParams being deprecated. See corresponding docs for further information.

Indicates that a tunnel to the target has been established. The route is the one previously passed to open. Subsequently, layerProtocol can be called to layer the TLS/SSL protocol on top of the tunnelled connection.

Note

In HttpClient 3, a call to the corresponding method would automatically trigger the layering of the TLS/SSL protocol. This is not the case anymore, you can establish a tunnel without layering a new protocol over the connection.

Parameters
secure:boolean

true if the tunnel should be considered secure, false otherwise

params:HttpParams

the parameters for tunnelling this connection

Annotations
@Override
Exceptions
IOException:
in case of a problem