Package org.apache.http.conn

Examples of org.apache.http.conn.ClientConnectionRequest


            final Object state) {

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

        return new ClientConnectionRequest() {

            public void abortRequest() {
                poolRequest.abortRequest();
            }
View Full Code Here


        try {
            mgr.setMaxTotal(1);
            mgr.setDefaultMaxPerRoute(1);

            // take out the only connection
            ClientConnectionRequest connRequest = mgr.requestConnection(ROUTE, null);
            ManagedClientConnection conn = connRequest.getConnection(0, null);
            Assert.assertNotNull(conn);

            // send a thread waiting
            GetConnThread gct = new GetConnThread(mgr, ROUTE, 0L);
            gct.start();
View Full Code Here

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

        return new ClientConnectionRequest() {

            public void abortRequest() {
                // Nothing to abort, since requests are immediate.
            }
View Full Code Here

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

        return new ClientConnectionRequest() {

            public void abortRequest() {
                // Nothing to abort, since requests are immediate.
            }
View Full Code Here

            // If this is the redirect route, stub the return value
            // so-as to pretend the host is waiting on a slot...
            if(route.getTargetHost().getHostName().equals("localhost")) {
                final Thread currentThread = Thread.currentThread();
               
                return new ClientConnectionRequest() {
                   
                    public void abortRequest() {
                        currentThread.interrupt();
                    }
                   
View Full Code Here

                // See if we have a user token bound to the execution context
                Object userToken = context.getAttribute(ClientContext.USER_TOKEN);
               
                // Allocate connection if needed
                if (managedConn == null) {
                    ClientConnectionRequest connRequest = connManager.requestConnection(
                            route, userToken);
                    if (orig instanceof AbortableHttpRequest) {
                        ((AbortableHttpRequest) orig).setConnectionRequest(connRequest);
                    }
                   
                    try {
                        managedConn = connRequest.getConnection(timeout, TimeUnit.MILLISECONDS);
                    } catch(InterruptedException interrupted) {
                        InterruptedIOException iox = new InterruptedIOException();
                        iox.initCause(interrupted);
                        throw iox;
                    }
View Full Code Here

       
        public ClientConnectionRequest requestConnection(
                final HttpRoute route,
                final Object state) {
           
            return new ClientConnectionRequest() {
               
                public void abortRequest() {
                    throw new UnsupportedOperationException("just a mockup");
                }
               
View Full Code Here

                final HttpRoute route,
                final Object state) {
           
            final Thread currentThread = Thread.currentThread();
           
            return new ClientConnectionRequest() {
               
                public void abortRequest() {
                    currentThread.interrupt();
                }
               
View Full Code Here

            final Object state) {
       
        final PoolEntryRequest poolRequest = connectionPool.requestPoolEntry(
                route, state);
       
        return new ClientConnectionRequest() {
           
            public void abortRequest() {
                poolRequest.abortRequest();
            }
           
View Full Code Here

        System.out.println("preparing route to " + target);
        HttpRoute route = new HttpRoute
            (target, null, supportedSchemes.getScheme(target).isLayered());

        System.out.println("requesting connection for " + route);
        ClientConnectionRequest connRequest = clcm.requestConnection(route, null);
        ManagedClientConnection conn = connRequest.getConnection(0, null);
        try {
            System.out.println("opening connection");
            conn.open(route, ctx, getParams());

            System.out.println("sending request");
View Full Code Here

TOP

Related Classes of org.apache.http.conn.ClientConnectionRequest

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.