Package org.apache.http.protocol

Examples of org.apache.http.protocol.HttpCoreContext


                new BasicAsyncResponseConsumer()
        );

        final CountDownLatch latch = new CountDownLatch(1);

        HttpCoreContext context = HttpCoreContext.create();
        requester.executePipelined(
                target, requestProducers, responseConsumers, pool, context,
                new FutureCallback<List<HttpResponse>>() {

                    @Override
View Full Code Here


    @Override
    public void run() {
        try {
            final BasicHttpContext localContext = new BasicHttpContext();
            final HttpCoreContext context = HttpCoreContext.adapt(localContext);
            while (!Thread.interrupted() && this.conn.isOpen()) {
                this.httpservice.handleRequest(this.conn, context);
                localContext.clear();
            }
            this.conn.close();
View Full Code Here

            final HttpRequest request,
            final HttpHost targetHost,
            final SocketFactory socketFactory,
            final Config config) {
        super();
        this.context = new HttpCoreContext();
        this.request = request;
        this.targetHost = targetHost;
        this.config = config;
        this.httpProcessor = new ImmutableHttpProcessor(
                new RequestContent(),
View Full Code Here

    public HttpClient(final HttpProcessor httpproc) {
        super();
        this.httpproc = httpproc;
        this.connStrategy = DefaultConnectionReuseStrategy.INSTANCE;
        this.httpexecutor = new HttpRequestExecutor();
        this.context = new HttpCoreContext();
    }
View Full Code Here

            final HttpRequest request,
            final HttpHost targetHost,
            final SocketFactory socketFactory,
            final Config config) {
        super();
        this.context = new HttpCoreContext();
        this.request = request;
        this.targetHost = targetHost;
        this.config = config;
        this.httpProcessor = new ImmutableHttpProcessor(
                new RequestContent(),
View Full Code Here

            final HttpRequest request,
            final HttpHost targetHost,
            final SocketFactory socketFactory,
            final Config config) {
        super();
        this.context = new HttpCoreContext();
        this.request = request;
        this.targetHost = targetHost;
        this.config = config;
        this.httpProcessor = new ImmutableHttpProcessor(
                new RequestContent(),
View Full Code Here

  public void addOp(final HttpOperation op) {
    if (!running) {
      throw new IllegalStateException("Shutting down");
    }

    HttpCoreContext coreContext = HttpCoreContext.create();

    if (viewNodes.isEmpty()) {
      getLogger().error("No server connections. Cancelling op.");
      op.cancel();
    } else {
View Full Code Here

            .add(new RequestUserAgent("Test/1.1"))
            .add(new RequestExpectContinue(true)).build();

        HttpRequestExecutor httpexecutor = new HttpRequestExecutor();

        HttpCoreContext coreContext = HttpCoreContext.create();
        HttpHost host = new HttpHost("192.168.1.5", 8080);
        coreContext.setTargetHost(host);

        DefaultBHttpClientConnection conn = new DefaultBHttpClientConnection(8 * 1024);
        ConnectionReuseStrategy connStrategy = DefaultConnectionReuseStrategy.INSTANCE;

     
View Full Code Here

                        ContentType.create("text/html", "UTF-8"));
                response.setEntity(entity);
                System.out.println("Cannot read file " + file.getPath());

            } else {
                HttpCoreContext coreContext = HttpCoreContext.adapt(context);
                HttpConnection conn = coreContext.getConnection(HttpConnection.class);
                response.setStatusCode(HttpStatus.SC_OK);
                FileEntity body = new FileEntity(file, ContentType.create("text/html", (Charset) null));
                response.setEntity(body);
                System.out.println(conn + ": serving file " + file.getPath());
            }
View Full Code Here

            .add(new RequestUserAgent("Test/1.1"))
            .add(new RequestExpectContinue(true)).build();

        HttpRequestExecutor httpexecutor = new HttpRequestExecutor();

        HttpCoreContext coreContext = HttpCoreContext.create();
        HttpHost host = new HttpHost("localhost", 8080);
        coreContext.setTargetHost(host);

        DefaultBHttpClientConnection conn = new DefaultBHttpClientConnection(8 * 1024);
        ConnectionReuseStrategy connStrategy = DefaultConnectionReuseStrategy.INSTANCE;

        try {
View Full Code Here

TOP

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

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.