Example usage for org.apache.http.impl.conn.tsccm RouteSpecificPool createdEntry

List of usage examples for org.apache.http.impl.conn.tsccm RouteSpecificPool createdEntry

Introduction

In this page you can find the example usage for org.apache.http.impl.conn.tsccm RouteSpecificPool createdEntry.

Prototype

public void createdEntry(final BasicPoolEntry entry) 

Source Link

Document

Indicates creation of an entry for this pool.

Usage

From source file:org.apache.http.impl.conn.tsccm.ConnPoolByRoute.java

/**
 * Creates a new pool entry./*  ww w  . j  av  a2s  .  c  om*/
 * This method assumes that the new connection will be handed
 * out immediately.
 *
 * @param rospl       the route-specific pool for which to create the entry
 * @param op        the operator for creating a connection
 *
 * @return  the new pool entry for a new connection
 */
protected BasicPoolEntry createEntry(final RouteSpecificPool rospl, final ClientConnectionOperator op) {

    if (log.isDebugEnabled()) {
        log.debug("Creating new connection [" + rospl.getRoute() + "]");
    }

    // the entry will create the connection when needed
    final BasicPoolEntry entry = new BasicPoolEntry(op, rospl.getRoute(), connTTL, connTTLTimeUnit);

    poolLock.lock();
    try {
        rospl.createdEntry(entry);
        numConnections++;
        leasedConnections.add(entry);
    } finally {
        poolLock.unlock();
    }

    return entry;
}