|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.http.impl.conn.AbstractClientConnAdapter
org.apache.http.impl.conn.AbstractPooledConnAdapter
public abstract class AbstractPooledConnAdapter
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.
Field Summary | |
---|---|
protected AbstractPoolEntry |
poolEntry
The wrapped pool entry. |
Fields inherited from class org.apache.http.impl.conn.AbstractClientConnAdapter |
---|
connManager, markedReusable, wrappedConnection |
Constructor Summary | |
---|---|
protected |
AbstractPooledConnAdapter(ClientConnectionManager manager,
AbstractPoolEntry entry)
Creates a new connection adapter. |
Method Summary | |
---|---|
protected void |
assertAttached()
Asserts that this adapter is still attached. |
void |
close()
|
protected void |
detach()
Detaches this adapter from the wrapped connection. |
HttpRoute |
getRoute()
Obtains the current route of this connection. |
void |
layerProtocol(org.apache.http.protocol.HttpContext context,
org.apache.http.params.HttpParams params)
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)
Opens this connection according to the given route. |
void |
shutdown()
|
void |
tunnelProxy(org.apache.http.HttpHost next,
boolean secure,
org.apache.http.params.HttpParams params)
Indicates that a tunnel to an intermediate proxy has been established. |
void |
tunnelTarget(boolean secure,
org.apache.http.params.HttpParams params)
Indicates that a tunnel to the target has been established. |
Methods inherited from class org.apache.http.impl.conn.AbstractClientConnAdapter |
---|
abortConnection, assertWrappedConn, flush, getLocalAddress, getLocalPort, getMetrics, getRemoteAddress, getRemotePort, getSocketTimeout, getSSLSession, isMarkedReusable, isOpen, isResponseAvailable, isSecure, isStale, markReusable, receiveResponseEntity, receiveResponseHeader, releaseConnection, sendRequestEntity, sendRequestHeader, setSocketTimeout, unmarkReusable |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.apache.http.conn.ManagedClientConnection |
---|
getSSLSession, isMarkedReusable, isSecure, markReusable, unmarkReusable |
Methods inherited from interface org.apache.http.HttpClientConnection |
---|
flush, isResponseAvailable, receiveResponseEntity, receiveResponseHeader, sendRequestEntity, sendRequestHeader |
Methods inherited from interface org.apache.http.HttpConnection |
---|
getMetrics, getSocketTimeout, isOpen, isStale, setSocketTimeout |
Methods inherited from interface org.apache.http.HttpInetConnection |
---|
getLocalAddress, getLocalPort, getRemoteAddress, getRemotePort |
Methods inherited from interface org.apache.http.HttpConnection |
---|
getMetrics, getSocketTimeout, isOpen, isStale, setSocketTimeout |
Methods inherited from interface org.apache.http.conn.ConnectionReleaseTrigger |
---|
abortConnection, releaseConnection |
Field Detail |
---|
protected AbstractPoolEntry poolEntry
Constructor Detail |
---|
protected AbstractPooledConnAdapter(ClientConnectionManager manager, AbstractPoolEntry entry)
manager
- the connection managerentry
- the pool entry for the connection being wrappedMethod Detail |
---|
protected final void assertAttached()
java.lang.IllegalStateException
- if it is detach
edprotected void detach()
public HttpRoute getRoute()
ManagedClientConnection
getRoute
in interface ManagedClientConnection
null
if not connectedpublic void open(HttpRoute route, org.apache.http.protocol.HttpContext context, org.apache.http.params.HttpParams params) throws java.io.IOException
ManagedClientConnection
open
in interface 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 connection
java.io.IOException
- in case of a problempublic void tunnelTarget(boolean secure, org.apache.http.params.HttpParams params) throws java.io.IOException
ManagedClientConnection
open
.
Subsequently, layerProtocol
can be called
to layer the TLS/SSL protocol on top of the tunnelled connection.
tunnelTarget
in interface ManagedClientConnection
secure
- true
if the tunnel should be considered
secure, false
otherwiseparams
- the parameters for tunnelling this connection
java.io.IOException
- in case of a problempublic void tunnelProxy(org.apache.http.HttpHost next, boolean secure, org.apache.http.params.HttpParams params) throws java.io.IOException
ManagedClientConnection
ManagedClientConnection.tunnelTarget(boolean, org.apache.http.params.HttpParams)
.
tunnelProxy
in interface ManagedClientConnection
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 connection
java.io.IOException
- in case of a problempublic void layerProtocol(org.apache.http.protocol.HttpContext context, org.apache.http.params.HttpParams params) throws java.io.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
.
layerProtocol
in interface ManagedClientConnection
context
- the context for layering on top of this connectionparams
- the parameters for layering on top of this connection
java.io.IOException
- in case of a problempublic void close() throws java.io.IOException
close
in interface org.apache.http.HttpConnection
java.io.IOException
public void shutdown() throws java.io.IOException
shutdown
in interface org.apache.http.HttpConnection
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |