Package org.apache.http.client

Examples of org.apache.http.client.ClientRequestDirector


        if (roureq.getRoute() == null) {
            throw new IllegalArgumentException
                ("Route must not be null.");
        }

        ClientRequestDirector director = null;
       
        // Initialize the request execution context making copies of
        // all shared objects that are potentially threading unsafe.
        synchronized (this) {
            if (context == null) {
                context = new HttpClientContext(getDefaultContext());
            }
            // Create a director for this request
            director = new DefaultClientRequestDirector(
                    getConnectionManager(),
                    getConnectionReuseStrategy(),
                    getHttpProcessor().copy(),
                    getHttpRequestRetryHandler(),
                    getRedirectHandler(),
                    getAuthenticationHandler(),
                    getParams());
        }

        HttpResponse  response = director.execute(roureq, context);
        // If the response depends on the connection, the director
        // will have set up an auto-release input stream.
        //@@@ or move that logic here into the client?

        //@@@ "finalize" response, to allow for buffering of entities?
View Full Code Here


        if (roureq.getRoute() == null) {
            throw new IllegalArgumentException
                ("Route must not be null.");
        }

        ClientRequestDirector director = null;
       
        // Initialize the request execution context making copies of
        // all shared objects that are potentially threading unsafe.
        synchronized (this) {
            if (context == null) {
                context = new BasicHttpContext(getDefaultContext());
            }
            // Create a director for this request
            director = new DefaultClientRequestDirector(
                    getConnectionManager(),
                    getConnectionReuseStrategy(),
                    getHttpProcessor().copy(),
                    getHttpRequestRetryHandler(),
                    getRedirectHandler(),
                    getTargetAuthenticationHandler(),
                    getProxyAuthenticationHandler(),
                    determineParams(roureq.getRequest()));
        }

        HttpResponse response = director.execute(roureq, context);
        // If the response depends on the connection, the director
        // will have set up an auto-release input stream.

        //@@@ "finalize" response, to allow for buffering of entities?
        //@@@ here or in director?
View Full Code Here

                ("Request must not be null.");
        }
        // a null target may be acceptable, this depends on the route planner
        // a null context is acceptable, default context created below

        ClientRequestDirector director = null;
       
        // Initialize the request execution context making copies of
        // all shared objects that are potentially threading unsafe.
        synchronized (this) {
            if (context == null) {
                context = new BasicHttpContext(getDefaultContext());
            }
            // Create a director for this request
            director = new DefaultClientRequestDirector(
                    getConnectionManager(),
                    getConnectionReuseStrategy(),
                    getRoutePlanner(),
                    getHttpProcessor().copy(),
                    getHttpRequestRetryHandler(),
                    getRedirectHandler(),
                    getTargetAuthenticationHandler(),
                    getProxyAuthenticationHandler(),
                    determineParams(request));
        }

        HttpResponse response = director.execute(target, request, context);
        // If the response depends on the connection, the director
        // will have set up an auto-release input stream.

        //@@@ "finalize" response, to allow for buffering of entities?
        //@@@ here or in director?
View Full Code Here

                ("Request must not be null.");
        }
        // a null target may be acceptable, this depends on the route planner
        // a null context is acceptable, default context created below

        ClientRequestDirector director = null;
       
        // Initialize the request execution context making copies of
        // all shared objects that are potentially threading unsafe.
        synchronized (this) {
            if (context == null) {
                context = new BasicHttpContext(getDefaultContext());
            }
            // Create a director for this request
            director = createClientRequestDirector(
                    getConnectionManager(),
                    getConnectionReuseStrategy(),
                    getRoutePlanner(),
                    getHttpProcessor().copy(),
                    getHttpRequestRetryHandler(),
                    getRedirectHandler(),
                    getTargetAuthenticationHandler(),
                    getProxyAuthenticationHandler(),
                    determineParams(request));
        }

        HttpResponse response = director.execute(target, request, context);
        // If the response depends on the connection, the director
        // will have set up an auto-release input stream.

        //@@@ "finalize" response, to allow for buffering of entities?
        //@@@ here or in director?
View Full Code Here

TOP

Related Classes of org.apache.http.client.ClientRequestDirector

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.