Package org.apache.http.nio.util

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


                  chunkThreshold, conduitName,
                  uri);
            csPolicy = getClient(message);
            entity = message.get(CXFHttpRequest.class);
            basicEntity = (BasicHttpEntity)entity.getEntity();
            HeapByteBufferAllocator allocator = new HeapByteBufferAllocator();
            inbuf = new SharedInputBuffer(16320, allocator);
            outbuf = new SharedOutputBuffer(16320, allocator);
        }
View Full Code Here


            exception = null;
            connectionFuture = null;
            session = null;
           
            //reset the buffers
            HeapByteBufferAllocator allocator = new HeapByteBufferAllocator();
            inbuf = new SharedInputBuffer(16320, allocator);
            outbuf = new SharedOutputBuffer(16320, allocator);
            try {
                this.url = new URI(newURL);
                setupConnection(outMessage, this.url, csPolicy);
View Full Code Here

        connectionManager = new PoolingClientAsyncConnectionManager(ioReactor, registry,
                                                                    connectionTTL, TimeUnit.MILLISECONDS) {
            @Override
            protected ClientAsyncConnectionFactory createClientAsyncConnectionFactory() {
                final HttpResponseFactory responseFactory = new DefaultHttpResponseFactory();
                final ByteBufferAllocator allocator = new HeapByteBufferAllocator();

                return new ClientAsyncConnectionFactory() {
                    @Override
                    public ClientAsyncConnection create(String id, IOSession iosession, HttpParams params) {
                        return new DefaultClientAsyncConnection(id, iosession,
View Full Code Here

                  uri);
            csPolicy = getClient(message);
            entity = message.get(CXFHttpRequest.class);
            basicEntity = (BasicHttpEntity)entity.getEntity();
            basicEntity.setChunked(isChunking);
            HeapByteBufferAllocator allocator = new HeapByteBufferAllocator();
            int bufSize = csPolicy.getChunkLength() > 0 ? csPolicy.getChunkLength() : 16320;
            inbuf = new SharedInputBuffer(bufSize, allocator);
            outbuf = new SharedOutputBuffer(bufSize, allocator);
            isAsync = outMessage != null && outMessage.getExchange() != null
                && !outMessage.getExchange().isSynchronous();
View Full Code Here

            exception = null;
            connectionFuture = null;
            session = null;
           
            //reset the buffers
            HeapByteBufferAllocator allocator = new HeapByteBufferAllocator();
            int bufSize = csPolicy.getChunkLength() > 0 ? csPolicy.getChunkLength() : 16320;
            inbuf = new SharedInputBuffer(bufSize, allocator);
            outbuf = new SharedOutputBuffer(bufSize, allocator);
            try {
                this.url = new URI(newURL);
View Full Code Here

        connectionManager = new PoolingClientAsyncConnectionManager(ioReactor, registry,
                                                                    connectionTTL, TimeUnit.MILLISECONDS) {
            @Override
            protected ClientAsyncConnectionFactory createClientAsyncConnectionFactory() {
                final HttpResponseFactory responseFactory = new DefaultHttpResponseFactory();
                final ByteBufferAllocator allocator = new HeapByteBufferAllocator();

                return new ClientAsyncConnectionFactory() {
                    @Override
                    public ClientAsyncConnection create(String id, IOSession iosession, HttpParams params) {
                        return new DefaultClientAsyncConnection(id, iosession,
View Full Code Here

                    queueLength, "Message Processing Thread Group", "MessageProcessor");
        }

        httpParameters = retrieveHttpParameters();

        bufferFactory = new BufferFactory(1024 * 8, new HeapByteBufferAllocator(), 512);
    }
View Full Code Here

    public BufferFactory(int bufferSize, ByteBufferAllocator allocator, int size) {
        this.bufferSize = bufferSize;
        if (allocator != null) {
            this.allocator = allocator;
        } else {
            this.allocator = new HeapByteBufferAllocator();
        }

        buffers = new ByteBuffer[size];
    }
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

    public void connected(final IOSession session) {
        // Decorate I/O session with logging capabilities
        LoggingNHttpClientConnection conn = new LoggingNHttpClientConnection(
                new LoggingIOSession(session),
                new DefaultHttpResponseFactory(),
                new HeapByteBufferAllocator(),
                this.params);
        session.setAttribute(NHTTP_CONN, conn);
       
        Object attachment = session.getAttribute(IOSession.ATTACHMENT_KEY);
        this.handler.connected(conn, attachment);
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.