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

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

Introduction

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

Prototype

WaitingThreadAborter

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();/*ww w .j a  va2  s . c  o  m*/
            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);
        }

    };
}