Package org.apache.http.impl.conn.tsccm

Examples of org.apache.http.impl.conn.tsccm.PoolEntryRequest


        }

        @Override
        public void run() {
            for (long c = 0; c < this.reps; c++) {
                PoolEntryRequest request = this.pool.requestPoolEntry(ROUTE, null);
                BasicPoolEntry entry;
                try {
                    entry = request.getPoolEntry(-1, TimeUnit.MILLISECONDS);
                    this.pool.freeEntry(entry, true, -1, TimeUnit.MILLISECONDS);
                } catch (ConnectionPoolTimeoutException e) {
                    e.printStackTrace();
                } catch (InterruptedException e) {
                    e.printStackTrace();
View Full Code Here


        }

        @Override
        public void run() {
            for (long c = 0; c < this.reps; c++) {
                PoolEntryRequest request = this.pool.requestPoolEntry(ROUTE, null);
                BasicPoolEntry entry;
                try {
                    entry = request.getPoolEntry(-1, TimeUnit.MILLISECONDS);
                    this.pool.freeEntry(entry, true, -1, TimeUnit.MILLISECONDS);
                } catch (ConnectionPoolTimeoutException e) {
                    e.printStackTrace();
                } catch (InterruptedException e) {
                    e.printStackTrace();
View Full Code Here

        }
    }

    public ClientConnectionRequest requestConnection(final HttpRoute route, final Object state) {

        final PoolEntryRequest poolRequest = pool.requestPoolEntry(route, state);

        return new ClientConnectionRequest() {

            public void abortRequest() {
                poolRequest.abortRequest();
            }

            public ManagedClientConnection getConnection(long timeout, TimeUnit tunit) throws InterruptedException,
                    ConnectionPoolTimeoutException {
                if (route == null) {
                    throw new IllegalArgumentException("Route may not be null.");
                }

                if (log.isDebugEnabled()) {
                    log.debug("Get connection: " + route + ", timeout = " + timeout);
                }

                BasicPoolEntry entry = poolRequest.getPoolEntry(timeout, tunit);
                SoapUIBasicPooledConnAdapter connAdapter = new SoapUIBasicPooledConnAdapter(
                        SoapUIMultiThreadedHttpConnectionManager.this, entry);
                return connAdapter;
            }
        };
View Full Code Here

TOP

Related Classes of org.apache.http.impl.conn.tsccm.PoolEntryRequest

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.