Example usage for org.apache.http.impl ConnSupport createDecoder

List of usage examples for org.apache.http.impl ConnSupport createDecoder

Introduction

In this page you can find the example usage for org.apache.http.impl ConnSupport createDecoder.

Prototype

public static CharsetDecoder createDecoder(ConnectionConfig connectionConfig) 

Source Link

Usage

From source file:ste.web.http.BasicHttpConnectionFactory.java

public BasicHttpConnection createConnection(final Socket socket) throws IOException {
    final BasicHttpConnection conn = new BasicHttpConnection(this.config.getBufferSize(),
            this.config.getFragmentSizeHint(), ConnSupport.createDecoder(this.config),
            ConnSupport.createEncoder(this.config), this.config.getMessageConstraints(),
            this.incomingContentStrategy, this.outgoingContentStrategy, this.requestParserFactory,
            this.responseWriterFactory);
    conn.bind(socket);/*from ww  w .j  a  va2s.  com*/
    return conn;
}

From source file:org.apache.synapse.transport.utils.logging.LoggingNHttpClientConnectionFactory.java

public DefaultNHttpClientConnection createConnection(IOSession session) {
    if (targetSessionLog.isDebugEnabled() || targetWireLog.isDebugEnabled()) {
        session = new LoggingIOSession(targetSessionLog, targetWireLog, session, "http-sender");
    }//from  w  w  w  . j  a  va  2s  .c o m

    if (targetConnLog.isDebugEnabled() || targetHeaderLog.isDebugEnabled()) {
        return new LoggingNHttpClientConnection(session, config.getBufferSize(), config.getFragmentSizeHint(),
                HeapByteBufferAllocator.INSTANCE, ConnSupport.createDecoder(config),
                ConnSupport.createEncoder(config), config.getMessageConstraints(),
                StrictContentLengthStrategy.INSTANCE, StrictContentLengthStrategy.INSTANCE,
                requestWriterFactory, responseParserFactory, targetConnLog);
    } else {
        return new DefaultNHttpClientConnection(session, config.getBufferSize(), config.getFragmentSizeHint(),
                HeapByteBufferAllocator.INSTANCE, ConnSupport.createDecoder(config),
                ConnSupport.createEncoder(config), config.getMessageConstraints(),
                StrictContentLengthStrategy.INSTANCE, StrictContentLengthStrategy.INSTANCE,
                requestWriterFactory, responseParserFactory);
    }
}

From source file:org.apache.synapse.transport.utils.logging.LoggingNHttpServerConnectionFactory.java

public DefaultNHttpServerConnection createConnection(IOSession session) {
    if (sourceSessionLog.isDebugEnabled() || sourceWireLog.isDebugEnabled()) {
        session = new LoggingIOSession(sourceSessionLog, sourceWireLog, session, "http-listener");
    }/*www . java2  s.co  m*/

    if (sourceConnLog.isDebugEnabled()) {
        return new LoggingNHttpServerConnection(session, config.getBufferSize(), config.getFragmentSizeHint(),
                HeapByteBufferAllocator.INSTANCE, ConnSupport.createDecoder(config),
                ConnSupport.createEncoder(config), config.getMessageConstraints(),
                StrictContentLengthStrategy.INSTANCE, StrictContentLengthStrategy.INSTANCE,
                requestParserFactory, responseWriterFactory, sourceConnLog);
    } else {
        return new DefaultNHttpServerConnection(session, config.getBufferSize(), config.getFragmentSizeHint(),
                HeapByteBufferAllocator.INSTANCE, ConnSupport.createDecoder(config),
                ConnSupport.createEncoder(config), config.getMessageConstraints(),
                StrictContentLengthStrategy.INSTANCE, StrictContentLengthStrategy.INSTANCE,
                requestParserFactory, responseWriterFactory);
    }
}