1
package org.apache.http.contrib.logging;
3
* ====================================================================
4
* Licensed to the Apache Software Foundation (ASF) under one
5
* or more contributor license agreements. See the NOTICE file
6
* distributed with this work for additional information
7
* regarding copyright ownership. The ASF licenses this file
8
* to you under the Apache License, Version 2.0 (the
9
* "License"); you may not use this file except in compliance
10
* with the License. You may obtain a copy of the License at
12
* http://www.apache.org/licenses/LICENSE-2.0
14
* Unless required by applicable law or agreed to in writing,
15
* software distributed under the License is distributed on an
16
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17
* KIND, either express or implied. See the License for the
18
* specific language governing permissions and limitations
20
* ====================================================================
22
* This software consists of voluntary contributions made by many
23
* individuals on behalf of the Apache Software Foundation. For more
24
* information on the Apache Software Foundation, please see
25
* <http://www.apache.org/>.
29
import org.apache.http.HttpResponseFactory;
30
import org.apache.http.annotation.Immutable;
31
import org.apache.http.impl.DefaultHttpResponseFactory;
32
import org.apache.http.impl.nio.DefaultNHttpClientConnection;
33
import org.apache.http.impl.nio.DefaultNHttpClientConnectionFactory;
34
import org.apache.http.nio.reactor.IOSession;
35
import org.apache.http.nio.util.ByteBufferAllocator;
36
import org.apache.http.nio.util.HeapByteBufferAllocator;
37
import org.apache.http.params.HttpParams;
40
public class LoggingNHttpClientConnectionFactory extends DefaultNHttpClientConnectionFactory {
42
public LoggingNHttpClientConnectionFactory(
43
final HttpResponseFactory responseFactory,
44
final ByteBufferAllocator allocator,
45
final HttpParams params) {
46
super(responseFactory, allocator, params);
49
public LoggingNHttpClientConnectionFactory(final HttpParams params) {
50
this(new DefaultHttpResponseFactory(), new HeapByteBufferAllocator(), params);
54
protected DefaultNHttpClientConnection createConnection(
55
final IOSession session,
56
final HttpResponseFactory responseFactory,
57
final ByteBufferAllocator allocator,
58
final HttpParams params) {
59
return new LoggingNHttpClientConnection(session, responseFactory, allocator, params);