cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1368051 - in /cxf/sandbox/dkulp_async_clients/http-hc: ./ src/main/java/org/apache/cxf/transport/http/asyncclient/ src/test/resources/
Date Wed, 01 Aug 2012 15:20:24 GMT
Author: olegk
Date: Wed Aug  1 15:20:23 2012
New Revision: 1368051

URL: http://svn.apache.org/viewvc?rev=1368051&view=rev
Log:
Fixed HTTP protocol and i/o level logging

Added:
    cxf/sandbox/dkulp_async_clients/http-hc/src/test/resources/
    cxf/sandbox/dkulp_async_clients/http-hc/src/test/resources/log4j.properties   (with props)
Modified:
    cxf/sandbox/dkulp_async_clients/http-hc/pom.xml
    cxf/sandbox/dkulp_async_clients/http-hc/src/main/java/org/apache/cxf/transport/http/asyncclient/AsyncHTTPTransportFactory.java
    cxf/sandbox/dkulp_async_clients/http-hc/src/main/java/org/apache/cxf/transport/http/asyncclient/LoggingNHttpClientConnectionFactory.java

Modified: cxf/sandbox/dkulp_async_clients/http-hc/pom.xml
URL: http://svn.apache.org/viewvc/cxf/sandbox/dkulp_async_clients/http-hc/pom.xml?rev=1368051&r1=1368050&r2=1368051&view=diff
==============================================================================
--- cxf/sandbox/dkulp_async_clients/http-hc/pom.xml (original)
+++ cxf/sandbox/dkulp_async_clients/http-hc/pom.xml Wed Aug  1 15:20:23 2012
@@ -72,6 +72,12 @@
             <artifactId>slf4j-api</artifactId>
         </dependency>
         <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-log4j12</artifactId>
+            <version>1.6.2</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
             <groupId>org.apache.httpcomponents</groupId>
             <artifactId>httpcore-nio</artifactId>
             <version>4.2.1</version>

Modified: cxf/sandbox/dkulp_async_clients/http-hc/src/main/java/org/apache/cxf/transport/http/asyncclient/AsyncHTTPTransportFactory.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/dkulp_async_clients/http-hc/src/main/java/org/apache/cxf/transport/http/asyncclient/AsyncHTTPTransportFactory.java?rev=1368051&r1=1368050&r2=1368051&view=diff
==============================================================================
--- cxf/sandbox/dkulp_async_clients/http-hc/src/main/java/org/apache/cxf/transport/http/asyncclient/AsyncHTTPTransportFactory.java
(original)
+++ cxf/sandbox/dkulp_async_clients/http-hc/src/main/java/org/apache/cxf/transport/http/asyncclient/AsyncHTTPTransportFactory.java
Wed Aug  1 15:20:23 2012
@@ -115,15 +115,15 @@ public class AsyncHTTPTransportFactory e
         // Create client-side HTTP protocol handler
         HttpAsyncRequestExecutor protocolHandler = new HttpAsyncRequestExecutor();
         // Create client-side I/O event dispatch
-        final IOEventDispatch ioEventDispatch = new DefaultHttpClientIODispatch(protocolHandler,

-                new LoggingNHttpClientConnectionFactory(params));
+        final LoggingNHttpClientConnectionFactory connFactory = new LoggingNHttpClientConnectionFactory(params);
+        final IOEventDispatch ioEventDispatch = new DefaultHttpClientIODispatch(protocolHandler,
connFactory);
         // Create client-side I/O reactor
         IOReactorConfig config = new IOReactorConfig();
         config.setTcpNoDelay(true);
         
         final ConnectingIOReactor ioReactor = new DefaultConnectingIOReactor(config);
         // Create HTTP connection pool
-        pool = new BasicNIOConnPool(ioReactor, params);
+        pool = new BasicNIOConnPool(ioReactor, connFactory, params);
         pool.setDefaultMaxPerRoute(1000);
         pool.setMaxTotal(5000);
 

Modified: cxf/sandbox/dkulp_async_clients/http-hc/src/main/java/org/apache/cxf/transport/http/asyncclient/LoggingNHttpClientConnectionFactory.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/dkulp_async_clients/http-hc/src/main/java/org/apache/cxf/transport/http/asyncclient/LoggingNHttpClientConnectionFactory.java?rev=1368051&r1=1368050&r2=1368051&view=diff
==============================================================================
--- cxf/sandbox/dkulp_async_clients/http-hc/src/main/java/org/apache/cxf/transport/http/asyncclient/LoggingNHttpClientConnectionFactory.java
(original)
+++ cxf/sandbox/dkulp_async_clients/http-hc/src/main/java/org/apache/cxf/transport/http/asyncclient/LoggingNHttpClientConnectionFactory.java
Wed Aug  1 15:20:23 2012
@@ -19,18 +19,24 @@
 
 package org.apache.cxf.transport.http.asyncclient;
 
+import java.io.IOException;
+
+import org.apache.http.HttpHost;
 import org.apache.http.HttpResponseFactory;
 import org.apache.http.annotation.Immutable;
 import org.apache.http.impl.DefaultHttpResponseFactory;
 import org.apache.http.impl.nio.DefaultNHttpClientConnection;
 import org.apache.http.impl.nio.DefaultNHttpClientConnectionFactory;
+import org.apache.http.nio.NHttpClientConnection;
+import org.apache.http.nio.pool.NIOConnFactory;
 import org.apache.http.nio.reactor.IOSession;
 import org.apache.http.nio.util.ByteBufferAllocator;
 import org.apache.http.nio.util.HeapByteBufferAllocator;
 import org.apache.http.params.HttpParams;
 
 @Immutable
-public class LoggingNHttpClientConnectionFactory extends DefaultNHttpClientConnectionFactory
{
+public class LoggingNHttpClientConnectionFactory extends DefaultNHttpClientConnectionFactory

+    implements NIOConnFactory<HttpHost, NHttpClientConnection> {
 
     public LoggingNHttpClientConnectionFactory(
             final HttpResponseFactory responseFactory,
@@ -52,4 +58,10 @@ public class LoggingNHttpClientConnectio
         return new LoggingNHttpClientConnection(session, responseFactory, allocator, params);
     }
 
+    @Override
+    public NHttpClientConnection create(
+            final HttpHost route, final IOSession session) throws IOException {
+        return createConnection(session);
+    }
+    
 }

Added: cxf/sandbox/dkulp_async_clients/http-hc/src/test/resources/log4j.properties
URL: http://svn.apache.org/viewvc/cxf/sandbox/dkulp_async_clients/http-hc/src/test/resources/log4j.properties?rev=1368051&view=auto
==============================================================================
--- cxf/sandbox/dkulp_async_clients/http-hc/src/test/resources/log4j.properties (added)
+++ cxf/sandbox/dkulp_async_clients/http-hc/src/test/resources/log4j.properties Wed Aug  1
15:20:23 2012
@@ -0,0 +1,8 @@
+log4j.appender.stdout=org.apache.log4j.ConsoleAppender
+log4j.appender.stdout.Target=System.out
+log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
+log4j.appender.stdout.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n
+ 
+log4j.rootLogger=WARN, stdout
+log4j.logger.org.apache.http=WARN
+ 
\ No newline at end of file

Propchange: cxf/sandbox/dkulp_async_clients/http-hc/src/test/resources/log4j.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cxf/sandbox/dkulp_async_clients/http-hc/src/test/resources/log4j.properties
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: cxf/sandbox/dkulp_async_clients/http-hc/src/test/resources/log4j.properties
------------------------------------------------------------------------------
    svn:mime-type = text/plain



Mime
View raw message