Package org.apache.http.nio.util

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


                this.sslHandler);

        LoggingNHttpServerConnection conn = new LoggingNHttpServerConnection(
                new LoggingIOSession(sslSession),
                new DefaultHttpRequestFactory(),
                new HeapByteBufferAllocator(),
                this.params);

        session.setAttribute(NHTTP_CONN, conn);
        session.setAttribute(SSL_SESSION, sslSession);
View Full Code Here


                this.sslHandler);

        LoggingNHttpClientConnection conn = new LoggingNHttpClientConnection(
                new LoggingIOSession(sslSession),
                new DefaultHttpResponseFactory(),
                new HeapByteBufferAllocator(),
                this.params);

        session.setAttribute(NHTTP_CONN, conn);
        session.setAttribute(SSL_SESSION, sslSession);
View Full Code Here

    public void connected(final IOSession session) {
        // Decorate I/O session with logging capabilities
        LoggingNHttpServerConnection conn = new LoggingNHttpServerConnection(
                new LoggingIOSession(session),
                new DefaultHttpRequestFactory(),
                new HeapByteBufferAllocator(),
                this.params);
        session.setAttribute(NHTTP_CONN, conn);
        this.handler.connected(conn);
    }
View Full Code Here

                  chunkThreshold, conduitName,
                  uri);
            csPolicy = getClient(message);
            entity = message.get(CXFHttpRequest.class);
            basicEntity = (BasicHttpEntity)entity.getEntity();
            HeapByteBufferAllocator allocator = new HeapByteBufferAllocator();
            int bufSize = csPolicy.getChunkLength() > 0 ? csPolicy.getChunkLength() : 16320;
            inbuf = new SharedInputBuffer(bufSize, allocator);
            outbuf = new SharedOutputBuffer(bufSize, allocator);
        }
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

    @Override
    protected void onResponseReceived(final HttpResponse response) {
        this.response = response;
        if (response.getEntity() != null) {
            this.consumer = new BufferingNHttpEntity(
                    response.getEntity(), new HeapByteBufferAllocator());
        } else {
            this.consumer = null;
        }
        this.response.setEntity(this.consumer);
    }
View Full Code Here

        OperatedClientConnection conn = getWrappedConnection();
        conn.submitRequest(request);
    }

    protected ByteBufferAllocator createByteBufferAllocator() {
        return new HeapByteBufferAllocator();
    }
View Full Code Here

   
    public ConsumingNHttpEntity entityRequest(
            final HttpEntityEnclosingRequest request,
            final HttpContext context) throws HttpException, IOException {
        // Use buffering entity for simplicity
        return new BufferingNHttpEntity(request.getEntity(), new HeapByteBufferAllocator());
    }
View Full Code Here

     * a different implementation of the {@link ByteBufferAllocator} interface.
     *
     * @return byte buffer allocator.
     */
    protected ByteBufferAllocator createByteBufferAllocator() {
        return new HeapByteBufferAllocator();
    }
View Full Code Here

     * a different implementation of the {@link ByteBufferAllocator} interface.
     *
     * @return byte buffer allocator.
     */
    protected ByteBufferAllocator createByteBufferAllocator() {
        return 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.