~ubuntu-branches/ubuntu/vivid/httpcomponents-core/vivid

« back to all changes in this revision

Viewing changes to httpcore-contrib/src/main/java/org/apache/http/contrib/logging/LoggingNHttpClientConnectionFactory.java

  • Committer: Package Import Robot
  • Author(s): Emmanuel Bourg
  • Date: 2013-08-05 18:52:34 UTC
  • mfrom: (1.2.2)
  • Revision ID: package-import@ubuntu.com-20130805185234-k4wwbbt5f46a0j8k
Tags: 4.3-1
* New upstream release.
  - Added a build dependency on libbuild-helper-maven-plugin-java
  - Added maven-checkstyle-plugin to the list of ignored dependencies
  - debian/rules: Generate Java 1.5 compatible bytecode
* Updated debian/copyright
* Install the upstream changelog as /usr/share/doc/*/changelog.gz

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
package org.apache.http.contrib.logging;
2
 
/*
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
11
 
 *
12
 
 *   http://www.apache.org/licenses/LICENSE-2.0
13
 
 *
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
19
 
 * under the License.
20
 
 * ====================================================================
21
 
 *
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/>.
26
 
 *
27
 
 */
28
 
 
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;
38
 
 
39
 
@Immutable
40
 
public class LoggingNHttpClientConnectionFactory extends DefaultNHttpClientConnectionFactory {
41
 
 
42
 
    public LoggingNHttpClientConnectionFactory(
43
 
            final HttpResponseFactory responseFactory,
44
 
            final ByteBufferAllocator allocator,
45
 
            final HttpParams params) {
46
 
        super(responseFactory, allocator, params);
47
 
    }
48
 
 
49
 
    public LoggingNHttpClientConnectionFactory(final HttpParams params) {
50
 
        this(new DefaultHttpResponseFactory(), new HeapByteBufferAllocator(), params);
51
 
    }
52
 
 
53
 
    @Override
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);
60
 
    }
61
 
 
62
 
}