Examples of HttpExecutionContext


Examples of org.apache.http.protocol.HttpExecutionContext

     * the context can be left empty.
     *
     * @return  a new, empty context
     */
    private final static HttpContext createContext() {
        return new HttpExecutionContext(null);
    }
View Full Code Here

Examples of org.apache.http.protocol.HttpExecutionContext

                this.conn = conn;
            }


            public void run() {
                HttpContext context = new HttpExecutionContext(null);
                try {
                    while ((servicedSocket != null) &&
                           this.conn.isOpen() && !Thread.interrupted()) {
                        this.httpservice.handleRequest(this.conn, context);
                    }
View Full Code Here

Examples of org.apache.http.protocol.HttpExecutionContext

            httpProcessor.addInterceptor(new RequestContent());
            httpProcessor.addInterceptor(new RequestConnControl()); // optional
        }

        // the context is created each time, it may get modified by test cases
        httpContext = new HttpExecutionContext(null);

        if (httpExecutor == null) {
            httpExecutor = new HttpRequestExecutor();
        }
View Full Code Here

Examples of org.apache.http.protocol.HttpExecutionContext

                ("GET", uri, HttpVersion.HTTP_1_1);

            ExecReqThread.RequestSpec ertrs = new ExecReqThread.RequestSpec();
            ertrs.executor = httpExecutor;
            ertrs.processor = httpProcessor;
            ertrs.context = new HttpExecutionContext(null);
            ertrs.params = defaultParams;

            ertrs.context.setAttribute
                (HttpExecutionContext.HTTP_TARGET_HOST, target);
            ertrs.context.setAttribute
View Full Code Here

Examples of org.apache.http.protocol.HttpExecutionContext

        request.getParams().setDefaults(this.params);
        HttpResponse response = this.responseFactory.newHttpResponse(ver, HttpStatus.SC_OK);
        response.getParams().setDefaults(this.params);
       
        // Configure HTTP context
        HttpContext context = new HttpExecutionContext(parentContext);
        context.setAttribute(HttpExecutionContext.HTTP_CONNECTION, conn);
        context.setAttribute(HttpExecutionContext.HTTP_REQUEST, request);
        context.setAttribute(HttpExecutionContext.HTTP_RESPONSE, response);
       
        try {
            // Pre-process the request
            this.httpProcessor.process(request, context);
           
View Full Code Here

Examples of org.apache.http.protocol.HttpExecutionContext

        HttpRequestExecutor httpexec = (HttpRequestExecutor)beanfactory.getBean("http-executor");
        httpexec.setParams(params);
       
        HttpHost host = new HttpHost("www.yahoo.com", 80);

        HttpContext context = new HttpExecutionContext(null);
        DefaultHttpClientConnection conn = new DefaultHttpClientConnection();
       
        context.setAttribute(HttpExecutionContext.HTTP_TARGET_HOST, host);
       
        HttpRequestFactory requestfactory = (HttpRequestFactory) beanfactory.getBean("http-request-factory");
        ConnectionReuseStrategy connStrategy = (ConnectionReuseStrategy) beanfactory.getBean("conn-reuse-strategy");
        try {
            if (!conn.isOpen()) {
View Full Code Here

Examples of org.apache.http.protocol.HttpExecutionContext

    private final ConnectionReuseStrategy connstrategy;
   
    public BenchmarkWorker(final HttpParams params, int verbosity) {
        super();
        this.params = params;
        this.context = new HttpExecutionContext(null);

        BasicHttpProcessor httpproc = new BasicHttpProcessor();
        this.httpexecutor = new HttpRequestExecutor(httpproc);
        this.httpexecutor.setParams(params);
View Full Code Here

Examples of org.apache.http.protocol.HttpExecutionContext

        httpproc.addInterceptor(new RequestExpectContinue());

        HttpRequestExecutor httpexecutor = new HttpRequestExecutor(httpproc);
        httpexecutor.setParams(params);
       
        HttpContext context = new HttpExecutionContext(null);
        HttpHost host = new HttpHost("localhost", 8080);
        context.setAttribute(HttpExecutionContext.HTTP_TARGET_HOST, host);

        DefaultHttpClientConnection conn = new DefaultHttpClientConnection();
        ConnectionReuseStrategy connStrategy = new DefaultConnectionReuseStrategy();
       
        try {
View Full Code Here

Examples of org.apache.http.protocol.HttpExecutionContext

            this.conn = conn;
        }
       
        public void run() {
            System.out.println("New connection thread");
            HttpContext context = new HttpExecutionContext(null);
            try {
                while (!Thread.interrupted() && this.conn.isOpen()) {
                    this.httpservice.handleRequest(this.conn, context);
                }
            } catch (ConnectionClosedException ex) {
View Full Code Here

Examples of org.apache.http.protocol.HttpExecutionContext

    public void setUp() {
        // open and not stale is required for most of the tests here
        mockConnection = new MockConnection(true, false);
        reuseStrategy = new DefaultConnectionReuseStrategy();
        context = new HttpExecutionContext(null);
        context.setAttribute(HttpExecutionContext.HTTP_CONNECTION, mockConnection);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.