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

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

Introduction

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

Prototype

public void abort() 

Source Link

Document

If a waiting thread has been set, interrupts it.

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  va 2  s.co 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);
        }

    };
}