Example usage for org.apache.http.impl.conn CPoolProxy getPoolEntry

List of usage examples for org.apache.http.impl.conn CPoolProxy getPoolEntry

Introduction

In this page you can find the example usage for org.apache.http.impl.conn CPoolProxy getPoolEntry.

Prototype

public static CPoolEntry getPoolEntry(final HttpClientConnection proxy) 

Source Link

Usage

From source file:org.apache.http.impl.conn.PoolingHttpClientConnectionManager.java

public void connect(final HttpClientConnection managedConn, final HttpRoute route, final int connectTimeout,
        final HttpContext context) throws IOException {
    Args.notNull(managedConn, "Managed Connection");
    Args.notNull(route, "HTTP route");
    final ManagedHttpClientConnection conn;
    synchronized (managedConn) {
        final CPoolEntry entry = CPoolProxy.getPoolEntry(managedConn);
        conn = entry.getConnection();//from  w  w  w  .ja va2  s . c o  m
    }
    final HttpHost host;
    if (route.getProxyHost() != null) {
        host = route.getProxyHost();
    } else {
        host = route.getTargetHost();
    }
    final InetSocketAddress localAddress = route.getLocalSocketAddress();
    SocketConfig socketConfig = this.configData.getSocketConfig(host);
    if (socketConfig == null) {
        socketConfig = this.configData.getDefaultSocketConfig();
    }
    if (socketConfig == null) {
        socketConfig = SocketConfig.DEFAULT;
    }
    this.connectionOperator.connect(conn, host, localAddress, connectTimeout, socketConfig, context);
}

From source file:org.apache.http.impl.conn.PoolingHttpClientConnectionManager.java

public void upgrade(final HttpClientConnection managedConn, final HttpRoute route, final HttpContext context)
        throws IOException {
    Args.notNull(managedConn, "Managed Connection");
    Args.notNull(route, "HTTP route");
    final ManagedHttpClientConnection conn;
    synchronized (managedConn) {
        final CPoolEntry entry = CPoolProxy.getPoolEntry(managedConn);
        conn = entry.getConnection();/*from ww w. j a va 2 s.  co  m*/
    }
    this.connectionOperator.upgrade(conn, route.getTargetHost(), context);
}

From source file:org.apache.http.impl.conn.PoolingHttpClientConnectionManager.java

public void routeComplete(final HttpClientConnection managedConn, final HttpRoute route,
        final HttpContext context) throws IOException {
    Args.notNull(managedConn, "Managed Connection");
    Args.notNull(route, "HTTP route");
    synchronized (managedConn) {
        final CPoolEntry entry = CPoolProxy.getPoolEntry(managedConn);
        entry.markRouteComplete();//from w w w .jav a 2  s  .  com
    }
}