Example usage for org.apache.http.impl.conn.tsccm PoolEntryRequest PoolEntryRequest

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

Introduction

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

Prototype

PoolEntryRequest

Source Link

Usage

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

@Override
public PoolEntryRequest requestPoolEntry(final HttpRoute route, final Object state) {

    final WaitingThreadAborter aborter = new WaitingThreadAborter();

    return new PoolEntryRequest() {

        public void abortRequest() {
            poolLock.lock();/*from  ww  w  .  j  a  v a  2 s  . c  om*/
            try {
                aborter.abort();
            } finally {
                poolLock.unlock();
            }
        }

        public BasicPoolEntry getPoolEntry(final long timeout, final TimeUnit tunit)
                throws InterruptedException, ConnectionPoolTimeoutException {
            return getEntryBlocking(route, state, timeout, tunit, aborter);
        }

    };
}