Package org.apache.http.protocol

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


        junit.textui.TestRunner.main(testCaseName);
    }

    public void testIllegalResponseArg() throws Exception {

        HttpContext context = new HttpExecutionContext(null);

        try {
            reuseStrategy.keepAlive(null, context);
            fail("IllegalArgumentException should have been thrown");
        } catch (IllegalArgumentException ex) {
View Full Code Here

            this.httpservice = httpservice;
            this.conn = conn;
        }
       
        public void run() {
            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

        this.httpproc.addInterceptor(new RequestUserAgent());
        this.httpproc.addInterceptor(new RequestExpectContinue());

        this.httpexecutor = new HttpRequestExecutor();
        this.connStrategy = new DefaultConnectionReuseStrategy();
        this.context = new HttpExecutionContext(null);
    }
View Full Code Here

            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

        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

        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

        this.executor.execute(new Runnable() {
           
            public void run() {
                try {

                    HttpContext context = new HttpExecutionContext(conn.getContext());
                    context.setAttribute(HttpExecutionContext.HTTP_CONNECTION, conn);
                    handleException(connState, httpex, context);
                    commitResponse(connState, conn);
                   
                } catch (IOException ex) {
                    shutdownConnection(conn);
View Full Code Here

        this.executor.execute(new Runnable() {
           
            public void run() {
                try {
                    HttpContext context = new HttpExecutionContext(conn.getContext());
                    context.setAttribute(HttpExecutionContext.HTTP_CONNECTION, conn);
                    handleRequest(connState, context);
                    commitResponse(connState, conn);
                   
                } catch (IOException ex) {
                    shutdownConnection(conn);
View Full Code Here

            this.httpservice = httpservice;
            this.conn = conn;
        }
       
        public void run() {
            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

TOP

Related Classes of org.apache.http.protocol.HttpExecutionContext

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.