Package org.apache.http.impl.conn
Class AbstractPooledConnAdapter
- java.lang.Object
-
- org.apache.http.impl.conn.AbstractClientConnAdapter
-
- org.apache.http.impl.conn.AbstractPooledConnAdapter
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable,ConnectionReleaseTrigger,HttpRoutedConnection,ManagedClientConnection,ManagedHttpClientConnection,HttpClientConnection,HttpConnection,HttpInetConnection,HttpContext
- Direct Known Subclasses:
BasicPooledConnAdapter
@Deprecated public abstract class AbstractPooledConnAdapter extends AbstractClientConnAdapter
Deprecated.(4.2) do not useAbstract adapter from poolentriestomanagedclient 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.shutdownandclosewill clear the tracked route in the pool entry and call the respective method of the wrapped connection.- Since:
- 4.0
-
-
Field Summary
-
Fields inherited from interface org.apache.http.protocol.HttpContext
RESERVED_PREFIX
-
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidclose()Deprecated.Closes this connection gracefully.java.lang.StringgetId()Deprecated.Returns connection ID which is expected to be unique for the life span of the connection manager.HttpRoutegetRoute()Deprecated.Obtains the current route of this connection.java.lang.ObjectgetState()Deprecated.Returns the state object associated with this connection.voidlayerProtocol(HttpContext context, HttpParams params)Deprecated.Layers a new protocol on top of atunnelledconnection.voidopen(HttpRoute route, HttpContext context, HttpParams params)Deprecated.Opens this connection according to the given route.voidsetState(java.lang.Object state)Deprecated.Assigns a state object to this connection.voidshutdown()Deprecated.Force-closes this connection.voidtunnelProxy(HttpHost next, boolean secure, HttpParams params)Deprecated.Indicates that a tunnel to an intermediate proxy has been established.voidtunnelTarget(boolean secure, HttpParams params)Deprecated.Indicates that a tunnel to the target has been established.-
Methods inherited from class org.apache.http.impl.conn.AbstractClientConnAdapter
abortConnection, bind, flush, getAttribute, getLocalAddress, getLocalPort, getMetrics, getRemoteAddress, getRemotePort, getSocket, getSocketTimeout, getSSLSession, isMarkedReusable, isOpen, isResponseAvailable, isSecure, isStale, markReusable, receiveResponseEntity, receiveResponseHeader, releaseConnection, removeAttribute, sendRequestEntity, sendRequestHeader, setAttribute, setIdleDuration, setSocketTimeout, unmarkReusable
-
-
-
-
Method Detail
-
getId
public java.lang.String getId()
Deprecated.Description copied from interface:ManagedHttpClientConnectionReturns connection ID which is expected to be unique for the life span of the connection manager.
-
getRoute
public HttpRoute getRoute()
Deprecated.Description copied from interface:ManagedClientConnectionObtains the current route of this connection.- Returns:
- the route established so far, or
nullif not connected
-
open
public void open(HttpRoute route, HttpContext context, HttpParams params) throws java.io.IOException
Deprecated.Description copied from interface:ManagedClientConnectionOpens this connection according to the given route.- Parameters:
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 connection- Throws:
java.io.IOException- in case of a problem
-
tunnelTarget
public void tunnelTarget(boolean secure, HttpParams params) throws java.io.IOExceptionDeprecated.Description copied from interface:ManagedClientConnectionIndicates that a tunnel to the target has been established. The route is the one previously passed toopen. Subsequently,layerProtocolcan 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-trueif the tunnel should be considered secure,falseotherwiseparams- the parameters for tunnelling this connection- Throws:
java.io.IOException- in case of a problem
-
tunnelProxy
public void tunnelProxy(HttpHost next, boolean secure, HttpParams params) throws java.io.IOException
Deprecated.Description copied from interface:ManagedClientConnectionIndicates 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 viaManagedClientConnection.tunnelTarget(boolean, org.apache.http.params.HttpParams).- Parameters:
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, useManagedClientConnection.tunnelTarget(boolean, org.apache.http.params.HttpParams)to indicate an end-to-end tunnel.secure-trueif the connection should be considered secure,falseotherwiseparams- the parameters for tunnelling this connection- Throws:
java.io.IOException- in case of a problem
-
layerProtocol
public void layerProtocol(HttpContext context, HttpParams params) throws java.io.IOException
Deprecated.Description copied from interface:ManagedClientConnectionLayers a new protocol on top of atunnelledconnection. This is typically used to create a TLS/SSL connection through a proxy. The route is the one previously passed toopen. It is not guaranteed that the layered connection issecure.- Parameters:
context- the context for layering on top of this connectionparams- the parameters for layering on top of this connection- Throws:
java.io.IOException- in case of a problem
-
close
public void close() throws java.io.IOExceptionDeprecated.Description copied from interface:HttpConnectionCloses 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. Useshutdowninstead.- Throws:
java.io.IOException
-
shutdown
public void shutdown() throws java.io.IOExceptionDeprecated.Description copied from interface:HttpConnectionForce-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.- Throws:
java.io.IOException
-
getState
public java.lang.Object getState()
Deprecated.Description copied from interface:ManagedClientConnectionReturns the state object associated with this connection.- Returns:
- The state object
-
setState
public void setState(java.lang.Object state)
Deprecated.Description copied from interface:ManagedClientConnectionAssigns a state object to this connection. Connection managers may make use of the connection state when allocating persistent connections.- Parameters:
state- The state object
-
-