@Deprecated public abstract class AbstractPooledConnAdapter extends AbstractClientConnAdapter
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.Modifier and Type | Field and Description |
---|---|
protected AbstractPoolEntry |
poolEntry
Deprecated.
The wrapped pool entry.
|
Modifier | Constructor and Description |
---|---|
protected |
AbstractPooledConnAdapter(ClientConnectionManager manager,
AbstractPoolEntry entry)
Deprecated.
Creates a new connection adapter.
|
Modifier and Type | Method and Description |
---|---|
protected void |
assertAttached()
Deprecated.
(4.1) use
assertValid(AbstractPoolEntry) |
protected void |
assertValid(AbstractPoolEntry entry)
Deprecated.
Asserts that there is a valid pool entry.
|
void |
close()
Deprecated.
|
protected void |
detach()
Deprecated.
Detaches this adapter from the wrapped connection.
|
String |
getId()
Deprecated.
Returns connection ID which is expected to be unique
for the life span of the connection manager.
|
protected AbstractPoolEntry |
getPoolEntry()
Deprecated.
(4.0.1)
|
HttpRoute |
getRoute()
Deprecated.
Obtains the current route of this connection.
|
Object |
getState()
Deprecated.
Returns the state object associated with this connection.
|
void |
layerProtocol(org.apache.http.protocol.HttpContext context,
org.apache.http.params.HttpParams params)
Deprecated.
Layers a new protocol on top of a
tunnelled
connection. |
void |
open(HttpRoute route,
org.apache.http.protocol.HttpContext context,
org.apache.http.params.HttpParams params)
Deprecated.
Opens this connection according to the given route.
|
void |
setState(Object state)
Deprecated.
Assigns a state object to this connection.
|
void |
shutdown()
Deprecated.
|
void |
tunnelProxy(org.apache.http.HttpHost next,
boolean secure,
org.apache.http.params.HttpParams params)
Deprecated.
Indicates that a tunnel to an intermediate proxy has been established.
|
void |
tunnelTarget(boolean secure,
org.apache.http.params.HttpParams params)
Deprecated.
Indicates that a tunnel to the target has been established.
|
abortConnection, assertNotAborted, assertValid, bind, flush, getAttribute, getLocalAddress, getLocalPort, getManager, getMetrics, getRemoteAddress, getRemotePort, getSocket, getSocketTimeout, getSSLSession, getWrappedConnection, isMarkedReusable, isOpen, isReleased, isResponseAvailable, isSecure, isStale, markReusable, receiveResponseEntity, receiveResponseHeader, releaseConnection, removeAttribute, sendRequestEntity, sendRequestHeader, setAttribute, setIdleDuration, setSocketTimeout, unmarkReusable
protected volatile AbstractPoolEntry poolEntry
protected AbstractPooledConnAdapter(ClientConnectionManager manager, AbstractPoolEntry entry)
manager
- the connection managerentry
- the pool entry for the connection being wrappedpublic String getId()
ManagedHttpClientConnection
@Deprecated protected AbstractPoolEntry getPoolEntry()
null
if detachedprotected void assertValid(AbstractPoolEntry entry)
ConnectionShutdownException
- if there is no pool entry
or connection has been abortedAbstractClientConnAdapter.assertValid(OperatedClientConnection)
@Deprecated protected final void assertAttached()
assertValid(AbstractPoolEntry)
protected void detach()
detach
in class AbstractClientConnAdapter
public HttpRoute getRoute()
ManagedClientConnection
null
if not connectedpublic void open(HttpRoute route, org.apache.http.protocol.HttpContext context, org.apache.http.params.HttpParams params) throws IOException
ManagedClientConnection
route
- the route along which to open. It will be opened to
the first proxy if present, or directly to the target.context
- the context for opening this connectionparams
- the parameters for opening this connectionIOException
- in case of a problempublic void tunnelTarget(boolean secure, org.apache.http.params.HttpParams params) throws IOException
ManagedClientConnection
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.
secure
- true
if the tunnel should be considered
secure, false
otherwiseparams
- the parameters for tunnelling this connectionIOException
- in case of a problempublic void tunnelProxy(org.apache.http.HttpHost next, boolean secure, org.apache.http.params.HttpParams params) throws IOException
ManagedClientConnection
ManagedClientConnection.tunnelTarget(boolean, org.apache.http.params.HttpParams)
.next
- 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 ManagedClientConnection.tunnelTarget(boolean, org.apache.http.params.HttpParams)
to indicate an end-to-end tunnel.secure
- true
if the connection should be
considered secure, false
otherwiseparams
- the parameters for tunnelling this connectionIOException
- in case of a problempublic void layerProtocol(org.apache.http.protocol.HttpContext context, org.apache.http.params.HttpParams params) throws IOException
ManagedClientConnection
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
.context
- the context for layering on top of this connectionparams
- the parameters for layering on top of this connectionIOException
- in case of a problempublic void close() throws IOException
IOException
public void shutdown() throws IOException
IOException
public Object getState()
ManagedClientConnection
public void setState(Object state)
ManagedClientConnection
state
- The state objectCopyright © 1999–2022 The Apache Software Foundation. All rights reserved.