Package org.apache.http.nio.util

Examples of org.apache.http.nio.util.HeapByteBufferAllocator



    @Test
    public void testInvalidConstruction() throws Exception {
        try {
            new BufferingAsyncRequestHandler(null, new DefaultHttpResponseFactory(), new HeapByteBufferAllocator());
            Assert.fail("IllegalArgumentException expected");
        } catch (IllegalArgumentException ex) {
        }
        try {
            new BufferingAsyncRequestHandler(this.requestHandler, null, new HeapByteBufferAllocator());
            Assert.fail("IllegalArgumentException expected");
        } catch (IllegalArgumentException ex) {
        }
        try {
            new BufferingAsyncRequestHandler(this.requestHandler, new DefaultHttpResponseFactory(), null);
View Full Code Here


import org.apache.http.params.HttpParams;

public class LoggingServerConnectionFactory extends DefaultNHttpServerConnectionFactory {

    public LoggingServerConnectionFactory(final HttpParams params) {
        super(new DefaultHttpRequestFactory(), new HeapByteBufferAllocator(), params);
    }
View Full Code Here

public class LoggingSSLClientConnectionFactory extends SSLNHttpClientConnectionFactory {

    public LoggingSSLClientConnectionFactory(
            final SSLContext sslcontext,
            final HttpParams params) {
        super(sslcontext, null, new DefaultHttpResponseFactory(), new HeapByteBufferAllocator(), params);
    }
View Full Code Here

import org.apache.http.params.HttpParams;

public class LoggingClientConnectionFactory extends DefaultNHttpClientConnectionFactory {

    public LoggingClientConnectionFactory(final HttpParams params) {
        super(new DefaultHttpResponseFactory(), new HeapByteBufferAllocator(), params);
    }
View Full Code Here

public class LoggingSSLServerConnectionFactory extends SSLNHttpServerConnectionFactory {

    public LoggingSSLServerConnectionFactory(
            final SSLContext sslcontext,
            final HttpParams params) {
        super(sslcontext, null, new DefaultHttpRequestFactory(), new HeapByteBufferAllocator(), params);
    }
View Full Code Here

        this.cfgCtx = cfgCtx;
        this.params = params;
        this.httpProcessor = getHttpProcessor();
        this.connStrategy = new DefaultConnectionReuseStrategy();
        this.metrics = metrics;
        this.allocator = new HeapByteBufferAllocator();
        this.threadingView = new ThreadingView("HttpClientWorker", true, 50);

        this.cfg = NHttpConfiguration.getInstance();
        workerPool = WorkerPoolFactory.getWorkerPool(
            cfg.getClientCoreThreads(),
View Full Code Here

        this.isHttps = listenerContext.isSsl();
        this.metrics = listenerContext.getMetrics();
        this.responseFactory = new DefaultHttpResponseFactory();
        this.httpProcessor = getHttpProcessor();
        this.connStrategy = new DefaultConnectionReuseStrategy();
        this.allocator = new HeapByteBufferAllocator();
        this.activeConnections = new ArrayList<NHttpServerConnection>();
        this.latencyView = new LatencyView("NHTTPLatencyView", isHttps);
        this.s2sLatencyView = new LatencyView("NHTTPS2SLatencyView", isHttps);
        this.threadingView = new ThreadingView("HttpServerWorker", true, 50);
        this.restDispatching = listenerContext.isRestDispatching();
View Full Code Here

            // should write header for content type or other parameter to pass to threaded handler
            request.addHeader(REQ_TEMPFILE,
                    ((BeeByteBufferAllocator) allocator).getTempfilename());
        } else {
            // standard post
            allocator = new HeapByteBufferAllocator();
        }
        return new BufferingNHttpEntity(request.getEntity(), allocator);
    }
View Full Code Here

    @Override
    public ConsumingNHttpEntity entityRequest(
            final HttpEntityEnclosingRequest request,
            final HttpContext context) throws HttpException, IOException {
        return new BufferingNHttpEntity(request.getEntity(),
                new HeapByteBufferAllocator());
    }
View Full Code Here

    @Override
    public ConsumingNHttpEntity entityRequest(
            final HttpEntityEnclosingRequest request,
            final HttpContext context) throws HttpException, IOException {
        return new BufferingNHttpEntity(request.getEntity(),
                new HeapByteBufferAllocator());
    }
View Full Code Here

TOP

Related Classes of org.apache.http.nio.util.HeapByteBufferAllocator

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.