FileDocCategorySizeDatePackage
AbstractPooledConnAdapter.javaAPI DocAndroid 1.5 API5835Wed May 06 22:41:10 BST 2009org.apache.http.impl.conn

AbstractPooledConnAdapter

public abstract class AbstractPooledConnAdapter extends AbstractClientConnAdapter
Abstract adapter from pool {@link AbstractPoolEntry entries} to {@link org.apache.http.conn.ManagedClientConnection 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. {@link #shutdown shutdown} and {@link #close close} will clear the tracked route in the pool entry and call the respective method of the wrapped connection.
author
Roland Weber
version
$Revision: 658775 $ $Date: 2008-05-21 10:30:45 -0700 (Wed, 21 May 2008) $
since
4.0

Fields Summary
protected volatile AbstractPoolEntry
poolEntry
The wrapped pool entry.
Constructors Summary
protected AbstractPooledConnAdapter(ClientConnectionManager manager, AbstractPoolEntry entry)
Creates a new connection adapter.

param
manager the connection manager
param
entry the pool entry for the connection being wrapped

        super(manager, entry.connection);
        this.poolEntry = entry;
    
Methods Summary
protected final voidassertAttached()
Asserts that this adapter is still attached.

throws
IllegalStateException if it is {@link #detach detach}ed

        if (poolEntry == null) {
            throw new IllegalStateException("Adapter is detached.");
        }
    
public voidclose()

        if (poolEntry != null)
            poolEntry.shutdownEntry();

        OperatedClientConnection conn = getWrappedConnection();
        if (conn != null) {
            conn.close();
        }
    
protected voiddetach()
Detaches this adapter from the wrapped connection. This adapter becomes useless.

        super.detach();
        poolEntry = null;
    
public org.apache.http.conn.routing.HttpRoutegetRoute()


        assertAttached();
        return (poolEntry.tracker == null) ?
            null : poolEntry.tracker.toRoute();
    
public java.lang.ObjectgetState()

        assertAttached();
        return poolEntry.getState();
    
public voidlayerProtocol(org.apache.http.protocol.HttpContext context, org.apache.http.params.HttpParams params)


        assertAttached();
        poolEntry.layerProtocol(context, params);
    
public voidopen(org.apache.http.conn.routing.HttpRoute route, org.apache.http.protocol.HttpContext context, org.apache.http.params.HttpParams params)


        assertAttached();
        poolEntry.open(route, context, params);
    
public voidsetState(java.lang.Object state)

        assertAttached();
        poolEntry.setState(state);
    
public voidshutdown()

        if (poolEntry != null)
            poolEntry.shutdownEntry();

        OperatedClientConnection conn = getWrappedConnection();
        if (conn != null) {
            conn.shutdown();
        }
    
public voidtunnelProxy(org.apache.http.HttpHost next, boolean secure, org.apache.http.params.HttpParams params)


        assertAttached();
        poolEntry.tunnelProxy(next, secure, params);
    
public voidtunnelTarget(boolean secure, org.apache.http.params.HttpParams params)


        assertAttached();
        poolEntry.tunnelTarget(secure, params);